Toll-Free Customer Support 24/7

ARM Development Board-LPC2129

/*
* Project name:
ARM Development Board-LPC2129
* Copyright
(c) Researchdesignlab.com
* Description:

* Test configuration:
MCU: LPC2129
Dev.Board: LPC2129 mini
Oscillator: 12 MHz
Software: Keil uVision4

*/

#include <LPC21XX.H> // LPC21XX Peripheral Registers

void mask(unsigned int num) { //7 SEG A...G 0.16...0.23 1234..0.4..0.7
if(num==0)
IOPIN0=0x00C00000;
else if(num==1)
IOPIN0=0x00F90000;
else if(num==2)
IOPIN0=0x00A40000;
else if(num==3)
IOPIN0=0x00B00000;
else if(num==4)
IOPIN0=0x00990000;
else if(num==5)
IOPIN0=0x00920000;
else if(num==6)
IOPIN0=0x00820000;
else if(num==7)
IOPIN0=0x00F80000;
else if(num==8)
IOPIN0=0x00800000;
else if(num==9)
IOPIN0=0x00900000;


}

void DELAY()
{
unsigned int X=10000;
while(X--);
}

int main()
{
IODIR0=0x00FF00F0;
IOPIN0=0x00FF00F0;

while(1)
{

mask(0);
IOPIN0|=0X000000D0;
DELAY();
mask(1);
IOPIN0|=0X000000E0;

DELAY();
mask(2);
IOPIN0|=0X000000B0;

DELAY();
mask(3);
IOPIN0|=0X00000070;

DELAY();


}
}

Back to top