
- UID
- 169809
- 性别
- 男
|
大家好!我用s12dp256的开发板做个点灯实验,可是不会执行中断,我采用的是定时溢出中断,想问原因?这是我的程序:
#include /* common defines and macros */
#include /* derivative information */
#pragma LINK_INFO DERIVATIVE "mc9s12dp256b"
unsigned char second=0x00;
void interrupt TOIISR(void);
void main(void){
TSCR1=0x80;
TSCR2=0x80;
TFLG2=0x80;
DDRB=0xFF;
asm CLI;
while (1){
}
exit();
}
#pragma CODE_SEG NON_BANKED
void interrupt TOIISR(void){
TFLG2=0x80;
second+=1 ;
if (second==122){
PORTB=PORTB;
second=0x00;
}
}
#pragma CODE_SEG DEFAULT
|
|