AnsweredAssumed Answered

LCD INTERFACING USING MQX

Question asked by OLIVIA CHRISTY VARGHESE on Apr 11, 2017
Latest reply on Apr 17, 2017 by Daniel Chen

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

Outcomes