This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

[参考译文] CCS/MSP432P401R:缺少上升沿中断

Guru**** 3036750 points

Other Parts Discussed in Thread: SYSCONFIG

请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/tools/code-composer-studio-group/ccs/f/code-composer-studio-forum/906373/ccs-msp432p401r-missing-rising-edge-interrupts

器件型号:MSP432P401R
Thread 中讨论的其他器件:SysConfig、

工具/软件:Code Composer Studio

SysConfig 配置的驱动器似乎缺少中断的大多数上升沿。  这是一个大问题。

我已使用 SysConfig 和 TI-RTOS 在两个沿配置了中断输入引脚。  以下引脚配置:

我的初始化代码如下:

void initSensor (Event_Handle healthEvent)
{
EVENT_PARAMS eParams;
Task_Params taskParams;

/*设置事件以处理 I/O 更改*/
EVENT_PARAMS_INIT (&eParams);
event_construct(&eventIopinStruct,&eParams);
eventIopin = Event_Handle (&eventIopinStruct);

/*启用 GPIO 中断*/
GPIO_enableInt (HAPPYn);
GPIO_enableInt (SADn);
GPIO_enableInt (TUBEOUT);
GPIO_enableInt (DOOROPEN);

/*启动32位计时器(用于定时按钮按压*/
TIMER32_1->LOAD = 0xffffffff;//我们正在持续递减计数*/
/*打包模式、32位、1分频预分频、禁用中断、自由运行、启用*/
TIMER32_1->CONTROL = TIMER32_CONTROL_SIZE | TIMER32_CONTROL_ENABLE;

/*启动传感器任务*/
Task_Params_init (&taskParams);
taskParams.stack = senTaskStack;
taskParams.STACKSIZE = SENSOR_TASK_STKSZ;
taskParams.arg0 =(UArg) healthEvent;
taskParams.priority = sensor_task_PRI;
Task_construct(&senTask,(Task_Functr )sensorTask,&taskParams,NULL );
} 

我的回调函数如下:

void gpioCallback (uint_least8_t index)
{
交换机(索引)
{
案例 HAPPYn:
GPIO_toggle (mock_happy);
如果(GPIO_READ (HAPPYn)=0)
{
GPIO_write (foll_happy、0);
event_post (eventIopin、happy 按下);
}
其他
{
GPIO_write (foll_happy、1);
event_post (eventIopin、happy 释放);
}
中断;
案例 SADn:
EVENT_POST (eventIopin、SAD_CHANGED);
中断;
案例 TUBEOUT:
EVENT_POST (eventIopin、tube_changed);
中断;
案例 DOROPEN:
EVENT_POST (eventIopin、DOOR 已更改);
中断;
默认值:
中断;
}
} 

我的按钮是一个按钮、依赖于 MSP432端口中的上拉电阻器。 我已经配置了两个 GPIO 来说明我的中断函数中正在发生的情况。
中断功能似乎捕获了所有下降沿、但错过了大部分(但不是所有上升沿)。 看看下面的这个捕获、按钮是按钮输入、
Mock Follow 应该在上升沿和下降沿都切换、跟随器将在上升沿中断时变为高电平、在下降沿中断时变为低电平。

查看我在下面的第一个捕获记录、可以看到上升沿仅在3秒标记处出现。 下图显示了事件更改和处理中断之间的滞后时间大约为35 μ s。

第三个图是1.25秒标记附近区域的缩放。 您可以看到、尽管看起来我们对上升沿做出了响应、但它实际上检测到了按钮反弹的下降沿。

第四个图是最终注意到上升沿的区域的缩放。

如果这起作用、CPU 配置中的硬件干扰滤波器将打开。




  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    它看起来像是我的帖子的最后一部分被改编了、这里是:

    My button is a pushbutton, relying on the pull up resistor in the MSP432 port. 

    I have configured two GPIOs to illustrate what is going on in my interrupt function.It appears that the interrupt function catches all falling edges but misses most (but not all rising edges). 

    Look at thiscapture below, Button is the button input, Mock Follow should toggle on both rising and falling edges and Follower will go high on a rising edge interrupt and low on a falling edge interrupt.

    Looking at my first capture below note that a rising edge is only seen at the 3 second mark. 

    The next figure shows the lag between the event change and servicing the interrupt is about 35 uSec.

    The third figure is a zoom in of the area near the 1.25 Sec mark.  You can see that even though it looks like we responded to a rising edge, it was actually detecting the falling edges of the button bounce.

    The fourth figure is a zoom in of the area where the rising edge was finally noticed.If it makes a difference, the hardware glitch filter in the CPU config is turned on.


  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    尊敬的 Mike:

    感谢您的详细博文。  MSP432P401R 不支持检测两个边沿上的中断-仅检测低电平到高电平或高电平到低电平的转换。 我不确定 SysConfig 为何不检查兼容性、因此我将报告这一点、看看是否可以添加该检查。

    MSP432P401R:GPIO 中断:"GPIO_CFG_IN_INT_INT_INT_Bot_Edges"

    此致、

    James