- UID
- 828816
|
#pragma LINK_INFO DERIVATIVE "mc9s12dp256"
#pragma CODE_SEG __NEAR_SEG NON_BANKED
void ECT_init(void) {
TIOS_IOS0=1;//通道0为输出比较
TSCR1=0x90;//TEN置位,快速清零标志;
TIE=0x01;//通道0输出比较中断允许;
TSCR2=0x06;//定时计数器64分频
TFLG1_C0F=1;
TC0=300;
}
interrupt 8 void timer0(void)
{ EnableInterrupts;
TFLG1=0x01;
PORTB=0x77;
}
void main(void) {
ECT_init();
DDRB=0xff;
PORTB=0x00;
EnableInterrupts;
for(;;) {}
}
#pragma CODE_SEG DEFAULT |
|