完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
我要一个大概的时间在秒一个例程之间的电话。
我不需要很多的准确性和我没有任何多余的这个小功能UDB中。我有一个功能,可以从几秒到一小时或更多的时间来完成,需要一个总的测量时间,已经过去了。 我试着在包括时间C使用clock()和time()功能。但这些函数始终返回1表示“错误”。 有什么办法让这些功能的工作吗? 我可以用手臂tictimer不知何故? 现在我使用FF定时器,至少不使用任何UDB中但我想用clock()。 以上来自于百度翻译 以下为原文 I want an approximate time in seconds between 2 calls of a routine. I don't need a lot of accuracy and I don't have any UDBs to spare for this trivial function. I have a function that can take from a few seconds to an hour or more of time to complete and want a gross measurement of the time that has passed by. I tried using the clock() and the time() functions in C after including time.h but these functions always return -1 indicating an "error". Is there some way to get these functions to work? Can I use the ARM TICTIMER somehow? For now I'm using a FF timer which at least doesn't use any UDBs but I would like to just use clock(). |
|
相关推荐
10个回答
|
|
一个带有中断计数的ARMISCORM一个变量的解决方案。
HTTP://www. CyPress?COM/?RID=38267 AN51460 一些DSO范围扩展了处理长期事件的时基, 所以用一个引脚来触发启动,并且它的另一个边停止测量。 问候,Dana。 以上来自于百度翻译 以下为原文 ARM Systick with an interrupt incing a count variable one solution. http://www.cypress.com/?rID=38267 AN54460 Some DSO scopes have extended time bases to handle long events, so use a pin to trigger start, and its other edge to stop to measure. Regards, Dana. |
|
|
|
这可能也有帮助。
HTTP://www. CyPress?COM/?APP =论坛和ID ID=2233和;RID=49587 你可以使用一个插销和一个外部周期计数器。 它必须是一个倒数计数器或具有这种能力。 问候,Dana。 以上来自于百度翻译 以下为原文 This might help as well - http://www.cypress.com/?app=forum&id=2233&rID=49587 You could alwyas use a pin and and gate an external period counter. It would have to be a reciprocal counter or have that capability. Regards, Dana. |
|
|
|
如果你有备用的别针。你可以在一个例程上发送一个脉冲,并在另一个例程上发送2个脉冲。然后你可以使用一个CRO捕捉脉冲来检查它们之间的时间。并且通过在较长时间内记录脉冲来检查变化。
以上来自于百度翻译 以下为原文 If you have a spare pin. You can sent one pulse on one routine and send 2 pulses on the other. Then you can use a CRO to capture the pulse to check the time between them. and also check for variation by recording the pulse over a longer time as well. |
|
|
|
检查你的CRO(DSO),大多数,不是全部,有最大扫描速率lt;10秒/ div,
因此不能测量1小时(3600秒)/360 dVIEW事件。在那 情况下,你最好用数据记录器,或者使用另一个PSoC。 测量延长周期。任何PSoC都能做到这一点。 如果我没有弄错的话,HLI在前一段时间贴了一个倒数计数器。 在论坛上,这可能是长期测量系统的基础。 在互惠计数器附加信息。 问候,Dana。 计数器9Zip 13.5兆字节 以上来自于百度翻译 以下为原文 Check your CRO (DSO), most, not all, have max sweep rates < 10 sec/div, therefore cannot measure 1 hour (3600 sec)/360 dvision) events. In that case you would be better off with a datalogger, or use another psoc to measure extended periods. Any PSOC could do that. If I am not mistaken hli posted a reciprocal frequency counter some time ago on the forum, that could be the basis of a long period measurement system. Attached info on reciprocal counters. Regards, Dana.
|
|
|
|
愚蠢的我。我总是认为时间在第二个范围内。
以上来自于百度翻译 以下为原文 Silly me. I always think time being task in sub-second range. |
|
|
|
很好的文档,虽然阅读它们花了我一些时间。
鲍勃 以上来自于百度翻译 以下为原文 Nice documentation, although reading them all took me some time. Bob |
|
|
|
你也可以使用计时器。时钟在1Hz,使用“全局信号的组成部分,它可以给你一个PPS。然后,您可以启动和停止计时器时,要看所用的时间在几秒钟内直接。
或者你把32 kHz晶体使用RTC组件(但它没有时间概念,UNIX,所以你需要自己进行计算)。 以上来自于百度翻译 以下为原文 You can also use a timer. To clock it at 1 Hz, use a 'global signal' component, which can give you a PPS. Then you can start and stop the timer whenever want, and read the elapsed time in seconds directly. Or you attach a 32 kHz crystal and use the RTC component (but it doesn't have the notion of unix time, so you need to do the calculations on your own). |
|
|
|
我想他是出于UDB中.........也许SysTick如果那不是已经在使用。
问候,Dana。 以上来自于百度翻译 以下为原文 I think he is out of UDBs.........maybe systick if thats not already in use. Regards, Dana. |
|
|
|
谢谢大家的回答!
但我找不到任何真正的文件在SysTick定时器。 我知道这是手臂的一部分,似乎有几apicalls但不能找到描述。 HTTP://www. CyPress?COM/?44506有一个docID =项目和一些其他的链接,如cy_boot项目文件?但这恰好有1个参考实质不描述所有的API。 几个链接给我带来了HTTP://www. CyPress?应用=论坛&;ID = 2233 &;摆脱= 49587但这是另一个家伙试图获得实质工作…不确定他曾经做过。 在SysTick的armdocumention:http://infocenter.arm.com/help/index.jsp?主题= / com.arm.doc.dai0179b/ar01s02s08.html这是好事,但没有给出具体如何选择时钟和各种事物的选择和它是如何开始的。 我想我只是读systick_current登记在0xe000e018开始减,最后从价值。我是一个32位数字,所以要有足够的分辨率。 我不需要一个中断计数-我需要这个计数器在1kHz的ILO跑步给了我1000个多小时。的ilois - 55% / 100%并不是很准确,我想可能是足够接近。我也用SysTick中断使1秒中断+ / -百分之三的精度,然后数秒。 我完全失去了UDBs(关于发布,以及),这需要一个百分百的CPU功能。再次,我不需要太多的精度-只是一个粗略的挂钟#。 以上来自于百度翻译 以下为原文 Thanks for the answers guys! But I can't seem to find any real documentation on the systick timer. I know it is part of the ARM and there appears to be a few API calls but I can't find the description. http://www.cypress.com/?docID=44506 has a sample project and a few other links to documents like the cy_boot project? But that has exactly 1 reference to systic and does not describe the API at all. Several links bring me http://www.cypress.com/?app=forum&id=2233&rID=49587 but this is another guy trying to get the systic to work... not sure he ever did. The ARM documention on SysTick is:http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dai0179b/ar01s02s08.html which is good but doesn't give the specifics of how to select the clock and what various things are selected and how to start it. I think I can just read the systick_current register at 0xE000E018 at the start and subtract that from the value at the end. I assume it's a 32-bit number so should have plenty of resolution. I shouldn't need an interrupt to count - I just need this counter running on the 1Khz ILO gives me over 1000 hours. The ILO is -55%/+100% which isn't quite as accurate as I'd like but probably close enough. I could also use the systick interrupt to make a 1 sec interrupt with +/-3% accuracy and then count seconds with that. I am completely out of UDBs (about to post about that as well) so this needs to be a 100% CPU function. Again, I don't need much accuracy - just a rough wall-clock #. |
|
|
|
这应该有帮助。
HTTP://www. CyPress?COM/?APP =论坛和ID ID=2492和;RID=85773 问候,Dana。 以上来自于百度翻译 以下为原文 This should help - http://www.cypress.com/?app=forum&id=2492&rID=85773 Regards, Dana. |
|
|
|
只有小组成员才能发言,加入小组>>
752个成员聚集在这个小组
加入小组2074 浏览 1 评论
1829 浏览 1 评论
3643 浏览 1 评论
请问可以直接使用来自FX2LP固件的端点向主机FIFO写入数据吗?
1765 浏览 6 评论
1517 浏览 1 评论
CY8C4025LQI在程序中调用函数,通过示波器观察SCL引脚波形,无法将pin0.4(SCL)下拉是什么原因导致?
513浏览 2评论
CYUSB3065焊接到USB3.0 TYPE-B口的焊接触点就无法使用是什么原因导致的?
364浏览 2评论
CX3连接Camera修改分辨率之后,播放器无法播出camera的画面怎么解决?
413浏览 2评论
360浏览 2评论
使用stm32+cyw43438 wifi驱动whd,WHD驱动固件加载失败的原因?
865浏览 2评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-27 20:30 , Processed in 1.038968 second(s), Total 99, Slave 82 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号