#include<pic.h>
void timer();
void main()
{
TRISD=0X00;
T1CON=0X39;
while(1)
{
PORTD=0XFF;
timer();
PORTD=0X00;
timer();
}
}
void timer()
{
int i;
TMR1L=0X00;
TMR1H=0X00;
for(i=0;i<2;i++)
{
while(TMR1IF==0);
TMR1IF=0;
}
}
void timer();
void main()
{
TRISD=0X00;
T1CON=0X39;
while(1)
{
PORTD=0XFF;
timer();
PORTD=0X00;
timer();
}
}
void timer()
{
int i;
TMR1L=0X00;
TMR1H=0X00;
for(i=0;i<2;i++)
{
while(TMR1IF==0);
TMR1IF=0;
}
}
No comments:
Post a Comment