Sie sind auf Seite 1von 5

Experiment 8

(GLCD)

AIM: To display name on GLCD using ARM7 Development Board.


Program:
/*
* Project name:
DEMO (Simple demonstration of the GLCD Library functions)
* Copyright:
(c) Mikroelektronika, 2011.
* Description:
This is a simple demonstration of the GLCD library routines:
- Init and Clear (pattern fill)
- Image display
* Test configuration:
MCU:
LPC2148
Dev.Board:
EasyARM v6
http://www.mikroe.com/eng/products/view/632/easyarm-v6-development-system/
Oscillator: 12.0 MHz (cclk = 60.0 MHz, Fcco = 240.0 MHz)
Ext. Modules: GLCD 128x64 Display
SW:
KEIL uVision v4.10
* NOTES:
- Turn ON the GLCD Backlight at SW1.5
- Place Pull-up Jumper J2 at PORT0[15..8]
- Connect PORT0[15..8] and PORT1[23..16] with IDC10 cable (bypass ports)
- The LEDs at PORT0 must be switched OFF!
*/
#include <LPC214X.H
#include "Glcd.h"
#include "bmp_maska.h"
#include "Utility.h"
unsigned char
ii;
char
*someText;
int main (void)
{
PINSEL0 = 0;
PINSEL1 = 0;
PINSEL2 &= 0x0000000C;
PINSEL2 |= 0x00000030;

ATMIYA

EMBEDDED SYSTEMS
INSTITUTE OF TECHNOLOGY & SCIENCE, RAJKOT.

Experiment 8
(GLCD)

DelayProc(0.2 * CCLOCK);
IODIR0 = 0;
Glcd_Init(&IOPIN1, // Control lines Port
&IOPIN0,
18,
19,
20,
21,
23,
22,
16);

// Data Lines Port


// CS1#
// CS2#
// RS
// R/W#
// RST
// EN
// D0 data line position

while (1)
{
Glcd_Fill(0x00);
Glcd_Image( maska_bmp );
DelayProc(1.0 * CCLOCK);
}
}

Glcd_Fill(0x00);
Glcd_Line(120,1, 5,60, 1);
Glcd_Line(12,42, 5,60, 1);
DelayProc(0.5 * CCLOCK);
Glcd_Rectangle(12,20, 93,57, 1);
DelayProc(0.5 * CCLOCK);
Glcd_Line(120,12, 12,60, 1);
DelayProc(0.5 * CCLOCK);
Glcd_H_Line(5,15, 6, 1);
Glcd_Line(0,12, 120,60, 1);
Glcd_V_Line(7,63, 127, 1);
DelayProc(0.5 * CCLOCK);
for (ii = 1; ii <= 10; ii++)
Glcd_Circle(63,32, 3*ii, 1);

ATMIYA

EMBEDDED SYSTEMS
INSTITUTE OF TECHNOLOGY & SCIENCE, RAJKOT.

Experiment 8
(GLCD)

DelayProc(0.5 * CCLOCK);
Glcd_Box(12,20, 70,57, 2);
DelayProc(0.5 * CCLOCK);
someText = "BIG:ONE";
Glcd_Write_Text(someText, 5,3, 2);
DelayProc(0.5 * CCLOCK);
someText = "SMALL:NOT:SMALLER";
Glcd_Write_Text(someText, 20,5, 1);
DelayProc(0.5 * CCLOCK);
}
}

Image program:
//
//
//
//

-----------------------------------------------------GLCD Picture name: hit.bmp


GLCD Model: KS0108 128x64
------------------------------------------------------

unsigned char const hit_bmp[1024] = {


0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0,128, 64, 64, 32, 32, 32, 96,224, 32, 0, 0,
0, 0, 0,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0,128,192,224, 48, 16, 8, 8,
8, 4,132,252,252,252, 28, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0,224,248,254, 31, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8,
12, 6, 7, 3, 0, 0, 0, 0, 0, 0, 0,224,248,252, 28, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 12, 15, 7, 1, 0, 0, 0, 64,
64,224,255,255,127, 67, 64, 64, 64, 64, 64, 64, 64, 64, 64,224,
255,255, 63, 3, 0, 0, 0, 0, 0, 0, 8, 8, 4,132,254,254,
254, 7, 0, 0, 0, 0, 0, 0, 1, 1,249,255,255, 7, 1, 1,
1, 1, 1, 1, 0, 0, 0, 0, 8, 4, 6, 6, 7, 7, 7,135,
199,199,103, 55, 31, 15, 7, 1, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,

ATMIYA

EMBEDDED SYSTEMS
INSTITUTE OF TECHNOLOGY & SCIENCE, RAJKOT.

Experiment 8
(GLCD)

0, 0, 0, 0, 0,128, 0, 0, 0, 0, 0, 0, 0, 0,128,224,
254,127, 31, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0,192,252,255,
255, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,224,255,255, 31,
0, 0, 0,128, 64, 0, 0, 0,240,255,255, 31, 0, 0, 0, 0,
128, 0, 0, 0, 0, 0, 0,128,192, 96, 48, 24, 28, 14, 7, 3,
1, 0, 0,128,128,192, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 2, 3, 7, 6, 6, 4, 4, 4, 4, 2, 2, 1, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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