Pages

Thursday, January 17, 2013

MCP23008 IO Expander - LCD1602







































http://www.blogger.com/blogger.g?blogID=1840459474737789074#editor/target=post;postID=6469744346264375992


I forgot how to display a character in the LCD, so I read my old Neduino function to refresh my memory.  It seems simple, just write the ASCII character byte as two nibbles.  So to display big A with ASCII code 0x41, I should write the upper nibble 0x4, then the lower nibble 0x1, then the big letter A should be displayed.

So I appended the following to the end of the LCD1602 initialization function.

   # * Display character big A *
    charUpperNibble = 0x4
    charLowerNibble = 0x1

    dataByte = LcdWriteDataNibble(registerBaseAddress, dataByte, charUpperNibble, DataRegister,
               ShortOperationDelay)
    PrintEightBitPattern("dataByte16 = ", dataByte)
    dataByte = LcdWriteDataNibble(registerBaseAddress, dataByte, charLowerNibble, DataRegister,

               ShortOperationDelay)
    PrintEightBitPattern("dataByte17 = ", dataByte)



However, when I execute the program, there was not A coming out, but the cursor jumped to the second line.
I checked the code again but found nothing suspecious.  Then I executed the program again.  This time it works,I saw the big A.  But I don't know why it didn't work the first time

So far so good.  Time I went to bed.

.END

Sitronix ST7066U Dot Matrix LCD Controller/Driver

Features

*  5 x 8 and 5 x 11 dot matrix possible

*  4-bit or 8-bit MPU interface enabled

*  80 x 8-bit display RAM (80 characters max.)

*  13,200-bit character generator ROM for a total of 240 character fonts(5 x 8 dot or 5 x 11 dot)

*  64 x 8-bit character generator RAM

-- 8 character fonts (5 x 8 dot)

-- 4 character fonts (5 x 11 dot)

*  16-common x 40-segment liquid crystal display driver

*  Wide range of instruction functions: Display clear, cursor home, display on/off, cursor on/off, display character blink, cursor shift, display shift

The ST7066U dot-matrix liquid crystal display controller and driver LSI displays alphanumeric, Japanese kana characters, and symbols.

It can be configured to drive a dot-matrix liquid crystal display under the control of a 4- or 8-bit microprocessor.

Since all the functions such as display RAM, character generator, and liquid crystal driver, required for driving a dot-matrix liquid crystal display are internally provided on one chip, a minimal system can be interfaced with this controller/driver.

The ST7066U has pin function compatibility with the HD44780, KS0066 and SED1278 that allows the user to easily replace it with an ST7066U. The ST7066U character generator ROM is extended to generate 240 5x8(5x11) dot character fonts for a total of 240 different character fonts. The low power supply (2.7V to 5.5V) of the ST7066U is suitable for any portable battery-driven product requiring low power dissipation.

The ST7066U LCD driver consists of 16 common signal drivers and 40 segment signal drivers which can extend display size by cascading segment driver ST7065 or ST7063. The maximum display size can be either 80 characters in 1-line display or 40 characters in 2-line display. A single ST7066U can display up to one 8-character line or two 8-character lines.
 

.END2


 

No comments:

Post a Comment