LCD16x2 HD44780 Tutorial 4 – Character Entry Mode

LCD16x2 Character Entry Mode 1

In this tutorial, I will explain about character entry mode of the LCD16x2. There are 4 character entry modes that can be used. So far, we have been used the default character entry mode until previous post. The entry mode is auto-incrementing the cursor address every a new character is entered. This is the default entry mode every LCD is powered up. To do the first entry mode or the default entry mode, we can send instruction 0b00000110 to the LCD. Every a new character is entered, the cursor/DDRAM address is auto-incremented by 1. This mode is illustrated by animation below.

LCD entry 1

  1. Set cursor to address location 0x07.
  2. Put char ‘A’ on location 0x07, cursor is auto-incremented to address location 0x08.
  3. Put char ‘B’ on location 0x08, cursor is auto-incremented to address location 0x09.
  4. Put char ‘C’ on location 0x09, cursor is auto-incremented to address location 0x0A.
  5. Return to home (location 0x00).

LCD16x2 Character Entry Mode 2

The second entry mode is auto-decrement. This mode is like the first mode but, every a new character is entered, the cursor/ DDRAM address is auto-decremented by 1. To do this mode, we can send instruction 0b00000100 to the LCD. This mode is illustrated by animation below.

LCD entry 2

  1. Set cursor to address location 0x07.
  2. Put char ‘A’ on location 0x07, cursor is auto-decremented to address location 0x06.
  3. Put char ‘B’ on location 0x06, cursor is auto-decremented to address location 0x05.
  4. Put char ‘C’ on location 0x05, cursor is auto-decremented to address location 0x04.
  5. Return to home (location 0x00).

LCD16x2 Character Entry Mode 3

The third entry mode is auto-increment combined with auto-shift. The cursor is auto-incremented and at the same time the display character also auto-shifted to the left. This is like the entry mode that usually used on calculator. To do this mode, we can send instruction 0b00000111 to the LCD. This mode is illustrated by animation below.

LCD entry 3

  1. Set cursor to address location 0x07.
  2. Put char ‘A’ on location 0x07, cursor is auto-incremented to address location 0x08, display character is auto-shifted to the left.
  3. Put char ‘B’ on location 0x08, cursor is auto-incremented to address location 0x09, display character is auto-shifted to the left.
  4. Put char ‘C’ on location 0x09, cursor is auto-incremented to address location 0x0A, display character is auto-shifted to the left.
  5. Return to home (location 0x00) and the shifted display is back to normal.

LCD16x2 Character Entry Mode 4

The last entry mode is auto-decrement combined with auto-shift. The cursor is auto-decremented and at the same time the display character also auto-shifted to the right. To do this mode, we can send instruction 0b00000101 to the LCD. This mode is illustrated by animation below.

LCD entry 4

  1. Set cursor to address location 0x07.
  2. Put char ‘A’ on location 0x07, cursor is auto-decremented to address location 0x06, display character is auto-shifted to the right.
  3. Put char ‘B’ on location 0x06, cursor is auto-decremented to address location 0x05, display character is auto-shifted to the right.
  4. Put char ‘C’ on location 0x05, cursor is auto-decremented to address location 0x04, display character is auto-shifted to the right.
  5. Return to home (location 0x00) and the shifted display is back to normal.

Go to the part 5 of the tutorial.

Share this:

One thought on “LCD16x2 HD44780 Tutorial 4 – Character Entry Mode

Leave a Reply

Your email address will not be published. Required fields are marked *