NOTE: Procedure to interface LCD with LPC2148 ARM7 Microcontroller could be little bit different when compared to other 8-bit microcontrollers such as 8051, AVR and other chips which operates at 5V. Usually, LCD operates at 5V but LPC2148 operates at 3.3V.
LCD (liquid crystal display) screen is an electronic display module.LCD 16x2 means it can display16 characters per line and there are two such lines. DB0-DB7:-Data pins The data and command are given through these pins. EN:-enable The lcd controller take the data from data pins only get a high to low transition in enable pin.
So we have to take care of this fact. Since, the board we will be using for our experiment have on board +5V so we don’t need to use any level shifter circuit. Otherwise, you may need to wire up additional circuitry. We’ll get into that later in circuit diagram.JHD162A LCD Module: Character LCD DisplayThe JHD162A has 16 Pins. This LCD controller can be operated in 4-bit or 8-bit mode. You can easily buy this cheap china made LCD in almost every supplier shop. Let’s first try to understand its pins and related functions.
I recommend you to keep datasheet in-hand, to download click here: JHD162A 16×2 Character LCD JHD162A LCD Pins DesciptionBefore wiring up circuit between JHD162A LCD and LPC2148 Microcontroller. Let’s understand function of each pin provided on JHD162A LCD Module and are given as below:PIN1 (VSS): Ground (GND) Pin of JHD162A LCD ModulePIN2 (VCC): +5V supply should be given to this pin as VCCPIN3 (VEE): This pin usually used to adjust a contrast. This is usually done by connecting 10K potentiometer to +5V and ground and then connecting slider pin to VEE of LCD Module. This voltage across VEE pin defines the contrast. In general case this voltage is between 0.4V to 0.9V.PIN4 (RS): This pin referred as Register Select (RS). The JHD126A LCD has two registers called command register & data register. Logic HIGH (‘1’) at Pin RS selects data register and Logic LOW (‘0’) at Pin RS will select command register.
When we make RS Pin HIGH and put data on data lines (DB0-DB7). It will be recognized as data. And if we make RS Pin LOW and put any value on data lines, then it will recognizes as a command.PIN5(R/W): This Pin is used for selecting pin function between read and write mode. Logic HIGH (‘1’) at this pin activates read mode and Logic LOW at this pin activates write mode.PINs (DB0-DB7): These are data pins. The commands and data can be transferred through these pins in either 8-bit or 4-bit mode.PIN15 (A or LED+): Anode of the backlight LED.
When operated on 5V a 10E resistor should be connected in series to this pin.PIN16 (K or LED-): Cathode of the backlight LED. You might be wondering why we are using 4-bit and not 8-bit mode to Interface LCD with LPC2148 ARM7 Microcontroller. Here I have presented some differences.It actually depends on requirements, availability of pins and timing requirement etc.
Etc. 4-bit mode uses 4 I/O Port Pins for data and two or three additional I/O Pins for control. 8-bit mode uses 8 I/O Port Pins for data and two or three additional I/O Pins for control. 4-bit mode requires two 4-bit transfers for each instruction and character that is sent to the display. 8-bit mode requires only one 8-bit transfer for each instruction and character that is sent to the display. The implication is that, 4-bit data transfers will take twice as much time to transfer as 8-bit data transfer.
4-bit data transfers use 4 I/O lines less than 8-bit data transfer. It is a trade off! We save up to 4 I/O lines using 4-bit mode over that of 8-bit mode but, the data transfer takes twice as long in 4-bit mode as it does in 8-bit mode. If I/O is limited, 4-bit mode might preferred.
If I/O is enough in number available and timing is important then 8-bit mode may be the way to go. 4-bit data transfers also require a bit more code as, the lower nibble will need to be shifted into the upper nibble with each command and character transfer.As we all aware that almost everything in this field is trade-off! We have to decide on an application by application basis, which is best approach to take.To establish proper communication and interface between JHD162A LCD with LPC2148 Microcontroller. We need to supply commands in a given order to the data pins with small amount of delay in between to initialize LCD properly.
These commands are listed in given table. We’ will use these commands in our program. COMMAND CODES (JHD162A): Interface LCD to LPC2148 ARM7.This example project has been tested on STK2148-UltraLite Development Board. EXAMPLE PROJECT: Let’s display custom text on to LCD screen. Here we will interface JHD162A LCD with LPC2148 ARM7 Microcontroller. The connection between LCD pins and LPC2148 into 4-bit mode has shown as below.
We also have presented fully functioning program and free to download project. CIRCUIT CONNECTION: Interface LCD with LPC2148 ARM7 Circuit: Interface LCD with LPC2148 ARM7 JHD162A LCD Command Codes C PROGRAM: Interface LCD with LPC2148 ARM7 Microcontroller.
![Lcd Display Lpc2129 Lcd Display Lpc2129](http://www.rhydolabz.com/wiki/wp-content/uploads/untitled56.jpg)
Ok here is my thoughts on this.