完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
我注意到在我的PSoC 3 ES3和AM试图理解它的中断行为。
我有一个边缘触发ISR组件连接到一个数字线路(我将称之为ISR1)。 给出以下顺序: 从上电(中断使能位isr1和全局中断不是默认设置)中断源时,设置挂起的国旗isr1叫isr1_start();电话isr1_stop();电话isr1_clearpending();打电话时cyglobalintenable cyglobalintenable称,为isr1 ISR是我中等执行。检查intc_clr_en和intc_clr_pd登记确认isr1不启用或等候时,全局中断使能。 我想中断未决或中断控制器或CPU的某个地方,但我一直在阅读时间不能确定,这是悬而未决或如何清除它。任何对此的洞察都是值得赞赏的。 注:我可以99%通过移动clearpending开始之前解决问题,所以isr1未启用和未决的同时。但这不是一个真正的解决方案,有一个小机会的中断可能会触发启动和停止期间。另外,我想了解到底发生了什么。 谢谢, ——乔纳森 以上来自于百度翻译 以下为原文 I have noticed the following interrupt behavior on my PSoC 3 ES3 and am trying to understand it. I have an edge triggered ISR component connected to a digital line (I'll call it ISR1). Given the following sequence:
I assume the interrupt is pending somewhere in either the interrupt controller or CPU, but I have been reading the TRM and cannot determine where it is pending or how to clear it. Any insight on this is appreciated. Note: I can 99% solve the problem by moving the ClearPending before the Start, so ISR1 is not enabled and pending at the same time. But this is not really a solution as there is a small chance the interrupt could be triggered during the period between Start and Stop. Plus I would like to understand what is actually happening. Thanks, -- Jonathan |
|
相关推荐
17个回答
|
|
听起来很有趣!请上传你的工程实例在这里,让我们能看看吗?
为此,建立>;清洁项目,文件& gt;创建工作包(小) 然后在这里附加zip文件。 鲍勃 以上来自于百度翻译 以下为原文 That sounds interesting! Will you please upload your example project here, so that we can have a look at it? To do so, Build->Clean Project, File->Create workspace Bundle (minimal) Then attach .zip file here. Bob |
|
|
|
欣然。
这个项目应该使用控件Reg和ISR重新创建行为。如果在ISR中对这两种情况都设置断点,则两个都会被击中,当我只期望第二个命中时。 ——乔纳森 以上来自于百度翻译 以下为原文 Gladly. This project should recreate the behavior using a control reg and isr. If you place breakpoints on both cases in the ISR, both will be hit when I would expect only the second to be hit. -- Jonathan |
|
|
|
嗯,附件好像不在那里。让我试试这个。
以上来自于百度翻译 以下为原文 Hmm, the attachment doesn't seem to be there. Let me try this agian. |
|
|
|
上传附件需要一些时间。不要停止尝试!
鲍勃 以上来自于百度翻译 以下为原文 It takes some time until the attachment is uploaded. Don't stop trying! Bob |
|
|
|
不确定这是否有帮助。
根据ISR的CultSungIn数据表 副作用:一些中断源也需要用适当的块API清除(GPIO), UART,等等),或者他们将重新中断中断。进入ISR清除未决 中断源位 以上来自于百度翻译 以下为原文 Not sure if this can help. According to ISR data sheet for clearPending() Side Effects: Some interrupt sources also need to be cleared with the appropriate block API (GPIO, UART, and so on) or they will just re-pend the interrupt. Entering the ISR clears the pending bit for some interrupt source |
|
|
|
|
|
|
|
嗨,乔纳森,
如果你不能附加这个项目,你可以把它寄给我。我将代表你张贴。 我的电子邮件ID是DASG@ CyPress。 以上来自于百度翻译 以下为原文 Hi Jonathan, If you are unable to attach the project, you can mail it to me. I will post it on your behalf. My email id is dasg@cypress.com |
|
|
|
最后一次上传,然后我会发邮件给DASG。
以上来自于百度翻译 以下为原文 Last try uploading, then I'll email it to dasg. |
|
|
|
好吧,显然这个论坛对我来说太复杂了,但是我给DASG发了邮件。
同时,我注意到中断在哪里,所以我想问题是如何正确地清除它。 当启用和挂起位都被设置时,中断号被加载到IncTyActhItnnUm中,并且ISR的地址被加载到ItcCyActhyVECT中。在ITCCL CLRIEN和ITCCL CRRPD中清除启用和挂起的标志不影响活动中断寄存器。一旦启用全局掩码,它就跳转到活动中断寄存器中的未决ISR。 以上来自于百度翻译 以下为原文 Okay, clearly this forum is too complicated for me, but I emailed the project to dasg. In the meantime, I've noticed where the interrupt is pending, so I think the question is just how to properly clear it. When the enable and pending bits are both set, the interrupt number is loaded into INTC_ACT_INT_NUM and the address of the isr is loaded into INTC_ACT_VECT. Clearing the enable and pending flags in INTC_CLR_EN and INTC_CLR_PD does not affect the active interrupt registers. Once the global mask is enabled, it jumps to the pending ISR in the active interrupt registers. |
|
|
|
嗨,大家好,
我代表乔纳森上传这个项目。 Pydiq.CyWrk.Access 01.Zip 216.7 K 以上来自于百度翻译 以下为原文 Hi all, I am uploading the project on behalf of Jonathan.
|
|
|
|
我有权改变计划,我认为应该是这样。看看这些评论。它现在正如期运行。
鲍勃 PUNDIQ1.ZIP 216.9 K 以上来自于百度翻译 以下为原文 I took the right to change the program as I thought it should be. Have a look at the comments. It is now running as expected. Bob
|
|
|
|
鲍勃,
感谢您抽出时间来查看程序并提供所有的评论。但是,在开始()之前移动CysPungIn()调用改变了我描述的行为。即使在这种新的情况下,中断仍然可以在CysPungIn()和Dabable()调用之间触发(假设它是真实的、外部中断而不是控制RG)。我希望能够清楚的中断,而当全局掩码被设置的时候,这个问题就要解决了。除非你告诉我,我不能那样做,如果那样,我想我会活下去的: 谢谢, ——乔纳森 另一方面,我喜欢使用StXTeX.()的这种风格。这样,我就不必匆忙把代码直接添加到那些自动生成的ISR文件中,这些文件不可避免地涉及回调或外部。 以上来自于百度翻译 以下为原文 Bob, Thank you for taking the time to look at the program and providing all the comments. However, moving the ClearPending() call before the Start() changes the behavior I was describing. Even in this new scenario, the interrupt could still be triggered between the ClearPending() and Disable() calls (assuming it was a real, external interrupt and not a control reg). I was hoping to be able to be clear interrupts which became pending while the global mask was set. Unless you are telling me I can't do that, in which case I guess I'll live :) Thanks, -- Jonathan On a side note, I like this style of using StartEx(). That way I don't have to go to the hastle of adding code directly to those auto-generated ISR files which inevitably involves callbacks or externs. |
|
|
|
在我看来,任何访问之前start()或startex()执行例行的不是“法律”,必须避免。然而这样一个访问应导致模块程序出错了(S)。
有startex()函数的一点:当你从psoc5 topsoc3(或反之亦然)你不需要改变任何代码。不同的isr_1.c-files生成和手动输入的变化,必须进入一次。 鲍勃 以上来自于百度翻译 以下为原文 In my opinion any access of a routine before Start() or StartEx() is executed is not "legal" and must be avoided. Nonetheless such an access should lead to an error and captured by the module-routine(s). There's one more point for the StartEx() function: when you switch from PSoC5 to PSoC3 (or vice versa) you do not have to change any code. The isr_1.c-files are differently generated and the manually entered changes have to be entered once more. Bob |
|
|
|
嗯,我不确定我完全理解你的意思start()前的例行访问什么。如果待位设置,将设置start() ISR位置,优先,等在设置的使能位,所以没有ISR之前应该被初始化为。为了防止start()被称为待定点已经设置的唯一办法就是门的中断源,似乎复制启用位功能。但我可能误解了你的观点。
——乔纳森 以上来自于百度翻译 以下为原文 Hmm, I'm not sure I completely understand what you mean by access of a routine before Start(). If the pending bit is set, Start() will setup the ISR location, priority, etc before setting the enable bit, so no ISR should be called before being initialized. The only way to prevent Start() from being called with a pending bit already set would be to gate the interrupt source which would seem to replicate the functionality of the enable bit. But I may have misunderstood your point. -- Jonathan |
|
|
|
你好,乔纳森,
在启动ISR(ISRY1YSTART)之前,Bob的意思是调用ISRL11CypReund和ISRY1ILSTEP是非法的。如果不启动ISR组件,清除可能不起作用。 以上来自于百度翻译 以下为原文 Hello Jonathan, What Bob meant was calling isr_1_Clearpending and isr_1_stop is illegal before starting the isr ( isr_1_start ). The clearpend may not work without starting the isr component. |
|
|
|
这就是我想表达的(对不起,我不是英国人)。只要您没有调用任何组件的Stand(),很多事情就不会初始化。清除中断号未知的中断(由Stand()设置)将产生副作用或将不起作用(如您所见)。
停止()函数将初始化一个组件,该组件将它置于一个状态,就好像它还没有被初始化一样。 顺便说一下,我强烈建议把CysPink()调用权加入到你的中断服务程序中! 继续,不要被打断 鲍勃 以上来自于百度翻译 以下为原文 That is what I wanted to express (sorry, I'm not native english). As long as you did not call Start() for any component, many things ane not initialized. Clearing an interrupt for which the interrupt-number is unknown (is set by Start() ) will have side-effects or will not work (as you see). The Stop() function will de-initialize a component which will leave it in a state just as if it hasn't been initialized yet. By the way, I would strongly suggest to put the ClearPending() call right into your interrupt-service routine! Go on, don't get interrupted Bob |
|
|
|
所有启动()似乎都是设置向量,优先级,然后启用位。至少在这种情况下,中断号是由PSoC Creator硬编码的。在调用START()之前,未决位似乎已经起到了预期的作用(即,当中断源发生时,它被设置)。不过,我理解在组件的任何其他函数之前调用Stand()是一个很好的实践。因此,在调用Stutter()之前调用CysPungIn()是非法的,是否有一种防止中断被调用的首选方法?(诚然,我目前的解决方案涉及非法行为)
以上来自于百度翻译 以下为原文 All Start() appears to do is set the vector, priority, then the enable bit. At least in this case, the interrupt number is hard coded by PSoC Creator. The pending bit already seems to function as expected before Start() is called (that is, it is set when the interrupt source occurs). However I understand it is good practice to call Start() before any other function of a component. So, given that calling ClearPending() before Start() is illegal, is there a preferred method to prevent the interrupt from firing as soon as Start() is called? (Since, admittedly, my current solution involves that illegal behavior) |
|
|
|
只有小组成员才能发言,加入小组>>
754个成员聚集在这个小组
加入小组2105 浏览 1 评论
1851 浏览 1 评论
3669 浏览 1 评论
请问可以直接使用来自FX2LP固件的端点向主机FIFO写入数据吗?
1786 浏览 6 评论
1536 浏览 1 评论
CY8C4025LQI在程序中调用函数,通过示波器观察SCL引脚波形,无法将pin0.4(SCL)下拉是什么原因导致?
568浏览 2评论
CYUSB3065焊接到USB3.0 TYPE-B口的焊接触点就无法使用是什么原因导致的?
422浏览 2评论
CX3连接Camera修改分辨率之后,播放器无法播出camera的画面怎么解决?
437浏览 2评论
383浏览 2评论
使用stm32+cyw43438 wifi驱动whd,WHD驱动固件加载失败的原因?
915浏览 2评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-23 04:00 , Processed in 1.373861 second(s), Total 109, Slave 93 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号