HD44780

From Ethersex_Wiki
Revision as of 21:32, 7 December 2016 by Michaelb (talk | contribs)
Jump to: navigation, search
HD44780
Status
Stable
menuconfig I/O->LCD Displays->HD44780 module driver (Character-LCD)
Pinning yes
Ecmd yes
Control6 yes
Depends on ECMD
Requires -
Code https://github.com/ethersex/ethersex/tree/master/hardware/lcd

THIS WIKI PAGE IS CURRENTLY WORK IN PROGRESS

The HD44780 module provides support for common alphanumeric character LCDs using Hitachis HD44780 and compatible controllers.

Supported LC-Displays

The vast majority of all alphanumeric LC-Displays use Hitachis HD44780 dot matrix liquid crystal display (LCD) controller. The e6 HD44780 module supports displays of many different sizes utilizing the original HD44780 and compatible controllers.

Alphanumeric LCDs are distinguished by their size, the start-address of the per line Display Data-RAM (DDRAM) and the controller type. The original HD44780 controllers can drive up to 80 characters, most displays with more characters simply use two controllers.

The following table lists the LC-displays supported by the e6 HD44780 module by size and per line DDRAM start-address:

Menuconfig Size DDRAM Startaddress Note:
LCD size/type Characters Lines Line 1 Line 2 Line 3 Line 4
8_Characters_1_Line 8 1 0x00 n/a n/a n/a
16_Characters_1_Line 16 1 0x00 n/a n/a n/a
16_Characters_1_Line_Mux16 16 1 0x00 n/a n/a n/a organized as 8 chars, 2 lines
20_Characters_1_Line 20 1 0x00 n/a n/a n/a
40_Characters_1_Line 40 1 0x00 n/a n/a n/a
8_Characters_2_Lines 8 2 0x00 0x40 n/a n/a
12_Characters_2_Lines 12 2 0x00 0x40 n/a n/a
16_Characters_2_Lines 16 2 0x00 0x40 n/a n/a
20_Characters_2_Lines 20 2 0x00 0x40 n/a n/a
24_Characters_2_Lines 24 2 0x00 0x40 n/a n/a
40_Characters_2_Lines 40 2 0x00 0x40 n/a n/a
16_Characters_4_Lines 16 4 0x00 0x40 0x10 0x50
20_Characters_4_Lines 20 4 0x00 0x40 0x14 0x54 Note DDRAM addresses
20_Characters_4_Lines_KS0073 20 4 0x00 0x20 0x40 0x60 Note DDRAM addresses
27_Characters_4_Lines_2_EN 27 4 0x00 0x40 0x00 0x40 Two Enable-Pins/Controllers
40_Characters_4_Lines_2_EN 40 4 0x00 0x40 0x00 0x40 Two Enable-Pins/Controllers

Pinning

Direct

The following example maps the LCD pins to AVR port pins found on the 25 pin Sub-D connector of the Pollin AVR Net-IO board:

dnl Direct connection example
dnl map LCD pins to Pollin AVR Net-IO
dnl 25 pin extension port
ifdef(`conf_HD44780', `
  pin(HD44780_RS, PC4)
  pin(HD44780_RW, PC3)
  pin(HD44780_EN1, PC2)
  dnl pin(HD44780_EN2, PC5)
  pin(HD44780_D4, PA0)
  pin(HD44780_D5, PA1)
  pin(HD44780_D6, PA2)
  pin(HD44780_D7, PA3)
')

ifdef(`conf_HD44780_BACKLIGHT', `
  pin(HD44780_BL, PC6, OUTPUT)
')

I2C

/*
 * HD44780-Display über PCF8574 ansteuern.
 * Belegung Pollin Add-On-Board:
 *
 * Pin PCF8574 Pin am LCD
 * 4 (P0) -> 11 (DB4)
 * 5 (P1) -> 12 (DB5)
 * 6 (P2) -> 13 (DB6)
 * 7 (P3) -> 14 (DB7)
 * 9 (P4) -> 4 (RS)
 * 10 (P5) -> 5 (R/W) nicht benutzt !
 * 11 (P6) -> 6 (EN)
 * 12 (P7) -> 15 (Beleuchtung)
 *
 * Die LCD-Beleuchtung an Pin 12 wird über einen
 * PNP-Transistor geschaltet.
 * Beleuchtung an: Bit 7=0
 * Beleuchtung aus: Bit 7=1
 * Die Address-Eingänge A0 bis A2 des PCF8574 liegen alle auf GND.
 * Die Basis-Addresse des Chips ist daher immer 0x20.
 */

Pinning:

ifelse(value_HD44780_CONNECTION,`HD44780_I2CSUPPORT',`dnl
  ifelse(value_HD44780_I2C_PORTEXP,`HD44780_I2C_PCF8574',
  `ifdef(`conf_HD44780_MULTIEN',
    `dnl
       dnl HD44780_PCF8574x_MULTI_MAPPING(ADR, RS, RW, EN1, EN2, DB4, DB5, DB6, DB7)
       HD44780_PCF8574x_MULTI_MAPPING(0x20, 4, 5, 6, 7, 0, 1, 2, 3)',
    `dnl
       dnl HD44780_PCF8574x_MAPPING(ADR, RS, RW, EN, DB4, DB5, DB6, DB7, BL)
       HD44780_PCF8574x_MAPPING(0x20, 4, 5, 6, 0, 1, 2, 3, 7)')',
  value_HD44780_I2C_PORTEXP,`HD44780_I2C_MCP23017',
  `ifdef(`conf_HD44780_MULTIEN',
    `dnl
       dnl HD44780_MCP23017_MULTI_MAPPING(ADR, PORT, RS, RW, EN1, EN2, DB4, DB5, DB6, DB7)
       HD44780_MCP23017_MULTI_MAPPING(0x24, B, 4, 5, 6, 7, 0, 1, 2, 3)
       HD44780_MCP23017_MULTI_MAPPING_BL(0x24, A, 7)',
    `dnl
       dnl HD44780_MCP23017_MAPPING(ADR, RS, RW, EN, DB4, DB5, DB6, DB7, BL)
       HD44780_MCP23017_MAPPING(0x24, B, 4, 5, 6, 0, 1, 2, 3, 7)')'
  )dnl
')dnl


Serial (using 74HCT164)

2-Wire (using 74HCT4094)

ECMD