Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem TCP & FAT




Loading

FreeRTOS HD44780 LCD driver

Posted by pugglewuggle on January 6, 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


FreeRTOS HD44780 LCD driver

Posted by heinbali01 on January 6, 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.


FreeRTOS HD44780 LCD driver

Posted by tlafleur on January 6, 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...

http://www.freertos.org/InteractiveFrames/OpenFrames.html?http://interactive.freertos.org/forums

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 configTICKRATEHZ, 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

Sent from sourceforge.net because you indicated interest in https://sourceforge.net/p/freertos/discussion/382005/

To unsubscribe from further messages, please visit https://sourceforge.net/auth/subscriptions/

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

Tom Lafleur

Attachments

alternate (3003 bytes)


[ Back to the top ]    [ About FreeRTOS ]    [ Sitemap ]    [ ]




Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.

Latest News

FreeRTOS kernel V10 is available for immediate download. Now MIT licensed.


FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

IAR Partner

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

STMicro RTOS partner supporting ARM7, ARM Cortex-M3, ARM Cortex-M4 and ARM Cortex-M0

Texas Instruments MCU Developer Network RTOS partner for ARM and MSP430 microcontrollers

OpenRTOS and SafeRTOS