|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Did you know...
|
Serial Wombat HD44780 Generic Channel ModeBased 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:
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.
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.
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.
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.
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.