#include"reg51.h"
#include"stdio.h"
sbit f=P3^1;
void main()
{
T2MOD=0x03;
TR2=1;
RCAP2H=TH2;-1000/256;
RCAP2L=TL2=-1000%256;
while(1)
{
while(!TF2)
TF2=0;
f=~f;
}
}
em muon tao xung tu bo timer 2 cua 8051 nhung toan bao loi.ko biet sai o cho nao?
mong moi ng guip,thank!
#include"stdio.h"
sbit f=P3^1;
void main()
{
T2MOD=0x03;
TR2=1;
RCAP2H=TH2;-1000/256;
RCAP2L=TL2=-1000%256;
while(1)
{
while(!TF2)
TF2=0;
f=~f;
}
}
em muon tao xung tu bo timer 2 cua 8051 nhung toan bao loi.ko biet sai o cho nao?
mong moi ng guip,thank!
Comment