Thursday, 15 October 2015

Port blinking using Timer0 Capture control(ARM7(LPC2129/38)

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

No comments:

Post a Comment