Quality RTOS & Embedded Software

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




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) 2004-2010 Richard Barry. Copyright (C) 2010-2016 Real Time Engineers Ltd.
Any and all data, files, source code, html content and documentation included in the FreeRTOSTM distribution or available on this site are the exclusive property of Real Time Engineers Ltd.. See the files license.txt (included in the distribution) and this copyright notice for more information. FreeRTOSTM and FreeRTOS.orgTM are trade marks of Real Time Engineers Ltd.

Latest News:

FreeRTOS V9.0.0 is now available for download.


Free TCP/IP and file system demos for the RTOS


Sponsored Links

⇓ Now With No Code Size Limit! ⇓
⇑ Free Download Without Registering ⇑


FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Renesas Electronics Gold Alliance RTOS Partner.jpg

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

Atmel RTOS partner supporting ARM Cortex-M3 and AVR32 microcontrollers

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

Xilinx Microblaze and Zynq partner

Silicon Labs low power RTOS partner

Altera RTOS partner for Nios II and Cortex-A9 SoC

Freescale Alliance RTOS Member supporting ARM and ColdFire microcontrollers

Infineon ARM Cortex-M microcontrollers

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

Cypress RTOS partner supporting ARM Cortex-M3

Fujitsu RTOS partner supporting ARM Cortex-M3 and FM3

Microsemi (previously Actel) RTOS partner supporting ARM Cortex-M3

Atollic Partner

IAR Partner

Keil ARM Partner

Embedded Artists