exp4 aman ARM
exp4 aman ARM
Aim: To write an embedded C Program using LPC2148 ARM processor to flash LEDS using a
Algorithm:
Program:
//RA2111004010146
#include <LPC21xx.H>
void wait (void) {
int d;
for (d=0; d< 1000000; d++);
}
int main (void) {
unsigned int i;
IODIR1= 0xFFFF0000;
while (1) {
for (i= 1<<16; i < 1<<31; i <<= 1) {
IOSET1 = i;
wait ();
IOCLR1 = i;
}
for (i = 1<<31; 1<<16; i >>=1) {
IOSET1 = i;
wait ();
IOCLR1 =i;
}
}
}
Simulation Output:
5. What is typecasting?
1. Write an embedded C code to count a sequence of 4 bits using GPIO and LED 1-4.
2. Explain the output of the partial code while(i>0) {//start conditional loop yourled = 1; wait
Result: Implemented embedded C Program Using LPC2148 ARM processor to flash LEDS using