中级会员
- 积分
- 203
- 威望
- 181
- 贡献
- 22
- 兑换币
- 0
- 注册时间
- 2008-4-19
- 在线时间
- 0 小时
|
<>用外部中断来捕捉摄像头同步信号,可中断程序是进了,但出来的时候就不行了,总是在跳出中断的时候跑到一个不沾边的地方,显示PPAGE为4,命令提示ACKN SYNC STOPPED 是什么意思?</P><P>用IRQ和H0口都试过了,没变化。 纳闷好几天了。</P><P>unsigned int m;</P><P>#pragma CODE_SEG NON_BAMKED<BR>void Inte_IRQ(void){ //中断程序//<BR> DDRB = 0xff;<BR> PORTB = 0x00; <BR> m = m+1;<BR> PORTB = 0xff;<BR>}<BR>#pragma CODE_SEG DEFAULT_ROM </P><P>void Init_IRQ(void){<BR> DDRE = 0x00;<BR> INTCR = 0x40;<BR>)</P><P>void main(void){<BR> Init_IRQ();<BR> EnableInterrupts;<BR> for(;;){}<BR>}</P><P>中断向量表如下:</P><P>extern void near _Startup(void); /* Startup routine */</P><P>#pragma CODE_SEG __NEAR_SEG NON_BANKED /* Interrupt section for this module. Placement will be in NON_BANKED area. */<BR>__interrupt void UnimplementedISR(void)<BR>{<BR> /* Unimplemented ISRs trap.*/<BR> asm BGND;<BR>}</P><P>extern Inte_IRQ(void);</P><P>typedef void (*near tIsrFunc)(void);<BR>const tIsrFunc _vect[] @0xFF80 = { /* Interrupt table */<BR> UnimplementedISR, /* 64vector 0x40 */<BR> UnimplementedISR, /* 63vector 0x3F */<BR> UnimplementedISR, /* 62vector 0x3E */<BR> UnimplementedISR, /* 61vector 0x3D */<BR> UnimplementedISR, /* 60vector 0x3C */<BR> UnimplementedISR, /* 59vector 0x3B */<BR> UnimplementedISR, /* 58vector 0x3A */<BR> UnimplementedISR, /* 57vector 0x39 */<BR> UnimplementedISR, /* 56vector 0x38 */<BR> UnimplementedISR, /* 55vector 0x37 */<BR> UnimplementedISR, /* 54vector 0x36 */<BR> UnimplementedISR, /* 53vector 0x35 */<BR> UnimplementedISR, /* 52vector 0x34 */<BR> UnimplementedISR, /* 51vector 0x33 */<BR> UnimplementedISR, /* 50vector 0x32 */<BR> UnimplementedISR, /* 49vector 0x31 */<BR> UnimplementedISR, /* 48vector 0x30 */<BR> UnimplementedISR, /* 47vector 0x2F */<BR> UnimplementedISR, /* 46vector 0x2E */<BR> UnimplementedISR, /* 45vector 0x2D */<BR> UnimplementedISR, /* 44vector 0x2C */<BR> UnimplementedISR, /* 43vector 0x2B */<BR> UnimplementedISR, /* 42vector 0x2A */<BR> UnimplementedISR, /* 41vector 0x29 */<BR> UnimplementedISR, /* 40vector 0x28 */<BR> UnimplementedISR, /* 39vector 0x27 */<BR> UnimplementedISR, /* 38vector 0x26 */<BR> UnimplementedISR, /* 37vector 0x25 */<BR> UnimplementedISR, /* 36vector 0x24 */<BR> UnimplementedISR, /* 35vector 0x23 */<BR> UnimplementedISR, /* 34vector 0x22 */<BR> UnimplementedISR, /* 33vector 0x21 */<BR> UnimplementedISR, /* 32vector 0x20 */<BR> UnimplementedISR, /* 31vector 0x1F */<BR> UnimplementedISR, /* 30vector 0x1D */<BR> UnimplementedISR, /* 29vector 0x1C */<BR> UnimplementedISR, /* 28vector 0x1B */<BR> UnimplementedISR, /* 27vector 0x1A */<BR> UnimplementedISR, /* 26vector 0x19 (PORT H) */<BR> UnimplementedISR, /* 25vector 0x18 (PORT J) */<BR> UnimplementedISR, /* 24vector 0x17 (ATD1) */<BR> UnimplementedISR, /* 23vector 0x16 (ATD0) */<BR> UnimplementedISR, /* 22vector 0x15 (SCI1) */<BR> UnimplementedISR, /* 21vector 0x14 (SCI0) */<BR> UnimplementedISR, /* 20vector 0x13 */<BR> UnimplementedISR, /* 19vector 0x12 */<BR> UnimplementedISR, /* 18vector 0x11 */<BR> UnimplementedISR, /* 17vector 0x10 (TOF, timer overflow interrupt) */<BR> UnimplementedISR, /* 16vector 0x0F (C7I, timer interrupt channel 7) */<BR> UnimplementedISR, /* 15vector 0x0E (C6I, timer interrupt channel 6) */<BR> UnimplementedISR, /* 14vector 0x0C (C5I, timer interrupt channel 5) */<BR> UnimplementedISR, /* 13vector 0x0C (C4I, timer interrupt channel 4) */<BR> UnimplementedISR, /* 12vector 0x0B (C3I, timer interrupt channel 3) */<BR> UnimplementedISR, /* 11vector 0x0A (C2I, timer interrupt channel 2) */<BR> UnimplementedISR, /* 10vector 0x09 (C1I, timer interrupt channel 1) */<BR> UnimplementedISR, /* 09vector 0x08 (C0I, timer interrupt channel 0) */<BR> UnimplementedISR, /* 08vector 0x07 (RTIE) */<BR> Inte_IRQ, /* 07vector 0x06 (IRQ, out interrupt)*/<BR> UnimplementedISR, /* 06vector 0x05 (XIRQ, out interrupt)*/<BR> UnimplementedISR, /* 05vector 0x04 */<BR> UnimplementedISR, /* 04vector 0x03 */<BR> UnimplementedISR, /* 03vector 0x02 (WDT, watchdog timer overflow)*/<BR> UnimplementedISR, /* 02vector 0x01 */<BR> _Startup /* 01vector 0x00 (RESET) */<BR> };</P> |
|