FreeRTOS HD44780 LCD driver

pugglewuggle wrote on Tuesday, January 06, 2015:

Hi,

I’m having issues where my HD44780 LCD screen is displaying garbage. Every now and then after reset part of my message will show up with garbled junk in it, otherwise it’s always junk. Has anyone done this with FreeRTOS/does anyone know how to do this in a way that will work? I believe it is a timing issue. I’m using vTaskDelay to control the timing for the pulses on the control lines. My understanding is that the HD44780 operates on a clock-locked signal so as I understand it the extra delays introduced by vTaskDelay/the kernel shouldn’t impact it functioning. Please correct me if I’m wrong. I figure someone will know something about this since this is a very common display controller.

Here’s the datasheet: https://www.sparkfun.com/datasheets/LCD/HD44780.pdf

heinbali01 wrote on Tuesday, January 06, 2015:

Hi Pugglewuggle,

Has anyone done this with FreeRTOS

Yes I wrote drivers for many different LCD displays, mostly ‘under’ FreeRTOS, sometimes Linux.

Using vTaskDelay(): for the timing it is economical, but depending on your configTICK_RATE_HZ, the delays will be veeery long.

Your display has an Enable Cycle Time (tcycE) of 1 us. I would first replace vTaskDelay() with delay(), a function that spins for a number of ns.
Try to mimic the timings from the manual, plus a little to make sure you’re not too fast.

Once you have it working with delay(), you might want to find less blocking ways to control the LCD.

The lines between MCU and LCD, are they being shared with other devices? With SDRAM or flash? Are you driving those lines like GPIO pins, or as a databus?

Can you read the LCD status correctly? Does your code always wait for DB7 to go low before any instruction ? Do you see it becoming high right after sending an instruction if you poll it continuously?

Getting the display into the correct mode (4- or 8-bits) is tricky: make sure you follow the protocol exactly as described in the manual. If possible, start this operation with a hard display reset.

Good luck.

tlafleur wrote on Tuesday, January 06, 2015:

I have some drivers for this display in the microchip pic24 section on the
freertos website that work…

this will give you a good starting point…

On Tue, Jan 6, 2015 at 9:03 AM, Hein Tibosch heinbali01@users.sf.net
wrote:

Hi Pugglewuggle,

Has anyone done this with FreeRTOS

Yes I wrote drivers for many different LCD displays, mostly ‘under’
FreeRTOS, sometimes Linux.

Using vTaskDelay(): for the timing it is economical, but depending on your
configTICK_RATE_HZ, the delays will be veeery long.

Your display has an Enable Cycle Time (tcycE) of 1 us. I would first
replace vTaskDelay() with delay(), a function that spins for a number of ns.
Try to mimic the timings from the manual, plus a little to make sure
you’re not too fast.

Once you have it working with delay(), you might want to find less
blocking ways to control the LCD.

The lines between MCU and LCD, are they being shared with other devices?
With SDRAM or flash? Are you driving those lines like GPIO pins, or as a
databus?

Can you read the LCD status correctly? Does your code always wait for DB7
to go low before any instruction ? Do you see it becoming high right
after sending an instruction if you poll it continuously?

Getting the display into the correct mode (4- or 8-bits) is tricky: make
sure you follow the protocol exactly as described in the manual. If
possible, start this operation with a hard display reset.

Good luck.

FreeRTOS HD44780 LCD driver
https://sourceforge.net/p/freertos/discussion/382005/thread/cfd5b862/?limit=25#ee16

Sent from sourceforge.net because you indicated interest in
SourceForge.net: Log In to SourceForge.net

To unsubscribe from further messages, please visit
SourceForge.net: Log In to SourceForge.net

~~ _/) _/) _/) ``` _/) ~~

Tom Lafleur