7 Seg
7 Seg
Seven segment displays are very commonly used in meter displays, etc. In this tutorial
LPC2138
For those who are new to ARM refer to previous tutorial (LED Interfacing with ARM7)
DESCRIPTION
Port-0)
Let’s use a common anode type display, a simple push-button switch, Resistors,
etc.
Look-Up table
Disp. g f e d c b a HEX
VALUE
0 1 0 0 0 0 0 0 40
1 1 1 1 1 0 0 1 79
2 0 1 0 0 1 0 0 24
3 0 1 1 0 0 0 0 30
4 0 0 1 1 0 0 1 19
5 0 0 1 0 0 1 0 12
6 0 0 0 0 0 1 0 02
7 1 1 1 1 0 0 0 78
8 0 0 0 0 0 0 0 00
9 0 0 1 0 0 0 0 10
a 0 0 0 1 0 0 0 08
b 0 0 0 0 0 1 1 03
c 1 0 0 0 1 1 0 46
d 0 1 0 0 0 0 1 21
First step is to generate a HEX code for each Number/Character that we want to display
In this interfacing we are concerned only with last 7-bits of P0 (Data line for SSD; P0.0-
P0.6). So we will calculate the hex value only for those bits and leave others as ‘don’t
care’.
These HEX-values will be put on the port through the Port0 Register (IOPIN0)
For eg:
Details of Code:
· IODIR0 is Data direction register, which governs the direction of flow of data or
digits/characters.
Images: