全速运行,不能到达中断口

[复制链接]
2778|33
 楼主| jiaxw 发表于 2018-5-9 16:10 | 显示全部楼层 |阅读模式
430 I/O中断疑问
#include <msp430f5310.h>

int main(void)
{
  WDTCTL = WDTPW | WDTHOLD;                 // Stop watchdog timer
  P1DIR |= BIT0;                            // Set P1.0 to output direction
  P1OUT &= ~BIT0;
  P1REN |= BIT4;                            // Enable P1.4 internal resistance
  P1OUT |= BIT4;                            // Set P1.4 as pull-Up resistance
  P1IES &= ~BIT4;                           // P1.4 Lo/Hi edge
  P1IFG &= ~BIT4;                           // P1.4 IFG cleared
  P1IE |= BIT4;                             // P1.4 interrupt enabled
  
  while(1)
  {
    __bis_SR_register(LPM4_bits |GIE);     // Enter LPM4 w/interrupt
    __no_operation();                       // For debugger
    P1OUT ^= BIT0;                        // P1.0 = toggle
    P1IES ^= BIT4;                          // Toggle between H-L and L-H transition triggers
    P1IE |= BIT4;                           // Enable port interrupt
  }
}

// Port 1 interrupt service routine
#pragma vector=PORT1_VECTOR
__interrupt void Port_1(void)
{
  P1IFG &= ~BIT4;                           // Clear P1.4 IFG
  P1IE &= ~ BIT4;                           // Clear P1.4 IE
  _BIC_SR_IRQ(LPM4_bits);                   // Exit LPM4
}


全速运行时不能到达I/O中断入口,但是设置断点是可以到达的
spark周 发表于 2018-5-9 16:13 | 显示全部楼层
是不是程序跑飞掉了
 楼主| jiaxw 发表于 2018-5-9 16:19 | 显示全部楼层

单步执行时也不行.仿真软件为IAR;
liliang9554 发表于 2018-5-9 16:24 | 显示全部楼层

没用iar仿真中断过。
午夜粪车 发表于 2018-5-9 16:28 | 显示全部楼层

都是在中断设置的断点测试的。
wuhany 发表于 2018-5-9 16:32 | 显示全部楼层
这么搞了,不行啊
yszong 发表于 2018-5-9 16:36 | 显示全部楼层

程序跑飞了吗
wuhany 发表于 2018-5-9 16:46 | 显示全部楼层
中断配置有问题吗
dengdc 发表于 2018-5-9 18:52 | 显示全部楼层
查看一下触发条件。
heweibig 发表于 2018-5-9 18:52 | 显示全部楼层

仿真可能有干扰。
wuhany 发表于 2018-5-9 18:54 | 显示全部楼层

__bis_SR_register(LPM4_bits |GIE); ?
 楼主| jiaxw 发表于 2018-5-9 23:05 | 显示全部楼层

结贴了,多谢大家讨论这么多哈,呵呵
jkl21 发表于 2018-5-10 10:06 | 显示全部楼层
你的 触发中断的信号源是什么
maqianqu 发表于 2018-5-10 10:07 | 显示全部楼层
就是持续的时间太短了。
dspmana 发表于 2018-5-10 10:07 | 显示全部楼层
这个使用电平触发
eefas 发表于 2018-5-10 10:07 | 显示全部楼层
你的硬件怎么设计的
aspoke 发表于 2018-5-10 10:08 | 显示全部楼层
断点是可以到达的,就没有问题。
232321122 发表于 2018-5-10 10:08 | 显示全部楼层
是不是没有上拉电阻呢
ghuca 发表于 2018-5-10 10:09 | 显示全部楼层
程序没有问题,就是硬件的问题
soodesyt 发表于 2018-5-10 10:09 | 显示全部楼层
spark周 发表于 2018-5-9 16:13
是不是程序跑飞掉了

程序跑飞就不是这个问题了。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

825

主题

9762

帖子

4

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