====== HD44780 vs. ST7066 ====== They are the same, except for the LCD power supply, often called Vo or Ve. ===== LCD Module Pinout ===== As a reference, we remember the pinout of an alphanumeric LCD Module based on HD44780 or ST7066 is the following. - Ground - VCC (+3.3 to +5V) - Contrast adjustment (VO) - Register Select (RS). RS=0: Command, RS=1: Data - Read/Write (R/W). R/W=0: Write, R/W=1: Read (This pin is optional due to the fact that most of the time you will only want to write to it and not read. Therefore, in general use, this pin will be permanently connected directly to ground.) - Clock (Enable). Falling edge triggered - Bit 0 (Not used in 4-bit operation) - Bit 1 (Not used in 4-bit operation) - Bit 2 (Not used in 4-bit operation) - Bit 3 (Not used in 4-bit operation) - Bit 4 - Bit 5 - Bit 6 - Bit 7 - Backlight Anode (+) (If applicable) - Backlight Cathode (-) (If applicable) ===== Difference in Vo ===== HD44780 VO is from 0 to Vcc , usually it can be tied to 0 or a trimmer can be used. ST7066 V0 must be Vcc-10V to Vcc, so usually -5 to +5; however a good range is -2.5 to -0.5 V with respect to GND. -2.0 to -1.1 is a good contrast and -1.5 can be considered a good average. ===== The Hack ===== I have encountered (in an UniOp EK42) an interesting contrast control circuitry, fortunately designed to comprehend wide range for Vo supply. It was enough to replace a couple of resistors to change the mathematical function and adapt the circuit from HD44780 to ST7066. {{:notes:alim-lcd.png?500|}} With Vr that is a square wave from an MCU, with period about 10us, variable duty cycle; Vcc=5V, Vee=-5V (about). ^ component ^ original value ^ modified value ^ | R1 | 100k | 100k | | R2 | 18k | 18k | | R3 | 100k | 68k | | R4 | 150k | 150k | | R5 | 1M | 560k | | R6 | 18k | 130k | Maths: V0 = R4/R3 * R2/R1 * Vr - R4/R3 * (R2+R1)/R1 * R6/(R5+R6) * Vcc Note that Vee is not critical. Original values meant a V0 from about -0.027 to +1.35 V (duty 50% gives about +0.65V) Modified values mean a V0 from about -2.5 to -0.5 V (duty 50% gives about -1.1V)