nex-robotics 20x4 serial lcd module

9
Serial LCD Module 20x4 Character Serial LCD NEX Robotics Pvt. Ltd. 1 www.nex-robotics.com

Upload: ashok-kumar

Post on 09-Nov-2015

47 views

Category:

Documents


2 download

DESCRIPTION

lcd 20x4

TRANSCRIPT

  • Serial LCD Module

    20x4 Character Serial LCD

    NEX Robotics Pvt. Ltd. 1www.nex-robotics.com

  • Serial LCD Module

    Notice:

    The contents of this manual are subject to change without notice. All efforts have been madeto ensure the accuracy of contents in this manual. However, should any errors be detected,NEX Robotics welcomes your corrections. You can send us your queries / suggestions at [email protected]

    Content of this manual is released under the Creative Commence cc by-nc-sa license. Forlegal information refer to: http://creativecommons.org/licenses/by-nc-sa/3.0/legalcode

    Products electronics is static sensitive. Use the product in static freeenvironment.

    Read the user manuals completely before using this product

    Recycling:

    Almost all the parts of this product are recyclable. Please send this product to the recyclingplant after its operational life. By recycling we can contribute to cleaner and healthierenvironment for the future generations.

    NEX Robotics Pvt. Ltd. 2www.nex-robotics.com

  • Serial LCD Module

    INDEX1.0 Introduction..........................................................................................................................41.1 Features................................................................................................................................41.2 Hardware Connection...........................................................................................................42.0 Command's for 20x4 Serial LCD.........................................................................................52.1 Set cursor (1-80)...................................................................................................................52.2 Set cursor (line,column).......................................................................................................52.3 Text on LCD Display............................................................................................................62.4 Custom character generator..................................................................................................63.0 Command Table for Serial LCD module..............................................................................84.0 Controlling 20x4 serial LCD from PC.................................................................................94.1 Software................................................................................................................................94.2 Set cursor..............................................................................................................................94.3 Text on LCD Display............................................................................................................94.4 Custom character generator..................................................................................................9

    NEX Robotics Pvt. Ltd. 3www.nex-robotics.com

  • Serial LCD Module

    1.0 Introduction:

    The serial 20x4 LCD module from nex robotics can be controlled over I2C or standard serialport with TTL 5V level signals. This dramatically reduces the number of pins consumed byLCD while interfacing with a microcontroller. It uses only two lines (TX and RX) forcommunication with any device. A well defined and easy to use protocol ensures smooth anderror free operation.

    1.1 Features:

    1. TTL 5V interface2. Up to 8 custom characters can be defined3. 5 8 dot matrix 4. 80 X 8-bit display RAM (80 characters max.) for 20X4 LCD5. Low power consumption6. Serial Interface: Baud Rate 9600,8-N-1,No Flow control7. Operational Backspace8. Back light ON/OFF9. Inbuilt 560 character buffer is available

    Note:Do NOT connect RS232 level interface directly to the module. It will destroy themodule and will make it non-operational.

    1.2 Hardware Connection:

    NEX Robotics Pvt. Ltd. 4www.nex-robotics.com

  • Serial LCD Module

    2.0 Command's for 20x4 Serial LCD:

    2.1 Set cursor (1-80):Set cursor to a position specified by one byte after command, where 01(0x01) isthe top left and 80(0x50) is the bottom right position.

    AVR Example:

    // move the cursor to the specific positionvoid cursor_set(unsigned char cursorPosition){

    while(!(UCSRA & (1

  • Serial LCD Module

    while(!(UCSRA & (1

  • Serial LCD Module

    Address to write custom character

    Address to read custom character

    1 0x802 0x813 0x824 0x835 0x846 0x857 0x868 0x87

    Table 2AVR Example:

    // Generate custom charactervoid custom_char_generate(){

    custom_bit_pattern[]={0x80,0x84,0x8E,0x95,0x84,0x84,0x84,0x80};

    while(!(UCSRA & (1

  • Serial LCD Module

    3.0 Command Table for Serial LCD Module:

    Decimal Hex Command Description 0 0x00 null (ignored) Ignored as a no operation1 0x01 Cursor Home Sets the cursor to the home position (top left)

    2 0x02 Set cursor (1-80)Cursor to a position specified by the next byte, where 1 is the top left and 80(0x50) is the bottom right

    3 0x03 set cursor (line, column)

    Sets cursor using two bytes, where first byte is the line and the second byte is the column

    4 0x04 Hide cursor stops the position cursor from appearing on the display

    5 0x05 Show underline cursor

    Changes the cursor to the underline type

    6 0x06 Show blinking cursor

    Changes the cursor to the blinking type

    8 0x08 Backspace deletes the preceding character from the current position on the display

    9 0x09 Horizontal tab (by tab set) Moves the current position across by the tab (default tab space 4)

    10 0x0A Smart line feed Moves the cursor down one line to the position beneath in the same column

    11 0x0B Vertical tab Moves the cursor up one line to the position above in the same column

    12 0x0C Clear screen Clears the screen and sets cursor to the home position

    13 0x0D Carriage Return Moves the cursor to the start of the next line

    14 0x0E Display Off No character display on LCD

    15 0x0F Software Version Module returns a single byte software version

    17 0x11 Clear Column Clears the contents of the current column and moves cursor right by one column

    18 0x12 Tab set Sets the required tab size, the following byte can be a size of between 1 and 1019 0x13 Backlight on Turns the backlight of the LCD on

    20 0x14 Backlight off (default) Turns the backlight of the LCD off

    21 0x15 Disable startup message Disables the display of setup information at power up

    22 0x16 Enable startup message Enables the display of setup information at power up

    23 0x17 Custom character

    First byte CGRAM addr(1-8) and next 8 byte of custom bit pattern. To read custom char. send 0x80(addr(1)) - 0x87(addr(8))

    25 0x19 Change Address First byte of sequence to change LCD address

    32-255 0x20-0xFF ASCII chars Writes ASCII chars straight to the display

    NEX Robotics Pvt. Ltd. 8www.nex-robotics.com

  • Serial LCD Module

    4.0 Controlling Nex Robotics 20x4 Serial LCD from PC:Note: Please use RS232 to TTL level converter to connect this module toPC. Do not connect it directly to PC.

    4.1 Software:Please use any serial terminal software such as Hyperterminal, minicom or Bray'sterminal on PC.

    4.2 Set cursor:To set cursor to a specified position, where 01(0x01) is the top left and 80(0x50) isthe bottom right position:

    Configure serial terminal as follows:1) Select proper COM Port from device manager2) Select Baud Rate: 96003) Data bits: 84) Parity: NONE5) Stop bits: 16) Flow Control: NONE

    Set cursor position using Set cursor (1-80) command:To set the cursor on 10th position on LCD send 0x02 followed by 0x0A

    Set cursor position using set cursor (line, column) command:In this command we have to send three bytes. 1st byte is command, 2nd byte is row

    number and 3rd byte is column number in hex.To set cursor on 1st row and 10th column on LCD send 0x03,0x01,0x0A

    4.3 Text on LCD display:To write on LCD directly from PC. We have to write character without command.

    4.4 Custom character generator:To generate custom character we have to send custom character generator commandfollowed by address of custom character and 8 bytes of custom bit pattern as shown inTable 1.

    Ex.0x17,0x01,0x80,0x84,0x8E,0x95,0x84,0x84,0x84,0x80

    0x17: Custom character generator command (Refer table 2) 0x01: Address (between 01-08) for custom character.Next 8 bytes are custom character bit pattern bytes.

    To display the custom character on 2nd row 8th column following command we have to send0x03,0x02,0x08 for cursor set and 0x80 for custom character display.

    Note: The custom character will stay in LCD memory till the LCD is ON. It must bedefined again every time the LCD is powered ON.

    NEX Robotics Pvt. Ltd. 9www.nex-robotics.com