Ads

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

Sunday, December 20, 2015

LCD 16x2 HD44780 Tutorial 6 - 4-bit Data Transfer

In this tutorial, I will share hoe to use 4-bit data transfer between to the LCD 16x2. This technique is useful when we want to control LCD from microcontroller, because it use less GPIO pins. 4-bit interface is only used 4 wire from D7 to D4, 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 data transfer to display 'A' character:
  1. Send command: 0b0010 xxxx (Set 4-bit data transfer).
  2. Send command: 0b0010 xxxx (high nibble function set).
  3. Send command: 0b1000 xxxx (low nibble function set).
  4. Send command: 0b0000 xxxx (high nibble display on, underline on, blinking on).
  5. Send command: 0b1111 xxxx (low nibble display on, underline on, blinking on).
  6. Send data: 0b0100 xxxx (high nibble 'A').
  7. Send data: 0b0001 xxxx (low nibble 'A').

1 comment :