完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
你好!
我对此很陌生,但一直在CY8CKIT-050戳过去,这是一个非常酷的套件! 我正在试图让硬件和软件中断设置。我最终会改变PWM的时间所以我有一个缓慢的定时器设置(这样我可以调整PWM周期为1到60,之间有不同的工作周期)。我现在有这套切换和关闭每1秒。我有一个LED的设置是通过PWM输出触发(LED3)和LED设置被中断触发(LED4)。 以下是我目前的设置: 我的代码看起来像这样: CYMISISR(PWMIX中断处理程序) { PiNeLe4xx写(~pInE-Le44Read()); } int() { 囊状的; PWMXSTATE(); pWMyBufftTyStTeX(PWMyCdultJuthHand); (;) { //我还有其他代码在这里运行 } } 我一直在尽我可以多阅读(在论坛上,观看YouTube上的视频,等等)但我似乎无法找到的问题与我的理解(也许是在做什么,我把它编程序做但我的期望值是错误的)或者我忽略了一些基本需要是E这是为了工作和工作。 有人能给我任何帮助,我将不胜感激。如果你需要任何额外的信息,请告诉我。谢谢! 以上来自于百度翻译 以下为原文 Hello! I'm fairly new to this but have been poking away at the CY8CKIT-050 and it's a pretty cool kit! I'm currently trying to get both a hardware and software interrupt setup. I will eventually be varying the PWM time so I have a slow timer setup (so I can adjust my PWM period for anywhere between 1 and 60s, with varying duty cycles). I am currently having it set to toggle on and off every 1 second. I have an LED setup to be triggered via the PWM output (LED3) and an LED setup to be triggered by the interrupt (LED4). Below is my current setup: My code looks like this: CY_ISR(PWM_Interrupt_Handler) { Pin_LED4_Write(~Pin_LED4_Read()); } int main() { CyGlobalIntEnable; PWM_Start(); PWM_Interrupt_StartEx(PWM_Interrupt_Handler); for(;;) { // I have other code running in here } } I've been trying to do as much reading as I can (in the forums, watching videos on youtube, etc) but I can't seem to find the issue with either my understanding (maybe it's doing exactly what I have it programmed to do but my expectations are wrong) or I'm missing something basic that needs to be enabled for this to be up and working. Any help someone could give me would be greatly appreciated. If you need any additional information, please let me know. Thanks a lot! |
|
相关推荐
9个回答
|
|
需要清除ISR例程内的中断,例如pWMyBuffTyRead StaseRealSuthor();
PSoC 3/5中计数器/定时器/ PWM中断的清除 以上来自于百度翻译 以下为原文 Need to clear interrupt inside isr routine, e.g. PWM_Interrupt_ReadStatusRegister(); Clearing Counter/Timer/PWM Interrupt in PSoC 3/5 |
|
|
|
nvwuwy 发表于 2018-10-17 16:18 谢谢你的回复! 你是正确的,我需要清除中断标志,但不幸的是,这似乎不是问题。它实际上从来没有进入中断程序,首先,我认为是奇怪的。我想我已经把它初始化好了,但也许我还遗漏了什么东西。这是我当前的代码: CYMISISR(PWMIX中断处理程序) { UTIN 8TIMDATA; PiNeLe4xx写(~pInE-Le44Read()); TimDATABOR= PWMLRealStaseRealSub();/ /清除中断 } int() { 囊状的; PWMXSTATE(); pWMyBufftTyStTeX(PWMyCdultJuthHand); (;) { //我还有其他代码在这里运行 } } 我忘了把这最后一组图片,但是,如果问题是,中断不会被触发,这个页面会很重要: 我希望我错过了一些非常愚蠢的事情!谢谢你的帮助! 以上来自于百度翻译 以下为原文 Thanks for the reply! You are correct that I need to clear the interrupt flag but, unfortunately, that doesn't appear to be the problem. It actually never enters that interrupt routine in the first place, which I thought was odd. I thought I had initialized it correctly but maybe I'm still missing something. Here's my current code: CY_ISR(PWM_Interrupt_Handler) { uint8 tempdata; Pin_LED4_Write(~Pin_LED4_Read()); tempdata = PWM_ReadStatusRegister(); // Clear the interrupt } int main() { CyGlobalIntEnable; PWM_Start(); PWM_Interrupt_StartEx(PWM_Interrupt_Handler); for(;;) { // I have other code running in here } } I forgot to post this in my last set of pictures but, if the issue is that the interrupt is not being triggered, this page will likely be important as well: I'm hoping I'm just missing something really silly! Thanks for your help! |
|
|
|
60user187 发表于 2018-10-17 16:33 请上传项目回顾: 在资源管理器中的树视图中选择的项目名称、文件& gt;创建档案 最小束 2018年3月30日下午1点58分,“jeremy_3270776”& lt;社区经理@柏。COM & gt; 以上来自于百度翻译 以下为原文 Please upload the project to review: Select project name in explorer tree view, File->Create Archive Bundle->Minimal On Mar 30, 2018 1:58 PM, "jeremy_3270776" <community-manager@cypress.com> |
|
|
|
当然,这是文件。谢谢! PWM中断 506.1 K 以上来自于百度翻译 以下为原文 Sure, here's the file. Thanks!
|
|
|
|
嗨,杰瑞米,
只需在“PWM高级配置”标签和“中断比较”事件下启用“终端计数事件中断”。然后它工作。我不知道为什么没有这个选项,中断不会触发。 以上来自于百度翻译 以下为原文 hi jeremy, Just enable "interrupt on terminal count event" too under PWM advanced configuration tab along with interrupt on compare event. Then it works. I don't know why without that option being enabled, interrupt do not triggered. |
|
|
|
谢谢,阿马尔! 嘿,我真不敢相信这就是全部。…有趣的是我澄清了,因为我不认为我需要它。… 我本来希望LeD3能在PWM信号上同时开关。你知道为什么LeD3不会以相同的频率打开和关闭吗?我以为他们都会采取同样的行动。也许我的理解是错误的。 以上来自于百度翻译 以下为原文 Thanks, Amar! Heh, I can't believe that's all it took . . . the funny thing is I cleared that because I didn't think I needed it . . . I would've expected LED3 to toggle on and off as well on the PWM signal. Do you know why LED3 isn't turning on and off with the same frequency? I assumed they would both be acting the same. Maybe my understanding is wrong though. |
|
|
|
60user187 发表于 2018-10-17 17:08 你好, 这是因为杀死信号。由于PWM死区被禁用,并且杀死信号被捆绑到高电平,PWM的输出保持在低电平。 为什么你把杀戮输入连接到高?这里是一个解释杀死输入的数据表。 以上来自于百度翻译 以下为原文 Hi, That is because of kill signal. Since PWM deadband is disabled and Kill signal is tied to high, the output of PWM remains at LOW. Why did you connect kill input to HIGH? Here is a piece of datasheet explaining kill input. |
|
|
|
望望Ll 发表于 2018-10-17 17:19 嗯,我不知道。…我读错了(或者我把它设置不同,当我第一次实现了)。无论如何,我应该回去读这个。 谢谢你的帮助! 以上来自于百度翻译 以下为原文 Heh, I have no idea . . . I must've read it wrong (or I had it setup differently when I first implemented it). Regardless, I should've gone back to read about this. Thanks for all your help! |
|
|
|
欢迎: 以上来自于百度翻译 以下为原文 Welcome:) |
|
|
|
只有小组成员才能发言,加入小组>>
754个成员聚集在这个小组
加入小组2113 浏览 1 评论
1860 浏览 1 评论
3673 浏览 1 评论
请问可以直接使用来自FX2LP固件的端点向主机FIFO写入数据吗?
1794 浏览 6 评论
1540 浏览 1 评论
CY8C4025LQI在程序中调用函数,通过示波器观察SCL引脚波形,无法将pin0.4(SCL)下拉是什么原因导致?
582浏览 2评论
CYUSB3065焊接到USB3.0 TYPE-B口的焊接触点就无法使用是什么原因导致的?
434浏览 2评论
CX3连接Camera修改分辨率之后,播放器无法播出camera的画面怎么解决?
445浏览 2评论
393浏览 2评论
使用stm32+cyw43438 wifi驱动whd,WHD驱动固件加载失败的原因?
1023浏览 2评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-31 05:01 , Processed in 1.032679 second(s), Total 94, Slave 78 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号