7
CS-280 Dr. Mark L. Hornick 1 Programming for the LCD Display

CS-280 Dr. Mark L. Hornick 1 Programming for the LCD Display

Embed Size (px)

Citation preview

Page 1: CS-280 Dr. Mark L. Hornick 1 Programming for the LCD Display

CS-280Dr. Mark L. Hornick

1

Programming for the LCD Display

Page 2: CS-280 Dr. Mark L. Hornick 1 Programming for the LCD Display

CS-280Dr. Mark L. Hornick

2

The LCD display unit has its own built-in microcontroller Contains its own UART serial comm

3 wires: +5v, GND, and RXD (no TXD – does not transmit!) Fixed comm parameters: 9600 baud, 8 data bits, no parity, 1

stop bit

Contains a character generator creates the “bitmaps” for the characters to display controls the pixels of the physical display can display 2 lines of 16 characters

Page 3: CS-280 Dr. Mark L. Hornick 1 Programming for the LCD Display

CS-280Dr. Mark L. Hornick

3

The LCD microcontroller needs 20ms to “boot”

The Atmega32 starts executing instructions much sooner than that, so you must make sure to wait at least 20ms before sending characters to the LCD

Upon “boot”, the LCD displays a blinking cursor at cursor position 0.

Page 4: CS-280 Dr. Mark L. Hornick 1 Programming for the LCD Display

CS-280Dr. Mark L. Hornick

4

The LCD display can display the ASCII characters 32 (0x20) to 127 (0x7F) , except 92 (\)and 126(~)

When you send a byte representing the value 0x30, the ‘0’ character is displayed on the LCD.

The cursor is automatically advanced to the next character display position.

So what happens when you send the LCD the values0 through 31?

Page 5: CS-280 Dr. Mark L. Hornick 1 Programming for the LCD Display

CS-280Dr. Mark L. Hornick

5

The ASCII characters 0 to 31 (0x1F) are control characters that

When you send a byte representing the value 0x08, the cursor is moved left . Sending 0x09 moves it to the right.

Sending 0x0A moves the cursor down.

0x0C clears the screen; this is a reset that takes 5ms to process.

0x0D moves the cursor to the beginning of the next line.

0x12 turns the backlight off;0x16-0x19 activate different cursor displays.

Page 6: CS-280 Dr. Mark L. Hornick 1 Programming for the LCD Display

CS-280Dr. Mark L. Hornick

6

Page 7: CS-280 Dr. Mark L. Hornick 1 Programming for the LCD Display

CS-280Dr. Mark L. Hornick

7