#include <REGX51.H> #define TIMER0_COUNT OxEE11
const seven_seg[10]={0xC0,0xF9,0xA4,0xB0,0x99,0x92,0x82,0xF8,0x80,0x90}; unsigned char timer0_tick,i=0;
static void timer0_isr(void) interrupt TF0_VECTOR using 1 { TR0=0; TL0=(TIMER0_COUNT & 0x00FF); TH0=(TIMER0_COUNT>>8); TR0=1; timer0_tick++; if (timer0_tick==200) { i++; if(i==10)i=0; timer0_tick=0; P1=seven_seg; } } static void timer0_initialize(void) { EA=0; timer0_tick=0; TR0=0; TMOD=0x01; TL0=(TIMER0_COUNT &0x00FF); TH0=(TIMER0_COUNT>>8); PT0=0; ET0=1; TR0=1; EA=1; } void main (void) { timer0_initialize(); while(1); }
这段程序为什么不能编译??????? 请解释下 ! |