Thursday, 15 October 2015

Port blinking using Timer0 External Match(ARM7(LPC2129/38))

#include<lpc21xx.h>
int main()
{
IO1DIR=0XFFFFFFFF;
PINSEL1=0X00003000;
T0TCR=1;
T0TC=0;
T0MCR=0X003;
T0MR0=0X00FFFFFF;
T0EMR=0X031;
while(1)
{
while((T0IR&0X01)==0);
IO1SET=0XFFFFFFFF;
T0IR=0XFF;
while((T0IR&0X01)==0);
IO1CLR=0XFFFFFFFF;
T0IR=0XFF;
}
}

No comments:

Post a Comment