Serial Wombat
a general-purpose digital interface device for hobbyists, engineers and students

 


Home
Overview
Protocol
Documentation
Channel Modes
Direct Control
Controlled Pin
Raw A/D
A/D Averaging
A/D 1st Order Filtering
Matrix Keypad
Servo Control
Analog Direct
Analog Follow
Rotary Encoder
Debouncing
Counter
Hysteresis
Morse Code
Pulse
Unipolar Stepper
LCD Driver 1
LCD Driver 2
HW Pulse Meas.
2D Lookup
SPI Master
HD44780 Generic
Remote Control
DataLogger
Min-Max
Public Data
Timed IO
Getting Started
Connectivity
Pin Mode SDK Beta
Sample Projects
Downloads
Contact Us
Purchase
Forum

Did you know...

 

Serial Wombat HD44780 Generic Channel Mode

Based on user feedback, a generic HD44780 LCD controller driver is available beginning in version 2.0 of the firmware. This Channel mode doesn't do as much to hide the internal details of the HD44780 as the other HD44780 mode does, but rather than working for a specific 2 x 24 layout, this driver should work for any HD44780 LCD. In addition, characters and graphics can be placed on the LCD without using any internal Wombat user RAM.

In order to use an HD44780 controller with this mode there are a few things you need to know about it:

  • The HD44780 has 80 bytes of internal RAM. Whatever is in this RAM is displayed on the LCD. Even if your LCD is smaller than 80 total characters, there's still 80 bytes of RAM.
  • The 80 bytes don't always display in a logical way. For instance, in a 4 line x 20 character display, it is common to see line 1 start at RAM address 0, line 2 start at RAM address 40, Line 3 start at RAM address 20, and Line 4 start at RAM address 60. This is due to the way that the physical glass is most easily wired to the driver chips controlled by the HD44780.
  • The LCD needs to be initialized before characters can be displayed. This involves telling the HD44780 whether it's attached to Glass with 1 line or more than 1, whether to display a cursor as invisible, block, or line, whether to move the cursor after receiving a data byte, whether to scroll the screen after receiving a data byte and a few other miscellaneous settings. See the HD44780 data sheet for more information. The Channel Mode 200 command does a generic initialization for a multi-line display with an invisible cursor, advancing the cursor after each data byte write.
  • The HD44780 has a Read/Write line. This channel mode assumes that this line is always low, for writing.

Message format:

Message 200 does a typical initialization for an HD44780 based display. The user must supply the pin numbers for the LCD's R/S line, and D4, D5, D6 and D7 lines.

Data Sent to the Wombat: 200 Pin # 27 RS Pin D4 Pin D5 Pin D6 Pin D7 Pin
Meaning: Configure Pin First message Wombat Pin Number Connected to the LCD E pin Generic HD44780 Mode The Wombat Pin Number connected to the LCD RS Pin The Wombat Pin Number connected to the LCD D4 Pin The Wombat Pin Number connected to the LCD D5 Pin The Wombat Pin Number connected to the LCD D6 Pin The Wombat Pin Number connected to the LCD D7 Pin
This message is echoed back by the Wombat.

 

Message 201 is used to put data into the HD44780's internal display string. The first data byte is the address in the HD44780 memory to place bytes at. The next 4 bytes are data to be placed into the HD44780 memory. This command should only be used after a 200 configuration command has been issued for the LCD.
Data Sent to the Wombat: 201 Pin # 27 HD44780 address Data Data Data Data
Meaning: Configure Pin Second message Wombat Pin Number Connected to the LCD E pin Generic HD44780 Mode This value, between 0 and 79, determines where data is placed in the HD44780 Character to be placed at address Character to be placed at address +1 Character to be placed at address + 2 Character to be placed at address +3
This message is echoed back by the Wombat.

 

