Cypress技术论坛
直播中

周宇

8年用户 135经验值
私信 关注
[问答]

向PSOC4000S添加10 Hz ISR的最简单方法是什么?

我有一个项目使用CY8C4024AZI S403设备。我有运行代码,但希望创建一个简单的定时器ISR,可以执行的事情,如扫描按键等。
我以前在PoSO4BLE上使用了GualLoad信号,所以我添加了一个名为GulalSaleAl2的附加的iSRY1。在配置窗口中,GualAlxalAl2使用看门狗定时器中断(WdTyt)。
然后我进入LFCLK设置并启用计时器(WDT)作为一个自由运行的计时器(见附件),向主程序添加代码以启动ISR—ISRY11START(),并将代码添加到ISRY1.1.C文件中:
CysISR(ISRY1I-中断)
{
中断,回调,回调
IsRy11ExcTraceTraceTraceBAR();
InEnff/*ISRY11StuttTraceTraceType回调*//
*把你的中断代码放在这里。*/
/*‘启动ISRY11中断’*/
CySysDtCultStultTo();
TEDSCOUNT++;
/*’结尾’*
}
它编译和运行,但似乎从来没有调用ISR作为TEDSCOUNT从不递增。如果我把计时器(WDT)改为模式看门狗(W/Buffic),我的代码似乎陷入了末日循环——不知道发生了什么。
有什么想法吗?
PSOC400CcLS1.1.PNG
40.3 K

以上来自于百度翻译


     以下为原文
  I have a project using a CY8C4024AZI-S403 device.  I have running code but wanted to create a simple timer ISR that can perform things like scan for key presses etc.

I've used a GlobalSignal before on a PSoC4 BLE so I added one called GlobalSignal_2 with an attached isr_1. In the configuration window, GlobalSignal_2 uses Watch Dog Timer Interrupt (WDTInt).

I then went into the LFClk setting and enabled the Timer (WDT) as a free running timer (see attachment), added code to main to start the isr - isr_1_start(); -and added code to the isr_1.c file as follows:

CY_ISR(isr_1_Interrupt)
{
    #ifdef isr_1_INTERRUPT_INTERRUPT_CALLBACK
        isr_1_Interrupt_InterruptCallback();
    #endif /* isr_1_INTERRUPT_INTERRUPT_CALLBACK */


    /*  Place your Interrupt code here. */
    /* `#START isr_1_Interrupt` */
        CySysWdtClearInterrupt();
        tedsCount++;
    /* `#END` */
}

It compiles and runs but doesn't seem to ever call the ISR as tedscount never increments.  If I change the Timer (WDT) to mode Watchdog (w/interrupt) my code seem to get stuck in a doom loop - not sure what's happening

Any ideas what's wrong?


回帖(2)

张桂英

2018-12-5 14:34:12
WDT时钟是否默认启用,还是必须在主功能上启动?你启用它了吗?
编辑:
刚刚找到了关于PSoC4和WDT的博客文章,它可能对你有帮助。PSOC4手表狗定时器-物联网专家

以上来自于百度翻译


     以下为原文
  Does the WDT clock is enabled by default or you must start it on your main function? did you enabled it?
 
EDIT:
Just found this blog post about psoc4 and WDT, it might help you. PSoC4 Watch Dog Timer - IoT Expert
举报

罗红

2018-12-5 14:40:55
请参考代码示例CE210229,例如如何在PSoC 40S中使用WDT来中断生成。

以上来自于百度翻译


     以下为原文
  Please refer to the code example CE210292 for example of how to use WDT in PSoC 4000S for interrupt generation.
举报

更多回帖

发帖
×
20
完善资料,
赚取积分