#include <LPC214X.H>
void timerint();
void timerint()
{
//PCONP |= 0x00000001;
T0TC=0x00; // resetting timer0
T0PC=0x00; // setting prescaller counter as 14746
T0TCR=0x02; //resetting timer control
T0MCR=0x03; //enabling MR0I and MR0R
T0PR=200000; //resetting PR
T0MR0=0x00fffff;
}
void delay(unsigned int val)
{
T0TCR=0x02;
T0TCR=0x01;
// T0TC=0x000388;
while(T0TC < val);
IO0SET |= (1<<1);
T0TCR=0x00;
}
int main()
{
IO0DIR |= (1<<0);
IO0DIR |= (1<<1);
//IO0SET |= (1<<0);
//delay(10);
//IO0CLR |= (1<<0);
// delay(1);
while(1)
{
delay(10);
IO0SET |= (1<<0);
delay(10
);
IO0CLR |= (1<<0);
}
}
void timerint();
void timerint()
{
//PCONP |= 0x00000001;
T0TC=0x00; // resetting timer0
T0PC=0x00; // setting prescaller counter as 14746
T0TCR=0x02; //resetting timer control
T0MCR=0x03; //enabling MR0I and MR0R
T0PR=200000; //resetting PR
T0MR0=0x00fffff;
}
void delay(unsigned int val)
{
T0TCR=0x02;
T0TCR=0x01;
// T0TC=0x000388;
while(T0TC < val);
IO0SET |= (1<<1);
T0TCR=0x00;
}
int main()
{
IO0DIR |= (1<<0);
IO0DIR |= (1<<1);
//IO0SET |= (1<<0);
//delay(10);
//IO0CLR |= (1<<0);
// delay(1);
while(1)
{
delay(10);
IO0SET |= (1<<0);
delay(10
);
IO0CLR |= (1<<0);
}
}
No comments:
Post a Comment