Page 3 of 3

Re: palWriteGroup() macro

Posted: Fri Sep 20, 2013 9:27 pm
by Giovanni
Hi,

A bus can only include contiguous pins on the same port.

palWriteGroup() and palWriteBus() are similar except that the first is a macro and the second uses that bus structure. palWritePort() simply operates on the whole port, not a subset of pins.

Giovanni

Re: palWriteGroup() macro

Posted: Sat Sep 21, 2013 9:39 am
by avtop
Hi giovani

Thx for replay, will pls give sample code to better understand what I want to do 16 bit data to 8bit LCD Interface

thx

Re: palWriteGroup() macro

Posted: Sat Sep 21, 2013 10:49 am
by Giovanni
You should give details, your description is not sufficient to write code. You may also give a look to uGFX, they have already several LCD drivers.

Giovanni

Re: palWriteGroup() macro

Posted: Mon Sep 23, 2013 10:51 am
by avtop
what I Have
PB0,PB2,PB3,PB4,PB5,PB6,PB7,PB10 pin for Lower 8bit
A16,A15,A14,A12,A0,A1,A2,A4 for Higher 8bit
can I use this as bus
Thx

Re: palWriteGroup() macro

Posted: Mon Sep 23, 2013 11:37 am
by Giovanni
You can't make a bus, bits are on different ports and not contiguous. You have to write your own functions in order to align the bits properly and then use palReadPort() and palWritePort() in order to implement an read-modify-write cycle.

It is very complex, setting bits one by one would be easier but not efficient. You should at least try to use contiguous pins.

Giovanni

Re: palWriteGroup() macro

Posted: Wed Sep 25, 2013 3:24 pm
by avtop
I have MapleMini Board
What I am trying to set GPIOB.4,GPIOB.3 set as
palSetPadMode(GPIOB, 3, PAL_MODE_OUTPUT_PUSHPULL);
after all I did but always I both pins are float line INPUT this pins are JTAG pins Is that any setting in config for JTAG to use or disable or else what I do to check ,
Code is just to make high low in these pins nothing else
Thx

Re: palWriteGroup() macro

Posted: Sat Sep 28, 2013 2:34 pm
by avtop
Hi

I am not getting control(no Output) on PB3 and PB4 Pin
and PB0,PB1,PB2, PB5 is giving response on SW Press
Code is onlt this line GPIOB,8 is Input Pin In MApleMini same code well working in MapleIDE

int main(void){
// halInit(); // initialize hardware abstraction layer
// chSysInit(); // initialize ChibiOS kernel
GPIOB->CRL = 0x88333333;
while(1){

if(palReadPad(GPIOB, 8))
{
GPIOB->BSRR = 0b00111111;
}
else
{
GPIOB->BRR = 0b00111111;
}
// chThdSleepMilliseconds(500);
}
}

Re: palWriteGroup() macro

Posted: Sat Sep 28, 2013 3:50 pm
by Giovanni
It is because without initialization GPIO is not clocked.

Giovanni

Re: palWriteGroup() macro

Posted: Sun Sep 29, 2013 7:16 pm
by avtop
HI

i have tried with
#include "ch.h"
#include "hal.h"
also

but PB0,PB2,PB5,PB6 is giving response with PB1 as Input
ONLY PB3 and PB4 is opwndrain input
may GPIO clk init. by MapleMini Bootloader

I checked the GPIOB->CRL Data also its set as Output those Pin I set those pin as PUSH-PULL-OUTPUT so GPIOB-CRL is 0x88333383 return value

THX