[STM8] 关于进入中断后

[复制链接]
 楼主| lsj19851118 发表于 2013-1-23 21:44 | 显示全部楼层 |阅读模式
我在主函数中初始化后开了全局中断 _asm("rim")后 单片机重新上电运行后就进入@far @interrupt void NonHandledInterrupt (void)这个中断函数,大约得1分钟左右吧  才能从那个中断跳出来,这是为什么呀?

@far @interrupt void NonHandledInterrupt (void)
{
       /* in order to detect unexpected events during development,
          it is recommended to set a breakpoint on the following instruction
       */
       return;
}

extern void _stext();     /* startup routine */

struct interrupt_vector const _vectab[] = {
       {0x82, (interrupt_handler_t)_stext}, /* reset */
       {0x82, NonHandledInterrupt}, /* trap  */
       {0x82, NonHandledInterrupt}, /* irq0  */
       {0x82, NonHandledInterrupt}, /* irq1  */
       {0x82, NonHandledInterrupt}, /* irq2  */
       {0x82, NonHandledInterrupt}, /* irq3  */
       {0x82, NonHandledInterrupt}, /* irq4  */
       {0x82, NonHandledInterrupt}, /* irq5  */
       {0x82, NonHandledInterrupt}, /* irq6  */
       {0x82, NonHandledInterrupt}, /* irq7  */
       {0x82, NonHandledInterrupt}, /* irq8  */
       {0x82, NonHandledInterrupt}, /* irq9  */
       {0x82, NonHandledInterrupt}, /* irq10 */
       {0x82, NonHandledInterrupt}, /* irq11 */
       {0x82, NonHandledInterrupt}, /* irq12 */
       {0x82, NonHandledInterrupt}, /* irq13 */
       {0x82, NonHandledInterrupt}, /* irq14 */
       {0x82, NonHandledInterrupt}, /* irq15 */
       {0x82, NonHandledInterrupt}, /* irq16 */
       {0x82, NonHandledInterrupt}, /* irq17 */
       {0x82, NonHandledInterrupt}, /* irq18 */
       {0x82, NonHandledInterrupt}, /* irq19 */
       {0x82, NonHandledInterrupt}, /* irq20 */
       {0x82, NonHandledInterrupt}, /* irq21 */
       {0x82, NonHandledInterrupt}, /* irq22 */
       {0x82, UART_LIN}, /* irq23 */
       {0x82, NonHandledInterrupt}, /* irq24 */
       {0x82, NonHandledInterrupt}, /* irq25 */
       {0x82, NonHandledInterrupt}, /* irq26 */
       {0x82, NonHandledInterrupt}, /* irq27 */
       {0x82, NonHandledInterrupt}, /* irq28 */
       {0x82, NonHandledInterrupt}, /* irq29 */
};
uet_cache 发表于 2013-1-23 21:53 | 显示全部楼层
是不是使能 子其它中断,而你其它中断函数都没定义。。。
 楼主| lsj19851118 发表于 2013-1-27 11:43 | 显示全部楼层
问题找到了  是我将其中的一个I/O口作为外设中断,而且是悬浮输入了
您需要登录后才可以回帖 登录 | 注册

本版积分规则

5

主题

15

帖子

1

粉丝
快速回复 在线客服 返回列表 返回顶部

5

主题

15

帖子

1

粉丝
快速回复 在线客服 返回列表 返回顶部