完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
你好,
目前我正在做一个项目cy8ckit-042-ble PSoC 4在cybl11573-56lqxi。 我用的是交流电250V,50赫兹电源送进我的过零检测电路。在每个周期的ZCD检测交叉(即只有当波穿过由负转正)。 我把这个电路的输出给PSoC作为中断。 同步测试我控制LED以不同功率水平的ZCD。 观察: 1)在1秒计数器值(无时间中断处理程序执行)应该非常接近50上升沿检测。但我得到它作为100 + 2)该计数器的值时才看到,在该引脚驱动模式中断连接是所有组合如下: A)开漏,驱动高(初始状态低) b)开漏,驱动Low(初始状态高) c)高阻抗数字(初始状态高) d)高阻抗数字(初始状态低) 和柜台仍然0(无时间中断处理程序执行)对所有剩余的驱动模式的排列组合。 3)当我删除链接的男性(男性得到ZCD INTR引脚上的),在4种工作模式中提到的计数器的值是零。 4)当男性在PSoC销男链路连接而另一端,是删除,从ZCD检测电路的O / P,那就是当男性的另一端男性链接是在空气中,计数器的值是50,在上述4种驱动模式。 请你看看能不能提供任何解决方案,中断运行50次1秒的50 Hz的交流电源,以及LED的控制要求。 我正在连接我的工作空间。 谢谢你的建议。 ZCD-PWM.Test.Bull 01.Zip 2兆字节 以上来自于百度翻译 以下为原文 Hello, Currently I am doing a project on PSoC 4 CY8CKIT-042-BLE on CYBL11573-56LQXI. I am using AC Mains 250V, 50 Hz supply and feeding it to my Zero Cross Detector circuit. The ZCD detects the crossing after each cycle (that is, only when the wave crosses from Negative to Positive). I take the output of this circuit and feed it to the PSoC as an Interrupt. To sync and test the ZCD I am controlling an LED with varied power levels. Observations: 1) In 1 second the counter value (no of times Interrupt Handler is executed) should be ideally near 50 for rising edge detection. But I am getting it as 100+ 2) This counter value is seen only when, the drive modes of the pin on which interrupt is connected is the following of all combinations: A) Open Drain, Drives High (Initial State Low) B) Open Drain, Drives Low (Initial State High) C) High Impedance Digital (Initial State High) D) High Impedance Digital (Initial State Low) And the counter remains 0 (no of times Interrupt handler is executed) on all the remaining drive modes permutation and combinations. 3) When I remove the Male to Male Link (Used to get ZCD Intr on the pin) , the counter value in the 4 working modes mentioned goes Zero. 4) When the male to male link on the PSoC pin is connected but removed from the other end, that is , from the ZCD detection ckt o/p, that is when the other end of the male to male link is in the air, the Counter value comes as 50 in the above mentioned 4 drive modes. Please see if you can provide any solution so that the the Interrupt runs 50 times in 1 second for 50 Hz AC Supply, and the LED gets controlled as desired. I am attaching my workspace. Thank you in advice.
|
|
相关推荐
1个回答
|
|
1)你有两个边沿的插针用于中断,如果你想要上升沿,那么你需要把它改为上升沿以进行正确的中断处理。
2)您将想要将引脚驱动模式设置为高阻抗数字状态之一(IDE不阻止不兼容的PIN驱动器与输入模式)。 3)这将是预期的。 4)浮动输入信号将是非常随机和无用的,浮动输入信号不利于诊断。 您忘记将循环计数器CC设置为易失性(因为它在ISR中被修改) LED将永远是从程序中的代码,如果你想LED遵循ZCD,然后只需设置高/低的引脚设置开始。看来你希望它“更新”LED开/关定时基于“电源”变量,所以我会尝试这样做。 为了使LED暗/亮,你需要用ISR中的计数器脉冲LED,或者使用PWM来控制它的亮度。 我做了更改的项目,正如我上面提到的,但我不知道你是想做LED。我想你能明白一旦中断工作正常但。 ZCD-PWM.Test.Cyrj.CaseVo.01.Zip 696.6 K 以上来自于百度翻译 以下为原文 1) You have the pin set for both edges for interrupting, if you want rising edge, then you will need to change it to rising edge for proper interrupt handling. 2) You will want to set the pin drive mode to one of the High Impedance Digital States (The IDE doesn't prevent incompatible pin drive versus input modes). 3) This would be working as expected. 4) Floating input signals will be pretty random and useless, a floating input signal doesn't help with diagnostics. You forgot to set your circular counter cc to be volatile (since it is modified in an ISR) The LED will always be on from the code in the program, if you want the LED to follow the ZCD, then just set it high/low based on the pin setting to start with. It looks like you were wanting it to "update" the LEDs on/off timing based on a "Power" variable, so I will attempt to do that To have the LED dim/brighten, you will need to pulse the LED with either the counter in the ISR, or using a PWM to control it's brightness. I made changes to the project as I mentioned above, but I am not sure what you were wanting the LED to do. I would assume you can figure that out once the ISR is working properly however.
|
|
|
|
只有小组成员才能发言,加入小组>>
754个成员聚集在这个小组
加入小组2110 浏览 1 评论
1858 浏览 1 评论
3673 浏览 1 评论
请问可以直接使用来自FX2LP固件的端点向主机FIFO写入数据吗?
1791 浏览 6 评论
1540 浏览 1 评论
CY8C4025LQI在程序中调用函数,通过示波器观察SCL引脚波形,无法将pin0.4(SCL)下拉是什么原因导致?
575浏览 2评论
CYUSB3065焊接到USB3.0 TYPE-B口的焊接触点就无法使用是什么原因导致的?
428浏览 2评论
CX3连接Camera修改分辨率之后,播放器无法播出camera的画面怎么解决?
440浏览 2评论
390浏览 2评论
使用stm32+cyw43438 wifi驱动whd,WHD驱动固件加载失败的原因?
922浏览 2评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-27 02:20 , Processed in 0.988089 second(s), Total 78, Slave 62 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号