Character LCD with 4 Lines

Character LCD’s (like 2 lines with 16 characters each) as in this post are easy to use. Much easier to use compared to full graphical LCDs.

The ones I’m using have either 1 or 2 lines, but I saw that there are 4 line displays too. So far my LCD component only supports one or two lines.

4 Line LCD

4 Line LCD (Source: Ezequiel Bazotti)

Ezequiel Bazotti is a reader of this blog, and wanted to use his 4 line LCD. He pointed me to the data sheet of his LCD: He is using a WH1604A from Winstar Display Co. That display is using a HD44780 compatible protocol, works with 3V supply and logic levels, and can be configured to use 4 lines. The original HD44780 only supports up to two lines, so to use 4 Lines, I need to send the ‘2 lines mode’ command, but then use different display start addresses for each line:

  1. Line 1 starts at offset 0x00
  2. Line 2 starts at offset 0x40
  3. Line 3 starts at offset 0x10
  4. Line 4 starts at offset 0x50

However, other LCD’s like the Tianma TM204ABCWVBYA has 4 lines with 20 characters each, and the character map is as below:

  1. Line 1: from 00h to 13h
  2. Line 2: from 40h to 53h
  3. Line 3: from 14h to 27h
  4. Line 4: from 54h to 67h
4x20 LCD Tianma TM204ABCWVBYA (Source: David Karibe)

4×20 LCD Tianma TM204ABCWVBYA (Source: David Karibe)

These offsets are coded in the Processor Expert driver as constants/defines. The latest version of the component allows to enter the settings in the properties:

LCD Line Start Addresses

LCD Line Start Addresses

💡 Note that above addresses are in hexadecimal.

Consequently, the LCDHTA component offers up to 4 lines in the settings:

4 Lines Support in LCDHTA Component

4 Lines Support in LCDHTA Component

With this and coded ‘blindly’, it worked with the first try :-):

4 Line LCD in Action with FRDM-KL25Z (Source: Ezequiel Bazotti)

4 Line LCD in Action with FRDM-KL25Z (Source: Ezequiel Bazotti)

Happy Line-ing 🙂

5 thoughts on “Character LCD with 4 Lines

  1. Pingback: Character LCD with 4 Lines and up to 64 Characters per Line | MCU on Eclipse

  2. Pingback: Tutorial: HD44780 Display Driver with NXP MCUXpresso SDK | MCU on Eclipse

What do you think?

This site uses Akismet to reduce spam. Learn how your comment data is processed.