Saturday, May 14, 2016

LiquidCrystal Displays compatible with the Hitachi HD44780 driver and arduino pin mapping

These lcds are cheap and retro and work with most arduino boards even if you do not have i2c. They are using a bunch of digital pins for the communication.
The full details about the various pins can be found here.

There is an arduino shield that can be used for fast prototyping with a weird (at least for me) pin mapping. The pin mapping the shield is using is: lcd(8, 9, 4, 5, 6, 7).

However if you buy a naked lcd, you can wire it up any way you like. Unfortunately if you are using the shield to develop your app and have a different pin mapping in your naked lcd, that means that you need to modify the code between debugging and normal mode, or wire your lcd in the same way with the shield.

Most code examples out there are using the shield mapping as well.

Anyway. The lcd has 16 pins. Some of them can be wired only one way:

  • VSS (pin 1) -> Ground
  • VDD (pin 2) -> 5Volt
  • V0 (pin 3) -> 10K resistor/pot (this pin controls the contrast)
  • R/W (pin 5) -> Ground
  • A (pin15) -> 10K resistor/pot (this pin controls the backlight)
  • K (pin 16) -> Ground

and there are another 6 data pins that can be wired any way we like. The shield mapping is the following:

  • RS (pin 4) -> Digital pin 8
  • E (pin 6) -> Digital pin 9
  • D4 (pin11) -> Digital pin 4
  • D5 (pin12) -> Digital pin 5
  • D6 (pin13) -> Digital pin 6
  • D7 (pin14) -> Digital pin 7
The pins D0 up to D4 are not being used, since we are using the screen in 4bit mode.

This mapping should allow you to have the same mapping between your development environment and your final setup.

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.