You are currently viewing How to Interface GLCD with LPC2148 – ARM7 Advanced Development Board

How to Interface GLCD with LPC2148 – ARM7 Advanced Development Board

Spread the love

The ARM7 LPC2148 Advanced Development Board is specifically designed to help students to master the required skills in the area of embedded systems. The kit is designed in such way that all the possible features of the microcontroller will be easily used by the students. The kit supports in system programming (ISP) which is done through serial port.

NXP’s ARM7 (LPC2148), ARM Advanced Development Kit is proposed to smooth the progress of developing and debugging of various designs encompassing of High speed 32-bit Microcontrollers.

GLCD (Graphical Liquid Crystal Display)

The Graphics LCD as the name suggests is a type of LCD which can display graphics. The graphical representation of any data presents good understanding than just characters. More user friendly applications can be designed by using the graphical LCDs.

Interfacing GLCD

Fig. 1 shows how to interface the GLCD to the microcontroller. The 128X64 Graphical LCD interfaces to adjust contrast through the trim pot. The GLCD needed to create an 8-bit interface; 8 data bits (D0 – D7), three control lines, address bit (RS), read/write bit (R/W), and the control signal (E), Page Select (CS).

 Interfacing GLCD to Microcontroller
Fig. 1 Interfacing GLCD to Microcontroller 

Interfacing GLCD with LPC2148 – ARM7 Advanced Development

Display a text in LPC2148 Advanced Development Board by using GLCD module. The ARM7 LPC2148 Advanced Development Board has numbers of GLCD connections, connected with I/O Port lines (P0.0, P0.1, P0.10 – P0.12 && P0.0 – P0.7) to make GLCD display.

Pin Assignment with LPC2148

Pin Assignment with LPC2148 for GLCD 128x64

Circuit Diagram to Interface GLCD with LPC2148 – ARM7 Advanced Development

Source Code

The Interfacing GLCD with LPC2148 program is very simple and straight forward, which display a text in 128 X 64 GLCD modules. Some delay is occurring when a single command / data is executed. In C programs you cannot be sure of delay, because it depends on compiler how it optimizes the loops as soon as you make changes in the options the delay changes.

C Program to display a text in GLCD using LPC2148

******************************************************************************************************************

Title : Program to display a data in GLCD using ARM7 Advanced Development Board

*******************************************************************************************************************

#include 
#include "Glcd.h"
#include "bmp_maska.h"
#include "Utility.h" unsigned char ii;
char *someText; int main (void)
{
PINSEL0 = 0;
PINSEL1 = 0;
PINSEL2 &= 0x0000000C;
Glcd_Init(&IOPIN0, // Control lines Port &IOPIN1, // Data Lines Port 10, // CS1# 11, // CS2# 12, // RS 13, // R/W# 15, // RST 14, // EN 16);
// D0 data line position while (1)
{
Glcd_Fill(0x00);
Glcd_Image( maska_bmp );
delay_Nx10cyc (11999999); // Delay 2s Glcd_Fill(0x00);
Glcd_Line(120,1, 5,60, 1);
Glcd_Line(12,42, 5,60, 1);
delay_Nx10cyc (5999999); // Delay 1s Glcd_RectangleGlcd_Rectangle(12,20, 93,57, 1);
delay_Nx10cyc (5999999); // Delay 1s Glcd_Line(120,12, 12,60, 1); 
delay_Nx10cyc (5999999); // Delay 1s Glcd_H_Line(5,15, 6, 1);
Glcd_Line(0,12, 120,60, 1);
Glcd_V_Line(7,63, 127, 1);
delay_Nx10cyc (5999999);  // Delay 1s for (ii = 1;
ii <= 10; ii++) Glcd_Circle(63,32, 3*ii, 1);
delay_Nx10cyc (5999999);  // Delay 1s Glcd_Box(12,20, 70,57, 2);
delay_Nx10cyc (5999999);  // Delay 1s someText = "BIG:ONE";
Glcd_Write_Text(someText, 5,3, 2);
delay_Nx10cyc (5999999);  // Delay 1s someText = "SMALL:NOT:SMALLER";
Glcd_Write_Text(someText, 20,5, 1);
delay_Nx10cyc (5999999);  // Delay 1s
}
}

To compile the above C code you need the KEIL software. They must be properly set up and a project with correct settings must be created in order to compile the code. To compile the above code, the C file must be added to the project.

In KEIL, you want to develop or debug the project without any hardware setup. You must compile the code for generating HEX file. In debugging Mode, you want to check the port output without microcontroller Primer Board.

The Flash Magic software is used to download the hex file into your microcontroller through UART0.

Testing the Graphical LCD Module with LPC2148

Give +3.3V power supply to LPC2148 Advanced Development Board; the Graphical LCD is connected with microcontroller LPC2148 Board. When the program is downloading into LPC2148 in Advanced Development Board, the screen should show the image output.

If you not reading any output from Graphical LCD, then you just check the jumper connections & adjust the trim pot level. Otherwise you just check it with debugging mode in KEIL. If you want to see more details about debugging just see the videos in below link.

How to Create & Debug a Project in KEIL.

General Information

☞For proper working use the components of exact values as shown in Circuit file. Wherever possible use new components.

☞Solder everything in a clean way. A major problem arises due to improper soldering, solder jumps and loose joints.

☞Use the exact value crystal shown in schematic.

☞More instructions are available in following articles,

How to Interface 8bit LCD with LPC2148 – ARM7 Advanced Development Board

User Manual for NXP LPC213X Advanced Development Board

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.