|
外部中断刚调通,pwm timer的中断又出问题了。
volatile U32 pwmcnt0,pwmcnt1,pwmcnt2,pwmcnt3,pwmcnt4,pwmcnt5;
void Timer_Pwm(void)
{
MAKE_TIMER_SELECT();/* 设置PE3~PE7引脚对应功能分别为TOUT0~TOUT4 */
pwmcnt0 = 0;
pwmcnt1 = 0;
pwmcnt2 = 0;
pwmcnt3 = 0;
pwmcnt4 = 0;
pwmcnt5 = 0;
rINTMOD = 0;/* 所有中断使用IRQ模式 */
rINTCON = 5;?????? 单步调试至rINTCON = 5;观察INTPND,其值居然是0x03c00188 */
rINTMSK = ~(BIT_GLOBAL|BIT_TIMER0|BIT_TIMER1|BIT_TIMER2|BIT_TIMER3|BIT_TIMER4|BIT_TIMER5);
/* 开全局中断和PWM TIMER 0~5定时器中断 */
pISR_TIMER0 = (unsigned int)Timer0Int;??????单步调试时,到这里就死机?程序不运行了?怎么回事啊?
pISR_TIMER1 = (unsigned int)Timer1Int;
pISR_TIMER2 = (unsigned int)Timer2Int;
pISR_TIMER3 = (unsigned int)Timer3Int;
pISR_TIMER4 = (unsigned int)Timer4Int;
pISR_TIMER5 = (unsigned int)Timer5Int;
。。。。。。
用jtag单步调试至pISR_TIMER0 = (unsigned int)Timer0Int;时程序就不再运行,如果将rINTCON = 5;设置语句去掉,就能正常运行,当然这
里pwm timer中断就不产生。
还有一个很奇怪的现象,单步调试至rINTCON = 5;观察INTPND,其值居然是0x03c00188,奇怪啊,我定时器都还没启动,哪来的中断啊?
哪位兄弟碰到这类问题的,点拨下,谢谢。 |
|