HD44780 LCD – VIDEO TUTORIAL USING VHDL & ALTERA DE2

ALTERA DE2 HD44780 LCD
ALTERA DE2 HD44780 LCD

Hi Folks,

Well I finally managed to figure this all out, and put together a Full instructional video. This video series that I have put together  explains the fundamental concepts and signal requirements for driving the HD44780 LCD display unit using the VHDL hardware description language.

The  VHDL code has been compiled to be used with the Altera Cyclone II FPGA on the Altera DE2 development board. However, you can modify the code slightly to port it to other development boards or FPGA’s and CPLD’s.

In the videos I review the signal requirements using actual waveform scans from a Logic Analyzer that show the Control and 8-bit databus signals used to drive the HD44780 display through its initialization sequence and then a character display sequence for printing a custom message onto the LCD screen.

The signals scanned are all generated by a VHDL source file programmed onto an Altera Cyclone II FPGA on the Altera DE2 development board.  This VHDL file produces a 32 character message to be displayed on the HD44780 LCD screen.

After reviewing the Waveform scans I briefly go over the VHDL code step by step to explain how it all works.

I will be providing a link to a devoted webpage on my Website for this project where I will provide further images and information and also extra links to other files such as the VHDL code source file for you to download. With this, you can try and create your own custom messages on an FPGA or CPLD board of your choosing.

http://www.digital-circuitry.com/Projects_LCD_DISPLAYS.htm

Cheers!
Gerry O’Brien
http://www.digital-circuitry.com

5 thoughts on “HD44780 LCD – VIDEO TUTORIAL USING VHDL & ALTERA DE2”

  1. A more elegant and less messy approach would be using a conversion function from ASCII string to STD Logic Vector
    http://stackoverflow.com/a/22910022

    – – –

    I’m also a little bit puzzled about why you’re using 400Hz (hence, 2.5ms for a tick) which i assume suits more than enough the delays and execution times needed/processed by each instruction, am i right?

    where in the datasheet there’s reference about frequency effects?

    The datasheet of HD44780 shows a flowchart which using a little bit different timing ( see: http://web.alfredstate.edu/weimandn/lcd/lcd_initialization/Initialization%208-Bit%20Interface.gif ):

    Step 1. Power on, then delay > 15 ms (!)
    Step 2. Instruction 00110000b (30h), then delay > 4.1 ms (!)
    Step 3. Instruction 00110000b (30h), then delay > 100 us
    Step 4. Instruction 00110000b (30h), then delay > 100 us
    Step 5. Instruction 00111000b (38h), then delay > 53 us or check BF
    Step 6. Instruction 00001000b (08h), then delay > 53 us or check BF
    Step 7. Instruction 00000001b (01h), then delay > 3 ms or check BF
    Step 8. Instruction 00000110b (06h), then delay > 53 us or check BF
    Step 9. Initialization ends

    (Source: http://web.alfredstate.edu/weimandn/lcd/lcd_initialization/lcd_initialization_index.html )

    Instruction execution times: 1.64ms / 40us
    ( http://mil.ufl.edu/4744/docs/lcdmanual/commands.html )
    in some datasheets of HD44780(U) it’s 1.53ms / 37us accordingly.

    I’m Just a little bit confused 🙂

    Especially due to the successful try running this solution:
    https://www.eewiki.net/display/LOGIC/Character+LCD+Module+Controller+%28VHDL%29

    which doesn’t take in consideration that the ‘function set’ instruction should be sent 3 times.

    Help me out here to figure it out for good, would you?

    1. Hi Michael,

      Sorry for the long delay…I’ve been out of town.

      I’m currently at work and can’t answer right now…but I’ll look over your questions this weekend and see if I can explain the timing a little more thoroughly. I’m actually right in the middle of editing a 3rd video to add to my Instructional video set for this series. I’ve just been so busy at work it has prevented me from logging in any Hobby hours within the Lab at home.

      Anyhow,
      I’ll try and include that 3rd video with my reply this weekend.

      I’ll be in touch!
      Cheers!
      -Gerry

      P.S. Thanks for the Tip regarding the Conversion function!! :))
      Sweet!!

  2. Additional information if someone will come across this problem:

    I’m using ‘LCD M1632 – Seiko’, Datasheet: http://ge.tt/2uxvXEK2/v/0?c

    You can see from this photo of the back it’s using HD44780(A00):
    https://arduinodiy.files.wordpress.com/2012/03/lcd-2.jpg

    Here’s ‘HD44780U (LCD-II)’ Datasheet: http://web.stanford.edu/class/ee281/handouts/hd44780_lcd_controller_datasheet.pdf

    I assume HD44780(A00) and HD44780U Should be compatible, except maybe execution times and pinout

    M1632 is using reversed pinout from HD44780U:
    https://arduinodiy.wordpress.com/2012/03/30/identifying-lcd-modules/

Leave a Reply