7 Segment Display Interfacing With Arm7
7 Segment Display Interfacing With Arm7
7 Segment Display Interfacing With Arm7
A P1.16
B P1.17
C P1.18
D P1.19
7-SEG Display
E P1.20
F P1.21
G P1.22
DP P1.23
CL1 P0.10
CL2 P0.11
CL3 P0.12
CL4 P0.13
SW31
7SEG4
7SEG3
7SEG2
GLCD/7SEG
U16
VDD1
VDD2
VDD3
VDDA
VREF
35
6 P0.10 37
18 VSS1 P0.11 38
25 VSS2 P0.12 39
1
42 VSS3 P0.13 R19 1K R20 1K R21 1K R22 1K
50 VSS4 2 Q2 2 Q3 2 Q4 2 Q5
59 VSS5
VSSA 16
3
LPC2148 P1.16 12 SEG[0..7]
P1.17 8
P1.18 4 330E R24 SEG0
P1.19 48 U4 U5 U6 U7
8
P1.20 44 330E R25 SEG1
P1.21 40 SEG0 7 SEG0 7 SEG0 7 SEG0 7
CA
CA
CA
CA
CA
CA
CA
CA
P1.22 36 330E R26 SEG2 SEG1 6 A SEG1 6 A SEG1 6 A SEG1 6 A
XTAL2
XTAL1
62
7 SEGMENT DISPLAY
Source Code
#include <LPC214x.h>
#include <stdio.h>
#include "7SEG.H"
void main(void)
{
PINSEL0 = 0;
PINSEL1 = 0;
PINSEL2 &= 0x0000000C;
IODIR0 |= 0x0F << 10 ; // P0.10 - P0.13 Control Lines
IODIR1 |= 0xfF << 16; // P1.16 - P1.23 are Outputs
while(1)
{
if(x == 300)
{
x=0;
single++;
if(single>9)
{
single=0;
ten++;
if(ten>9)
{
ten=0;
hun++;
if(hun>9)
{
hun=0;
thou++;
if(thou>9)
x++;