可以这样写么,为什么不能对TIMER0中的寄存器进行操作呀,我用的PICC编译器
#include <16F877.h>
#FUSES NOWDT //No Watch Dog Timer
#FUSES HS //High speed Osc (> 4mhz for PCM/PCH) (>10mhz for PCD)
#use delay(clock=20000000)
void timer0init(void)
{
OPTION_REG = 0b000000;
GIE = 1;
T0IE = 1;
TOIF = 1;
TMR0 = 0;
}
void TIMER0_isr(void)
{
TMR0 = 0;
output_d = ++output_d;
}
void main()
{
timer0init();
while(1);
} |