完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
嘿,大家好,
我正在构建一个系统,能够在一段时间内休眠数小时/天/周,并在传感器的低电压输入上醒来,并给出示例项目“进入Hibernate模式和使用PICU唤醒”,看起来我应该能够做到这一点。我甚至改变了示例项目引脚与我的传感器接口,我可以让它进入/退出休眠模式与他们。我唯一的问题是我无法理解这个代码是如何工作的。我对C很好,整个嵌入式系统IDE都不太好。在示例项目中,FravaHibernate最初被设置为0,然后在项目的(1)循环中,如果FrasiHibernate为非零,则它将进入休眠模式。但我看不出这是怎么回事。有人能解释一下吗?奇怪的是,当我只是把粘贴的东西从示例项目复制到一个新的项目中时,*我的两个引脚——即我分配给休眠引脚的一个,连接到休眠中断,以及分配给唤醒连接到唤醒中断的一个引脚——似乎把设备放进去。休眠模式,也不会唤醒它。我肯定有一些中断目标配置,或者某处,我丢失了,但是我找不到。任何帮助将不胜感激!编辑:和一个额外的问题;当我将示例项目编程到CY8CITK-01,“PSoC开发工具包”时,它是按预期的方式工作的。然而,当我把它编程到CY8CITK-014 PSoC 5 FrimtTouk启动工具包上时,将Hibernate PIN改为FixTouter的LoNE按钮(15i或其他东西,我相信),它不会注册Hibernate按钮按下。我假设这是因为FixTouter的按钮使用了稍微不同的系统(可能是电压降而不是电压尖峰)。我不知道,我没有电路背景,但谁能告诉我它是如何不同的,我需要做些什么来克服它呢?甚至更好的是,有人能指点我在哪里能找到每块板上的按钮的规格吗?我浏览了他们的文档,似乎找不到相关的东西。 以上来自于百度翻译 以下为原文 Hey all, I'm building a system that should be able to hibernate for hours/days/weeks at a time and wake up on a low-voltage input from a sensor, and given the example project "Enter Hibernate Mode and Wakeup Using PICU" it looks like I should be able to do that. I've even changed the example project pinout to interface with my sensors, and I can get it to enter/exit hibernate mode with them. My only problem is that I just CANNOT figure out how this code works. I'm pretty good with C, less so with this entire embedded system IDE. In the example project, FLAG_HIBERNATE is initially set to 0, and then in the project's while(1) loop, it will enter hibernate mode if FLAG_HIBERNATE is non-zero. But I just don't see where that happens. Can someone explain this? Curiously, when I just copy-pasted everything from the example project into a new one, *BOTH* of my pins -- the one I have assigned to the hibernate pin connected to the hibernate interrupt, as well as the one assigned to the wakeup pin connected to the wakeup interrupt -- seem to put the device into hibernate mode, and neither will wake it up. I'm sure there's some interrupt target configuration, or something, somewhere, that I'm missing, but I can't find it. Any help would be greatly appreciated! Edit: and a bonus question; when I program the example project onto a CY8CKIT-001, the "PSoC development kit," it works as intended. However, when I program it onto a CY8CKIT-014 PSoC 5 FirstTouch Starter Kit, and change the hibernate pin to line up with the FirstTouch's lone button (15_3 or something, I believe), it won't register the hibernate button press. My assumption is that this is because the FirstTouch's button uses a slightly different system (maybe a voltage drop instead of voltage spike? I don't know; I don't have a circuits background), but can anyone tell me how it is different and what I would need to do to overcome that? OR even better, could someone point me towards where I can find the specifications for the buttons on each board? I've looked through the documentation that came with them and can't seem to find anything pertinent. |
|
相关推荐
5个回答
|
|
如果你打开冬眠。C(ISR文件)&;Wakeup,C文件,你可以发现,在中断服务程序中部分“flag_hibernate”被设置为分别为1和0。
所有的事情,你复制粘贴到另一个项目是什么?如果我们能调试一下这个新项目,那就更好了。 当做, 基肖尔 以上来自于百度翻译 以下为原文 If you open Hibernate.c (ISR file) & Wakeup.c files, you can find that in the Interrupt Service Routine section "FLAG_HIBERNATE" is being set to 1 and 0 respectively. What are all the things you copy pasted into another project? It would be better if we could debug the new project. Regards, Kishore. |
|
|
|
关于CY8CKIT-1001和CY8CKIT-014的开关配置之间的差异问题,是的,它们都是不同的。
在CY8CKIT-1001中,如果您按下开关,引脚将连接到地上。所以我们需要在内部拉动。在CY8CKIT-014,如果您按下开关,引脚将连接到VDD(3.3V)。所以我们需要在内部把它拉下来。 如果将GPIOS的配置更改为下拉,则应该工作。 当做, 基肖尔 以上来自于百度翻译 以下为原文 Regarding your question on difference between Switch configurations of CY8CKIT-001 & CY8CKIT-014, yes they both are different. In CY8CKIT-001, if you press the switch, Pin will be connected to Ground. So we need to pull it up internally. In CY8CKIT-014, if you press the switch, Pin will be connected to Vdd (3.3V). So we need to pull it down internally. If you change the configuration of the GPIOs to Pull downs, it should work. Regards, Kishore. |
|
|
|
您可以参考以下链接中的示意图:
CY8CKIT-014-GT;HTTP://www. CyPress?COM/?DOCID=27015 CY8CKIT-1001-GT;HTTP://www. CyPress?COM/?DOCID=26945 当做, 基肖尔 以上来自于百度翻译 以下为原文 You can refer to the Schematics in the following links: CY8CKIT-014 -> http://www.cypress.com/?docID=27015 CY8CKIT-001 -> http://www.cypress.com/?docID=26945 Regards, Kishore. |
|
|
|
你好,基肖尔,
非常感谢你的帮助。我知道有一些中断的配置我错过了,现在我看到它在哪里。以前,我只复制了.Me.c文件和TopDebug .CysCH中的所有内容;我没有想到组件在他们的.c文件中可能有有用的配置。现在我在我的程序的Hibernate .c和唤醒.c文件中有相关的代码,它就像这个例子一样工作。 现在有一个后续问题: 在我看来,这样做的方法是:当任何一个引脚都有中断的电压时,就会发生两件事。第一局唤醒从休眠(如果是在Hibernate)下,相应的hibernate_interrupt函数运行。这似乎是因为董事会是在休眠模式,并按与Hibernate中断相关的按钮,会被唤醒了,flag_hibernate整数集(再次)1。它贯穿于项目的while循环,一旦进入如果(flag_hibernate)分支,将自己睡了。 那么,首先,我在那个假设下是正确的吗?其次,它是可能的配置板,只有特定的中断引脚将它从冬眠中醒来? 至于我的其他问题了,谢谢你的解释,在过去的几天我做了一点研究,如何将这些按钮实际上是工作,所以你的答案有道理,这些关系是很有帮助的。 -杰夫 以上来自于百度翻译 以下为原文 Hello Kishore, Thank you very much for your help. I KNEW there was some sort of interrupt configuration I was missing, and now I see where it is. Before, I had only copied over the main.c file and everything in the TopDesign.cysch; I hadn't thought that components could have useful configurations in their .c files. Now that I have the relevant code in my program's Hibernate.c and Wakeup.c files, it's working just like the example. Now here's a follow-up question: It looks to me like the way this works is: when there's a voltage on either of the pins configured for interrupts, TWO THINGS HAPPEN. First the board wakes up from hibernate (if it was in hibernate) and next, the corresponding Hibernate_Interrupt function runs. This seems right because when the board is in hibernate mode, and you press the button associated with the Hibernate interrupt, the board gets woken up and the FLAG_HIBERNATE integer is set (again) to 1. It runs through the program's while loop once and enters the if (FLAG_HIBERNATE) branch and puts itself to sleep again. So first of all, am I correct in that assumption? And second of all, is it possible to configure the board such that only CERTAIN interrupt pins will wake it from hibernate? As for my other question, thank you for your explanation -- in the past couple days I've done a bit of research as to how these buttons are actually working, so your answers make sense, and those links were quite helpful. -Jeff |
|
|
|
嗨,杰夫,
这个项目有2个中断。一个将PSoC置于休眠状态,另一个用于唤醒。 在与Hibernate关联的ISR中,在中断时旗标HiberHibernate被设置为1。 在与Wakeup相关联的ISR中,在中断时将旗标FigHiHiBiNATE重置(设置为0)。 中断设置为下降沿。这是因为引脚被设置为电阻拔起,默认情况下会很高。当开关被按下时,引脚连接到接地,因此检测到下降沿(从高到低)。如果按下Hibernate引脚,则ISR中的标志设置为1,导致设备将休眠。这是在C。当设备已经处于休眠状态时,如果再次按下Hibernate PIN,则标志仍然设置为1,因此LED将只切换一次,然后返回休眠。 要唤醒PSoC,唤醒引脚必须被按下。这将重置标志,设备将处于活动模式,直到再次按下Hibernate引脚。 在第一触控套件中,将“中断类型”设置为“下降沿”和“驱动模式”为“电阻下拉”。 您可以通过配置PSoC中的“任意”PIN来从Hibernate唤醒系统。也有睡眠模式,这将唤醒从几个其他来源除了PICU类似于从地址匹配在I2C,睡眠定时器等。 当做, DASG 以上来自于百度翻译 以下为原文 Hi Jeff, There are 2 interrupts used in the project. One to put the PSoC to Hibernate, and the other for Wakeup. In the ISR associated with Hibernate, the flag FLAG_HIBERNATE is set to 1 upon interrupt. In the ISR associated with Wakeup, the flag FLAG_HIBERNATE is reset (set to 0) upon interrupt. The interrupts are set to falling edge. This is because the pins are set to Resistive pull up and will be High by default. When the switch is pressed, the pin is connected to ground, hence there is a falling edge detected (from high to low). The flag is set to 1 in ISR if Hibernate pin is pressed, resulting in the device going to hibernate. This is done in the main.c . When the device is already in hibernate, if Hibernate pin is pressed again, the flag is still set to 1, hence the LED will toggle only once and then go back to hibernate. To wake up the PSoC, the Wakeup pin must be pressed. This will reset the flag and the device will be in active mode till the hibernate pin is pressed again. In First touch kit, set the "Interrupt type" in the Pin configuration box to "falling edge" and the "Drive Mode" to "Resistive pull down". You can use PICU by configuring "any" pin available in PSoC to wake up the system from hibernate. There is Sleep mode available too which will wake up from several other sources apart from PICU like Slave Address match in I2C, Sleep Timer, etc. Regards, dasg |
|
|
|
只有小组成员才能发言,加入小组>>
754个成员聚集在这个小组
加入小组2101 浏览 1 评论
1848 浏览 1 评论
3666 浏览 1 评论
请问可以直接使用来自FX2LP固件的端点向主机FIFO写入数据吗?
1783 浏览 6 评论
1533 浏览 1 评论
CY8C4025LQI在程序中调用函数,通过示波器观察SCL引脚波形,无法将pin0.4(SCL)下拉是什么原因导致?
564浏览 2评论
CYUSB3065焊接到USB3.0 TYPE-B口的焊接触点就无法使用是什么原因导致的?
416浏览 2评论
CX3连接Camera修改分辨率之后,播放器无法播出camera的画面怎么解决?
434浏览 2评论
380浏览 2评论
使用stm32+cyw43438 wifi驱动whd,WHD驱动固件加载失败的原因?
909浏览 2评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-21 03:55 , Processed in 1.442025 second(s), Total 85, Slave 69 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号