The 202 message is used to download custom characters into the LCD's character generation ram. HD44780 lcd displays hold up to eight custom characters, which are stored in 64 bytes of the LCD's memory. Each character is 5 pixels wide, by 8 pixels long. In order to program a custom character, send two 203 messages to the Wombat containing the 8 bytes making up the bitmap. In each message, provide an offset into the character-generation RAM, and four bytes of the bitmap. This message should be sent after the 202 message. This message may take up to 600uS to complete, and processing of other functions will be suspended during this time. This command should only be used after a 200 configuration command has been issued for the LCD.

Data Sent to the Wombat: 202 Pin # 27 Offset into Character generation RAM Bitmap data line (uppermost) Bitmap data line Bitmap data line Bitmap Data Line
Meaning: Configure Pin Third message The Wombat Pin connected to the 'E' line of the LCD Generic HD44780 Mode 0: Top of 1st char
4: Bottom of 1st char
8: Top of 2nd char
12: Bottom of 2nd char
...and so on up to 8 chars
Bitmap bytes use the least-significant 5 bits to describe the 5 pixels of the character line. The rightmost pixel is the least-significant bit. '1' bits are black pixels.
This message is echoed back by the Wombat.

Message 203 is used to configure the HD44780 generic driver to continuously update the HD44780's internal data memory from the Wombat's User RAM area. The user provides an address in the Wombat User RAM area. 80 bytes starting at that address are copied into the HD44780, one byte per Wombat Frame (1ms by default). After 80 bytes are copied, the Wombat returns to the first byte, and begins the copy again. Since the driver is generic for any HD44780 display, 80 bytes are always used. Bytes in Wombat RAM will be wasted for LCDs smaller than 80 characters, and the string in Wombat Memory may not line up directly on the LCD. This mode is provided primarily for use with the forthcoming Pin Mode Software Development kit, so that pin modes can display strings on an LCD attached to another pin. This command should only be used after a 200 configuration command has been issued for the LCD.

Data Sent to the Wombat: 203 Pin # 27 Wombat User RAM address (high byte) Wombat User RAM address (low byte) 0x55 0x55 0x55
Meaning: Configure Pin Fourth message The Wombat Pin connected to the 'E' line of the LCD Generic HD44780 Mode Address in Wombat User RAM Area holding string to be continuously copied the HD44780 Unused. Unused. Unused.
This message is echoed back by the Wombat.

Message 204 is used to send command or data bytes to the LCD. Up to two command or data bytes can be sent per 8 byte packet. These commands can be used to change the way the LCD functions, such as making the character visible, or making the LCD scroll. See the HD44780 datasheet for details.

Data Sent to the Wombat: 204 Pin # 27 Following byte meaning Byte to send to LCD Following byte meaning Byte to send to LCD 0x55
Meaning: Configure Pin Fifth message The Wombat Pin connected to the 'E' line of the LCD Generic HD44780 Mode 0: Discard
1: Command Byte
2: Data Byte
Meaning is determined by previous byte 0: Discard
1: Command Byte
2: Data Byte.
Meaning is determined by previous byte Unused.
This message is echoed back by the Wombat.

Example:

Display the string "Hello World" on an HD44780 based LCD with E on pin 33, RS on pin 34, and D4-D7 on pins 35-38, and make the cursor visible

200 33 27 34 35 36 37 38 ; Set pin 33 to HD44780 mode,
                           ; RS pin is 34
                           ; D4 - D7 ar 36 - 38

201 33 27 0 "Hell"         ; Set pin 33 to HD44780 mode
                           ; Put the characters "HELL" in 
                           ; the display starting at address 0
201 33 27 4 "O WO"         ; Set pin 33 to HD44780 mode
                           ; Put the characters "O WO" in 
                           ; the display starting at address 4
201 33 27 4 "RLD "         ; Set pin 33 to HD44780 mode
                           ; Put the characters "RLD " in 
                           ; the display starting at address 8
                           ; Note that we added a space to complete 
                           ; the 4 bytes.
204 33 27 1 0x07 0 0x55 0x55 ; Send a command byte 0x07.  This 
                           ; causes the display to turn on the 
                           ; cursor.  (see datasheet for HD44780)
                           ; Second byte for this command is
                           ; Discarded.
 

Copyright Wombat Interface Products, 2005-2008. All Rights Reserved.