完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
我已经建立了一个PWM模块运行在40kHz,并连接中断输出到ISR,如所附文件。
问题是执行从未到达中断处理程序… 我已经调用了PWM模块的初始化功能,我知道PWM是上升和运行良好。我也调用和lt;ISR & gt;x Sistar(),它内部调用lt;ISR & gt;做了一次调试,以确保这些函数确实被调用。PWM是工作良好,因为我已经检查了它的范围。不知道我错过了什么…此外,如果把PWM块的中断输出与数字输出引脚连接起来,会有什么期望? 谢谢! PWMY ISR.BMP 762.7 K 以上来自于百度翻译 以下为原文 I have set up a PWM module running at 40khz, and wired the interrupt output to an ISR as shown in the attached file. The problem is that execution nevert reaches the interrupt handler... I have called the initialisation functions for the PWM module and I know that the PWM is up and running fine. I have also called Thanks!
|
|
相关推荐
4个回答
|
|
嘿,Abhijit,
你能告诉我们你希望中断什么事件吗? 是否需要中断终端计数或比较1事件?根据您的要求,您可以选择其中任何一个。它可以在高级选项卡中看到,如下所示。 在主体()中,别忘了取消CyGalalActuable。否则中断将永远不会被触发。 在ISR.C中,包括pWM0.h和所有其他的头文件,这些文件将在ISR向量中使用。这些应该写在“开始”和“结束”语句内。这里也可以声明任何其他变量。如果在主语中使用,则使用关键字“Extn”。 在CysISR()函数中读取状态寄存器以清除中断位,因为它是粘性的。然后你可以根据你的逻辑设置变量。 这会打断你的工作。让我们知道这是否有帮助。 以上来自于百度翻译 以下为原文 Hey Abhijit, Can you please tell us on what event you want an Interrupt to be triggered? Whether you want Interrupt on Terminal Count or on Compare 1 Event? According to your requirement, you can choose any of these. It can be seen in the Advanced tab as shown below. In main( ), don't forget to uncomment the CYGlobalIntEnable. Else Interrupt will never be triggered. In the isr.c, include the PWM0.h and all other header files which you'll be using in the ISR vector. These should be written inside the #START and #END statements. Any other variables can also be declared here. If they are used in main too, then use the keyword "extern". In the CY_ISR( ) function read the status register to clear the interrupt bit as it is sticky. Then you can set variables according to your logic. This can get your Interrupt to working. Let us know if this helps. |
|
|
|
哦,当当!IIS缺少全局中断使能语句……“四倍体”。现在开始工作。
BTW在缺省生成的主体()中不存在。如果有中断的组件的数据表提到这将是一个好主意… 谢谢! 阿布希特 以上来自于百度翻译 以下为原文 Oh dang! I was missing just the global interrupt enable statement... "CYGlobalIntEnable". Working now. BTW It was not there in the default generated main(). It'd be a good idea if the datasheets for the components with interrupts mentioned this... Thanks! ~Abhijit |
|
|
|
您好!
我觉得有很多小事需要添加到数据表中,例如,没有数据表提到PWM0YRealStaseRebug Stor()必须被调用以使PWM中断下次准备就绪。在ISR的数据表中只有一个模糊的参考—— “一些中断源也需要用适当的块API(GPIO,UART,…)来清除,或者它们只会重新中断中断。进入ISR将清除一些中断源的未决位。 @赛普里斯人-我认为需要一些努力,使数据表更全面,涵盖所有这些小金块的信息! 谢谢, 以上来自于百度翻译 以下为原文 Hi I feel that a lot of small things need to be added to the datasheet; for example NONE of the datasheets mention that PWM0_ReadStatusRegister(); must be called to get the PWM interrupt ready for the next time. In the datasheet for the ISR there is but one vague reference - "Some interrupt sources will also need to be cleared with the appropriate block API (GPIO, UART, …) or they will just re-pend the interrupt. Entering the ISR will clear the pending bit for some interrupt sources." @Cypress folks - I believe some effort is needed to make datasheets a bit more comprehensive in covering all these small nuggets of info! Thanks, |
|
|
|
嗨,Abhijit,
非常感谢你的反馈。 在组件数据表中,而不是在设备数据表中使用“RealSturtReistRever()”来清除中断。 “中断输出是可能中断源组的逻辑或”。这个信号将高,而任何启用中断源是真实的。中断输出应保持断言,直到状态寄存器被软件读出。为了接收随后的中断,中断应该通过使用PWMLRead StaseRealStices()API读取状态寄存器来清除。如果没有设置使用中断参数,中断输出是不可见的。这允许状态寄存器在必要时被移除以进行资源优化。 以上来自于百度翻译 以下为原文 Hi Abhijit, Thank you very much for the feedback. The use of 'ReadStatus Register( )' to clear interrupts is mentioned in the Component datasheet rather than in device datasheet. "The interrupt output is the logical OR of the group of possible interrupt sources. This signal will go high while any of the enabled interrupt sources are true. The interrupt output shall remain asserted until the Status Register is read out by the software. In order to receive subsequent interrupts, the interrupt shall be cleared by reading the Status Register using the PWM_ReadStatusRegister() API. The interrupt output is not visible if the Use Interrupt parameter is not set. This allows the status register to be removed for resource optimization as necessary." |
|
|
|
只有小组成员才能发言,加入小组>>
752个成员聚集在这个小组
加入小组2075 浏览 1 评论
1829 浏览 1 评论
3643 浏览 1 评论
请问可以直接使用来自FX2LP固件的端点向主机FIFO写入数据吗?
1766 浏览 6 评论
1517 浏览 1 评论
CY8C4025LQI在程序中调用函数,通过示波器观察SCL引脚波形,无法将pin0.4(SCL)下拉是什么原因导致?
514浏览 2评论
CYUSB3065焊接到USB3.0 TYPE-B口的焊接触点就无法使用是什么原因导致的?
365浏览 2评论
CX3连接Camera修改分辨率之后,播放器无法播出camera的画面怎么解决?
413浏览 2评论
360浏览 2评论
使用stm32+cyw43438 wifi驱动whd,WHD驱动固件加载失败的原因?
866浏览 2评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-28 14:57 , Processed in 0.867444 second(s), Total 53, Slave 46 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号