LCD16x2 HD44780 Tutorial 6 – 4-bit Mode

LCD16x2 4-bit Mode

LCD16x2 can be used in 4-bit mode or 8-bit mode. Since the first tutorial until previous tutorial, we only use the 8-bit mode. In 8-bit mode, we need 8 wire from D7 to D0 in order to send command or data. In this tutorial, I will explain how to use LCD16x2 in 4-bit mode. This mode is useful when we want to control the LCD from microcontroller, because it uses less GPIO pins. In 4-bit mode, only 4 wire from D7 to D4 is used, D3 to D0 is not used. The transfer method is high nibble first, then followed by low nibble.

This is the procedure how to use 4-bit mode to display character ‘A’:

  1. Send command: 0b0010 xxxx (Set 4-bit mode).
  2. Send command: 0b0010 xxxx (high nibble of function set).
  3. Send command: 0b1000 xxxx (low nibble of function set).
  4. Send command: 0b0000 xxxx (high nibble of display on, underline on, and blinking on).
  5. Send command: 0b1111 xxxx (low nibble of display on, underline on, and blinking on).
  6. Send data: 0b0100 xxxx (high nibble of  ‘A’).
  7. Send data: 0b0001 xxxx (low nibble of ‘A’).

Thank you for reading this LCD tutorial.

LCD thank you

Share this:

Leave a Reply

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