Ads

Get STM32 tutorial using HAL at $10 for a limited time!

Sunday, September 20, 2015

LCD 16x2 HD44780 Tutorial 4 - Character Entry Mode

In this tutorial, I will discuss about character entry mode of LCD 16x2 HD44780. There are 4 character entry mode that can be selected. So far, we have been used the default character entry mode until previous post. The entry mode is auto-incrementing the cursor address every new character is entered. It is also possible to auto-decrementing the cursor and combine with shifting the display.

This is the first entry mode or the default entry mode. To do this we can send instruction 0b00000110 to the LCD. This is the default entry mode every LCD powered on. Every new character is entered, the cursor/ DDRAM address is auto-incremented by 1. This mode is illustrated by picture below:

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

Saturday, September 19, 2015

LCD 16x2 HD44780 Tutorial 3 - Display Address and Shifting

In previous tutorial, we have done displaying a word "AnNyeongHaSeYo!" (Hello in Korean) on LCD 16x2. In this tutorial, I will explain about addressing to DDRAM (Display Data RAM). The function of DDRAM is to store character that displayed on LCD screen. 

HD44780 LCD controller has 128 different addresses for DDRAM, although not all addresses have their own location on LCD screen. Only 80 display locations can be used to store characters. HD44780 is a LCD controller that can be used not just for 16x2 LCD size, but also for other size such as 16x4, 20x2, or 40x2. The display location for all LCD size is also same (80 location). The different is number of location that can displayed on screen. For example, on 16x2 size is only 32 location, but other location still can be used to store character, although not displayed. To displayed that, we can shift the display right or left. This is the address location of DDRAM that displayed on LCD 16x2 size every LCD power on: