0% found this document useful (0 votes)
214 views3 pages

Interfacing LPC2148 With GLCD.

This laboratory workbook provides instructions for an experiment interfacing an LPC2148 microprocessor with a GLCD display to display a 320x240 pixel image. The document lists the required hardware components and connection steps. It also provides the header and source code files needed, a code listing to initialize the clock, GPIO, SPI and display an image, and steps to create the project in Eclipse and program the board. Connecting the hardware and downloading the HEX file should result in the image being displayed on the TFT screen.

Uploaded by

Bhavin R Darji
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
214 views3 pages

Interfacing LPC2148 With GLCD.

This laboratory workbook provides instructions for an experiment interfacing an LPC2148 microprocessor with a GLCD display to display a 320x240 pixel image. The document lists the required hardware components and connection steps. It also provides the header and source code files needed, a code listing to initialize the clock, GPIO, SPI and display an image, and steps to create the project in Eclipse and program the board. Connecting the hardware and downloading the HEX file should result in the image being displayed on the TFT screen.

Uploaded by

Bhavin R Darji
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

____________________________________________________________________________________

Laboratory workbook for Advanced Microprocessors (As per Pune University Syllabus)
____________________________________________________________________________________

LAB 1: Interfacing LPC2148 with GLCD to display image on it

Objective: Write a program to display 320 * 240 image on LCD.

Part List:
 Educational Practice Board for ARM7
 9V Power supply
 34 Pin Flat cable
 20 Pin Flat cable
 USB cable
 Eclipse IDE
 PC
 ASK36
 TFT Card

Hardware Connection
 Connect USB cable between PL3 connector of EPBARM7 and PC.
 Connect ASK36 to TFT Card using 34 pin flat cable.
 Connect ARM7 J1 connector and TFT Card using 20 pin flat cable

Included Files:

HEADER FILES SOURCE FILES


delay.h delay.c
gpio.h gpio.c
pll.h pll.c
spi.h spi.c
spi_glcd.h spi_glcd.c
uart.h uart.c
pinsel.h
mario.h

____________________________________________________________________________________
Edutech Learning Solutions Pvt. Ltd. [email protected]
____________________________________________________________________________________

Laboratory workbook for Advanced Microprocessors (As per Pune University Syllabus)
____________________________________________________________________________________

Program Listing:

#include "mario.h"
#include "spi.h"
#include "spi_glcd.h"
#include "pll.h"

int main(void)
{
InitClock();
ConfigGpio(SPI_PORT,SSEL0,Output,GpioFun);
ConfigSpi(Spi0,6,0,Master); // SPI0 clock Freq
= 12Mhz/8 = 1.5MHz where 8 is ClkDiv
// Clock
polarity = 0; Data is sampled on the first clock edge of SCK.
GLCD_Init(); // Initialize GLCD

GLCD_Clear (White);
GLCD_Bitmap (0,0,320,240,image); // Bitmap image at x=0 &
y=0
while(1);
return 0;
}

____________________________________________________________________________________
Edutech Learning Solutions Pvt. Ltd. [email protected]
____________________________________________________________________________________

Laboratory workbook for Advanced Microprocessors (As per Pune University Syllabus)
____________________________________________________________________________________

Steps to create project and program compilation:


Steps:
 Open Eclipse.exe from “C:\eclipse” folder.
 Now browse to the ARM7 Workspace under E_Workspace (in this case
C:\E_Workspace\ARM7). Click OK to continue.
 Click File > Import…, to import template.
 Click General > Existing Projects into Workspace and click Next.
 First Select Root Directory of your Eclipse Template for ARM7. Then select “Copy
projects into workspace” check box and Click Finish.
 Every time you import a project make sure to rename it. So Right Click Project >
Rename or press F2 while selecting project to rename it.
 Go to File> New > Source File and you will see New Source File Wizard. Enter Source
File name (For example main.c) then Click Finish.
 Write your code and then save your Files.
 Copy necessary .c and .h files to your local project folder. They will be added to your
project in Eclipse IDE

Steps to use hardware:

 Connect 9V DC Power supply to the educational practice board for ARM7


 Connect ASK 36 to TFT Card using 34 pin flat cable.
 Connect TFT card to educational practice board using 20pin flat cable.
 Connect the board with the USB port of the PC using the USB A to B type cable.
 Using the RUN/PROGRAM mode selection switch, set the board in the program mode.
This will be indicated by the red LED.
 Apply Reset condition by pressing the RESET switch to ensure proper communication.
 Using download tool (Flash Magic) downloads the .HEX file to the target board.
 Using the RUN/PROGRAM mode selection switch, set the board in the run mode. This
will be indicated by the green LED and apply reset to execute the program.

Result:
Image will be displayed on the TFT display.

____________________________________________________________________________________
Edutech Learning Solutions Pvt. Ltd. [email protected]

You might also like