本帖最后由 yulindee 于 2010-2-5 15:50 编辑
谢谢版主的热心帮忙,真正的问题找到了,不是两个中断之间的冲突,而是PSOC的执行速度,加上偶用的是C语言(里面做了大量的运算),倒致程序中只能在中断里执行了,所以我之前在Timer里做的标志没用(虽然有标志,但没有时间执行)!
版主经验多,指帮忙指条明路,是不是除了用汇编,别无它法了!只前一直都是用51内核对的,没有用过M8C内核的单片机,内部结构不太清楚,如何能快速入门!推荐一些资料也可以,感激不尽!
下面这段代码是我写的C语言中断函数,它把好多寄存器都入栈,在汇编用户手册上,也没有找到相应的介绍,不明白什么意识!
(0119) void HALL_ISR_C(void)
(0120) {
_HALL_ISR_C:
0964: 08 PUSH A
0965: 5D D0 MOV A,REG[0xD0]
0967: 08 PUSH A
0968: 5D D3 MOV A,REG[0xD3]
096A: 08 PUSH A
096B: 5D D4 MOV A,REG[0xD4]
096D: 08 PUSH A
096E: 5D D5 MOV A,REG[0xD5]
0970: 08 PUSH A
0971: 51 31 MOV A,[__r0]
0973: 08 PUSH A
0974: 51 30 MOV A,[__r1]
0976: 08 PUSH A
0977: 51 2F MOV A,[__r2]
0979: 08 PUSH A
097A: 51 2E MOV A,[__r3]
097C: 08 PUSH A
097D: 51 2D MOV A,[__r4]
097F: 08 PUSH A
0980: 51 2C MOV A,[__r5]
0982: 08 PUSH A
0983: 51 2B MOV A,[__r6]
0985: 08 PUSH A
0986: 51 2A MOV A,[__r7]
0988: 08 PUSH A
0989: 51 29 MOV A,[__r8]
098B: 08 PUSH A
098C: 51 28 MOV A,[__r9]
098E: 08 PUSH A
098F: 51 27 MOV A,[__r10]
0991: 08 PUSH A
0992: 51 26 MOV A,[__r11]
0994: 08 PUSH A
0995: 51 25 MOV A,[__rX]
0997: 08 PUSH A
0998: 51 24 MOV A,[__rY]
099A: 08 PUSH A
099B: 51 23 MOV A,[__rZ]
099D: 08 PUSH A
(0121) // PRT1DR=~(PRT1DR&0X40);
(0122) hall_position_isr( );
099E: 7C 06 39 LCALL _hall_position_isr
09A1: 18 POP A
09A2: 53 23 MOV [__rZ],A
09A4: 18 POP A
09A5: 53 24 MOV [__rY],A
09A7: 18 POP A
09A8: 53 25 MOV [__rX],A
09AA: 18 POP A
09AB: 53 26 MOV [__r11],A
09AD: 18 POP A
09AE: 53 27 MOV [__r10],A
09B0: 18 POP A
09B1: 53 28 MOV [__r9],A
09B3: 18 POP A
09B4: 53 29 MOV [__r8],A
09B6: 18 POP A
09B7: 53 2A MOV [__r7],A
09B9: 18 POP A
09BA: 53 2B MOV [__r6],A
09BC: 18 POP A
09BD: 53 2C MOV [__r5],A
09BF: 18 POP A
09C0: 53 2D MOV [__r4],A
09C2: 18 POP A
09C3: 53 2E MOV [__r3],A
09C5: 18 POP A
09C6: 53 2F MOV [__r2],A
09C8: 18 POP A
09C9: 53 30 MOV [__r1],A
09CB: 18 POP A
09CC: 53 31 MOV [__r0],A
09CE: 18 POP A
09CF: 60 D5 MOV REG[0xD5],A
09D1: 18 POP A
09D2: 60 D4 MOV REG[0xD4],A
09D4: 18 POP A
09D5: 60 D3 MOV REG[0xD3],A
09D7: 18 POP A
09D8: 60 D0 MOV REG[0xD0],A
09DA: 18 POP A
09DB: 7E RETI
(0123) } |