Hello guys,
I am trying to interface LCD in 4 bit mode using MQX. There are a lot of example code available and in every code i found that the data is send to the particular port of the lcd .
like this..
void lcddata(char dataout)
{
PORTD = dataout;
LCD_RS = 1 ; //PORTA|=(1<<rs);
RA0 = 1 ;
LCD_RW = 0 ; //PORTA&=~(1<<rw);
LCD_STROBE ;
}
but i dont know how to implement this with mqx.
i tried and this is what i found is this right?
void lcd_cmd1( char * LCDCmd)
{
lwgpio_set_value(&enable,LWGPIO_VALUE_LOW);
GPIOC_PDOR = 0x03;
lwgpio_set_value(®slct,LWGPIO_VALUE_LOW);
lwgpio_set_value(&readwrite,LWGPIO_VALUE_LOW);
lwgpio_set_value(&enable,LWGPIO_VALUE_HIGH);
_time_delay(50);
lwgpio_set_value(&enable,LWGPIO_VALUE_LOW);
}
writing directly to the data register of the port.
Thanks and regards,
Olivia
Hi Olivia:
Please refer to the attached file,it includes a GPIO initialization and writing data to this GPIO
it is from the eGUI/D4D demo under MQX.
Please also refer to the below link ,it might help
https://community.nxp.com/message/309877
Regards
Daniel