Hi,
I'm trying to interface 8x2 lcd using parallel interfacing[4 bit mode], Display used - 8x2 lcd [PC 0802--A] ST7066U--Dot Matrix LCD Controller/Driver
Since i'm trying to interface using GPIO pins, not using I2C or SPI interface, and since no drivers are there for this particular MCU[LPC845], I compared with lpc2148 MCU [lcd.c and lcd.h files], and have made the changes, but not able to write to the display.
And when checked the data/command signals in the oscilloscope, in data pins I'm getting float voltages[i.e., for d4-D7] LOW signal on this pins, and high signals on command pins[RS,RW,EN].
Kindly suggest me the process of writing the char/string to the display varies for ARM mcu?as i'm referring lpc2148 libraries.
Thank you
Hi,
The LPC845 does not have LCD interface, you would like to use GPIO to simulate the LCD timing so that you can write data to the LCD display.
Can you use the LPC family which has LCD interface for example LPC54xxx for example LPC54608?
LPC546XX Microcontroller (MCU) Family | NXP
If you do want to use the LPC845, can you post the LCD data sheet so that we can check the LCD interface timing?
BR
Xiangjun rong
Yes sir I'm using GPIO's for interfacing and writing data to display, since we have started
working on LPC845 mcu, is there any other MCU compatible to this and there 8x2 LCD
display used?
I have attached the datasheet and the code for reference.
Please suggest me on this.
Thank you
Hi,
You have to configure the GPIO pins as GPIO output mode, you can set and clear the pins as you expected.
Firstly, you have to enable the GPIO clock.
Pls refer to the section 8.6.22 System clock control 0 register. For example, you can set the GPIO0 clock with the code:
SYSCON->SYSAHBCLKCTRL0|=1<<6|1<<20|1<<18; //enable the GPIO0, GPIO1 and IOCON modules clock
SYSCON->PRESETCTRL0|=1<<61<<20; //clear GPIO reset, the line may be unnecessary
Then you can set the GPIO direction register
GPIO->DIR[0]|=1<<(GPIOPinIndex);
then you can set/clear the pin
//set pin
GPIO->SET[0]=1<<(GPIOPinIndex);
//clear pin
GPIO->CLR[0]=1<<(GPIOPinIndex);
Pls have a try
Hope it can help you
BR
Xiangjun Rong
Sir thanks for the explanation, before trying this I had changed for below configuration registers
LPC_SYSCON->SYSAHBCLKCTRL0 |= (WKT|MRT|GPIO);
LPC_SYSCON->SYSAHBCLKCTRL[0] |= GPIO1;
LPC_SYSCON->SYSAHBCLKCTRL[0] |= GPIO0;
And after I compiled with the above changes getting junk/characters on display, then again
added the above configuration to try with the configuration for the GPIO clock you suggested,
but getting blank display, so cross checking with the data pins again.
Thank you
Hi,
I suggest you connect the GPIO pin to a oscilloscope and check if the GPIO toggles after you set/clear the GPIO pins by code, if the GPIO pin toggles, it means that the code is okay.
BR
XiangJun Rong
Ok sir will check it, but kindly tell me
all 4 data pins[d4-d7] used should toggle?
And what should be the status of RS,RW,EN port pins?
It should remain high[control pins]? Please confirm
Thank you