完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
扫一扫,分享给好友
嗨,大家好,
我真的很难清除中断,这是由PWM输出(PWM)驱动。 一旦中断被驱动,我就不能清除它,并且它继续(清除待机不工作)。 请帮帮我。 谢谢: 以上来自于百度翻译 以下为原文 Hi All, im really struggeling clearing interrupt which is driven by PWM output (pwm). once the interrupt is driven, i cant clear it and it stays on (Clear Pending isnt working). Please help me.. Thank you :) |
|
相关推荐
8个回答
|
|
几个问题
1)PWM的周期是什么? 2)ISR中的代码是什么样子的?通常要设置一个简单的标志 并退出,在主服务器上维护ISR。您特别不想调用f-() 创建大量堆栈推送和延迟。 3)ISR的功能是什么?做什么? 问候,Dana。 以上来自于百度翻译 以下为原文 Several questions - 1) What is the period of the PWM ? 2) What does the code look like in ISR ? Normally you want to set a simple flag and exit, servicing ISR in main(). You especially do not want to call f()'s, that creates a lot of stack push and latency. 3) What is the function of the ISR ? To do what ? Regards, Dana. |
|
|
|
你的ISR水平还是边缘触发?如果它的电平被触发,只要PWM输出高,它将重新触发。
以上来自于百度翻译 以下为原文 Is your ISR level- or edge-triggered? If its level-triggered, it will re-trigger as long as the PWM output is high. |
|
|
|
|
|
|
|
首先,我要感谢大家的回复。
Dana: 1。PWMFreq。是2kHz 2±3。ISISIS中的代码只更改某个标志(UIT8)中的值 没有函数()调用内部或做一些复杂的事情。 Hli: 我的ISRis RISING EDGEtriggred。 ATACHE是组件连接和代码有害。 代码: CYSISRYPROTO(CXBATYYTYSTESTSM1LY1MSECKIGIQ){CXBATYYY-TESTYL1SMY1PNEYF1RY写入(ONFFFFACH);IF(OnFFFFRAG==1){OnFFFFACH=0;}否则{OnFFFFACH=1;}CcBATTyYyTeTysSmi11IsRy1MSECUCL(); 谢谢大家。 PNMH中断 18.6 K 以上来自于百度翻译 以下为原文 First of all i would like to thank you all for the replies. Dana: 1. PWM Freq. is 2KHz 2+3. The code inside the ISR is only changing the value in some flag (uint8) no function() calling inside or doing something complicated. Hli: My ISR is RISING-EDGE triggred. Atached is the component connection and the code sinpest. Code: CY_ISR_PROTO(CC_Battery_Tester_SM_1_1MSEC_IRQ) { CC_Battery_Tester_SM_1_Pin_1_Write (onOFFFlag); if (onOFFFlag == 1) { onOFFFlag = 0; }else { onOFFFlag = 1; } CC_Battery_Tester_SM_1_ISR_1MSEC_ClearPending (); } Thank you all.
|
|
|
|
通过调用pWMLRealStaseRealStestSub()函数(或者在您的情况下调用pWMy1MSECKRealStaseRebug Stor())来清除中断。仅清除已经发生的中断,但尚未调用ISR(例如,当中断被全局禁用时)。参见PWM数据表中的第34页。
另外,我认为您的函数名称不正确:ISR组件被称为ISRY1MSEC,但您称之为CcButyYyTeTysSmi11IsRy1MSECIL CurnPurvest.我认为这应该是ISRY1MSECII清除。 以上来自于百度翻译 以下为原文 The interrupts are cleared by calling the PWM_ReadStatusRegister() function (or PWM_1msec_ReadStatusRegister() in your case). _ClearPending only clear interrupts which have happened already but where the ISR has not been called yet (e.g. when interrupts are globally disabled). See also page 34 in the PWM datasheet. Also, I think your function names are not right: the ISR component is called ISR_1MSEC, but you call e.g. CC_Battery_Tester_SM_1_ISR_1MSEC_ClearPending. I think this should be just ISR_1MSEC_ClearPending . |
|
|
|
现在开始工作了!!)
为什么它没有为我工作的原因: HealeFr.H.& GT; CYSISRYPROTO(‘$StIsAsNo.No.1MSECKI ISR); Cy.ISrrPrto(‘$StassNo.No.1MSECKI ISR)/ /错误函数名:应该仅是CysiISR(‘$StassNo.No.1’,MSECKEI ISR){{ $ StasyNo.No``ONoFFFFACH);(OnOFFFRAG==1){OnFFFFACH=0;}否则{OnFFFFACH=1;}`$StassNo.No.`yISRY1MSECUIL CuxLIPINg();/2 pSOC3 ES1,ES2 RTC ISR补丁*/yIF(CyDeVixChIPdidieQueime==CyDeVelChIPdidieLeopad)α()(CyDeVixChIPReVixPlIP.ReViel-LeopARDeSe2)& &(; 解决方案: HealeFr.H.& GT; CYSISRYPROTO(‘$StIsAsNo.No.1MSECKI ISR); [C.G.ISR('$StassNo.No.1MSECKIOSISR){'$OnthFixNo.NoPoFFFLAG(OnfFFFACH);如果(OnFFFFRAGE==1){OnFFFFFACH=0;}否则{OnFFFFACH=1;}`$StassNo.No.`IsRy1MSECULL();;如果((CyDaveChIPHypReVixExv.lt;= CyDeVelCHIP.ReViel-LeopARDeSe2)和AMP; 再次感谢大家的帮助: 以上来自于百度翻译 以下为原文 Its working now!! :) Reason for why it didnt work for me: CY_ISR_PROTO(`$INSTANCE_NAME`_1MSEC_ISR); CY_ISR_PROTO(`$INSTANCE_NAME`_1MSEC_ISR) //Wrong Function name is Written: Should be only CY_ISR(`$INSTANCE_NAME`_1MSEC_ISR) { `$INSTANCE_NAME`_Pin_1_Write (onOFFFlag); if (onOFFFlag == 1) { onOFFFlag = 0; }else { onOFFFlag = 1; } `$INSTANCE_NAME`_ISR_1MSEC_ClearPending (); /* PSoC3 ES1, ES2 RTC ISR PATCH */ #if(CYDEV_CHIP_DIE_EXPECT == CYDEV_CHIP_DIE_LEOPARD) #if((CYDEV_CHIP_REV_EXPECT <= CYDEV_CHIP_REV_LEOPARD_ES2) && (`$INSTANCE_NAME`_ISR_1MSEC__ES2_PATCH )) `$INSTANCE_NAME`_1MSEC_ISR_ISR_PATCH(); #endif #endif } Solution: CY_ISR_PROTO(`$INSTANCE_NAME`_1MSEC_ISR); CY_ISR(`$INSTANCE_NAME`_1MSEC_ISR) { `$INSTANCE_NAME`_Pin_1_Write (onOFFFlag); if (onOFFFlag == 1) { onOFFFlag = 0; }else { onOFFFlag = 1; } `$INSTANCE_NAME`_ISR_1MSEC_ClearPending (); /* PSoC3 ES1, ES2 RTC ISR PATCH */ #if(CYDEV_CHIP_DIE_EXPECT == CYDEV_CHIP_DIE_LEOPARD) #if((CYDEV_CHIP_REV_EXPECT <= CYDEV_CHIP_REV_LEOPARD_ES2) && (`$INSTANCE_NAME`_ISR_1MSEC__ES2_PATCH )) `$INSTANCE_NAME`_1MSEC_ISR_ISR_PATCH(); #endif #endif } Again, Thank you all for your help :) |
|
|
|
看起来像是创建了自己的组件,还是从生成代码的地方对API文件进行了更改?
鲍勃 以上来自于百度翻译 以下为原文 It looks as if you created your own component or did you make changes to the api-files from where the code is generated? Bob |
|
|
|
我已经制作了自己的组件并创建了自己的中断。
以上来自于百度翻译 以下为原文 I've made my own component and created my own interrupt. |
|
|
|
只有小组成员才能发言,加入小组>>
754个成员聚集在这个小组
加入小组2110 浏览 1 评论
1858 浏览 1 评论
3673 浏览 1 评论
请问可以直接使用来自FX2LP固件的端点向主机FIFO写入数据吗?
1791 浏览 6 评论
1540 浏览 1 评论
CY8C4025LQI在程序中调用函数,通过示波器观察SCL引脚波形,无法将pin0.4(SCL)下拉是什么原因导致?
576浏览 2评论
CYUSB3065焊接到USB3.0 TYPE-B口的焊接触点就无法使用是什么原因导致的?
430浏览 2评论
CX3连接Camera修改分辨率之后,播放器无法播出camera的画面怎么解决?
440浏览 2评论
390浏览 2评论
使用stm32+cyw43438 wifi驱动whd,WHD驱动固件加载失败的原因?
937浏览 2评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-27 20:19 , Processed in 0.910120 second(s), Total 89, Slave 73 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号