LCD INTERFACING USING MQX

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

LCD INTERFACING USING MQX

477 Views
oliviachristyva
Contributor III

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(&regslct,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

0 Kudos
1 Reply

317 Views
danielchen
NXP TechSupport
NXP TechSupport

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

0 Kudos