完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
早上好,
我没有找到解决PWM信号中占空比的解决方案。我必须首先测量一个信号的恒定占空比,其次,我必须处理一个具有可变占空比的信号(例如正弦转换为PWM调制)。如何解决这个问题? 以上来自于百度翻译 以下为原文 Good morning, I don't manage to find a solution to measure the duty cycle in a PWM signal . I have to measure firstly a constant duty cycle for one signale, secondly i have to treat a signal with variable duty cycle ( such as a sine turned into a PWM modulation) ? How to solve the problem ? |
|
相关推荐
21个回答
|
|
最简单的方法是使用计时器对给定的内部频率进行计数。计时器的捕获输入将节省实际计数,您可以在连接中断中读出,重新设置计时器。
当使用这些结构中的两个时,你能够测量信号的高时间和低时间。 鲍勃 以上来自于百度翻译 以下为原文 Easiest approach will be to use a timer that counts on a given internal frequency. The capture input of the timer will save the actual count which you can read-out in a connected interrupt where you reset the timer again. When using two of these construct you are able to measure both the high-time and low-time of your signal. Bob |
|
|
|
@鲍伯
我认为PSOC42xx设备是一种更有价值的流量计,它具有分段LCD驱动器,但后来会出现。 PSOC4000设备系列出现在我的脑海中,而它是最低点的PiPoCube(SOIC-8)塞浦路斯提供, 也可从相同的+5伏电压轨道作为霍尔传感器IC。 计划印刷电路板将具有圆形,只有17毫米直径携带4针Molex picoblade(1.25mm)连接器,Halor传感器IC(SOIC-8),PSoC和旁路电容器,以适应流量计硬件。部件将安装在双面印刷电路板的两侧。 在这个特殊的情况下,尺寸很重要,以保持设计简单和便宜。 否则,我想使用更强大的PSoC当然。 我不想使用一个旧的8位PIC的新设计…所以我给PSOC4000家庭一试。 有一个愉快的周末。格雷兹- Markus 以上来自于百度翻译 以下为原文 @Bob I consider the PSoC42xx device for a more valuable flowmeter with segment LCD drive, also but later to come. The PSoC4000 device family came to my mind, while it is the tinyest part with low-pincount (SOIC-8) Cypress offers, also operating from same +5Volt voltage rail as Hall sensor IC. planned PCB will have round shape with only 17mm diameter carrying a 4-Pin Molex picoblade (1.25mm) Conector, Hallsensor IC (SOIC-8), PSoC and bypass capacitors to fit the flowmeter hardware. Parts will be mounted on both sides of a doublesided PCB. Size matters in this particular case, to keep design simple and cheap. Otherwise i would like to use the more powerful PSoC's of course. I dont want to use an old 8-bit PIC for new design....so i give the PSoC4000 family a try. have a nice weekend. greetz - Markus |
|
|
|
像这样的东西吗?D产生高脉冲=PWM输出的周期宽度,其ISR
读取和重置计数器。 设置捕获在边缘,在组件中启用ISR,捕获宽度 PWM的高时间,当ISR火灾和捕获寄存器读取。 分辨率CLK显示= 1美国测量分辨率,16位计数器 可以算一个周期高达~65千克的我们。 我想你可以用D -F代替D和它的逆变器,只是不看这个。 问候,Dana。 以上来自于百度翻译 以下为原文 Something like this ? D produces a high pulse = period width of PWM inout, its ISR reads and resets counter. Set capture on - edge, with ISR enabled in component, capture width of PWM high time when ISR fires and capture register read. Resolution clk show = 1 uS measurement resolution, 16 bit counter can count a period up to ~65K us. I think you can replace D and its inverter with a T F-F, just did not look at this. Regards, Dana. |
|
|
|
可能您可以使用PIN可配置中断(它具有下降沿)。
选择)以获得高时间测量的边缘中断。 问候,Dana。 以上来自于百度翻译 以下为原文 Possibly you could use the pin configurable interrupt (it has a falling edge selection) to get the - edge interrupt for the high time measurement. Regards, Dana. |
|
|
|
一个MOD,将PrimoDISR从D,例如输出的周期指示器下降沿移动。
逆变器/数据输入D。 问候,Dana。 以上来自于百度翻译 以下为原文 One mod, move PeriodISR to falling edge of period indicator from D, eg. the output of inverter / data input to D. Regards, Dana. |
|
|
|
|
|
|
|
你好,Dana,我也需要PWM测量。我会给你的示意图尝试,但我错过了一些适当的计数器配置的详细信息。
也许你甚至有这个小创建者手头项目来分享。Markus 以上来自于百度翻译 以下为原文 hello Dana , i need the PWM measurement too. I will give your schematic a try, but i miss some detail info about the proper Counter configutration. maybe you even have this as little creator project at hand to share. b.r. Markus |
|
|
|
粘贴不起作用
CY8C4013SX-410in生产NPSoC 4000 SOIC-40-85 DATA HealthEDS 0.60美元 以上来自于百度翻译 以下为原文 Paste did not work -
|
||||||||
|
||||||||
你好亲爱的Dana
我给你的建议与中断产生(下降沿)的一个尝试,但只得到可笑的读数。 有什么想法改变,使其工作,像你的解决方案,包括逆变器? 问候Markus 以上来自于百度翻译 以下为原文 hello dear Dana I gave your suggestion for the pin with interrupt generation ( falling edge ) a try, but got only ridiculous readings. any idea what to change to make it work like your solution with inverter included ? regards Markus |
|
|
|
我有一个项目,但不工作。似乎中断不工作的方式
我想,现在就难住了,今天还有其他的承诺。 所以不能在上面工作。 该项目是基于PSoC 3,运行在-030板,所以你将不得不 更改设备,并且应该编译成PSoC 5 OK,或者我想这样。 注意,我修复了项目中所有的重入错误,因此PSoC 3编译W/NO。 错误或警告。 问候,Dana。 脉冲宽度测量 1.6兆字节 以上来自于百度翻译 以下为原文 I have a project, but not working. Seems interrupts not working the way I wanted, so stumped at the moment, and today have other commitments so cannot work on it. The project is PSOC 3 based, runing on -030 board, so you would have to change device, and should compile into PSOC 5 OK, or so I think. Note I fixed all re-entrant errors in project, so on PSOC 3 compiles w / no errors or warnings. Regards, Dana. |
|
|
|
您可能会受到GPIO的干扰,而不是清除。
ISR看看这条线,向底部看—— HTTP://www. CyPress?COM/?APP =论坛和ID ID=2232和;RID=74969 问候,Dana。 以上来自于百度翻译 以下为原文 You may be affected by oring of GPIO for interrupts, and not clearing ISR. Take a look at this thread, towards the bottom - http://www.cypress.com/?app=forum&id=2232&rID=74969 Regards, Dana. |
|
|
|
感谢Dana分享你的项目。
我移植到KIT LP050和一些代码解决方案(和两个ISR)。 但结果仍然不是我想要的方式。: 我不可能改变periodisr到下降沿所。 我想得到LCD的结果是:第一线:D.C.xx.yy % 2NDLYN:频率:XYY YKHZ 你能把我的项目代码贴出来吗? 我的测试信号是TTL 1.02khz固定频率和0.01%~99.9%的可变占空比 从二维旋转霍尔传感器(360°在12bit-pwm_angle分辨率)。 需要的位置变化速度。进一步的计算正确的责任周期值 B.R. Markus 脉冲宽度测量 2.7兆字节 以上来自于百度翻译 以下为原文 thanks Dana for sharing your project. i did porting to kit LP050 and some code workaround (and both ISR). but results are still not the way i want. :-( i have no possiblity to change PeriodISR to falling edge as mentioned. the result i want to get for lcd is:1st line: D.C.xx.yy % 2ndline : Frequency:xx.yy kHz can you pimp my projectcode for doing so ? my test signal is TTL 1.02kHz fixed frequency and 0.01 to 99.90% variable duty cycle from a 2D-rotation hallsensor(360° in 12bit-PWM_angle resolution). need the correct duty-cylcle value for further calculations of position-change speed.. b.r Markus |
|
|
|
D输出输出的周期ISR有效下降。
边缘,周期结束。D高时间,或它的低时间,无论是宽度,== 输入信号的周期。所以你设置周期ISR到上升沿,D和逆变器 其余的都要照看。 问候,Dana。 以上来自于百度翻译 以下为原文 The period ISR taken off the D output, then inverted, is effectively falling edge, end of the period. The D high time, or its low time for that matter, either width, is = period of the input signal. So you set the period ISR to rising edge, the D and inverter take care of the rest. Regards, Dana. |
|
|
|
附件是项目使用PIN ISR连接,只有真正的变化是
在脉冲高下降沿ISR中清除PIN中断。 问候,Dana。 脉冲宽度和周期测量方法 1.6兆字节 以上来自于百度翻译 以下为原文 Attached is project using pin ISR connection, only real change was clearing interrupt of pin in the pulse high falling edge ISR. Regards, Dana. |
|
|
|
附件是一个基本的项目,您可以根据您的需要进行修改。测量脉冲宽度
占空比。它不是在每个输入周期上这样做的,因为它不是纯HW方法。 我选择用一个计时器来做。有两个计时器,你可以按每个周期来做, 或者使用Verilog求解最优解。 问候,Dana。 脉冲宽度测量 2.8兆字节 以上来自于百度翻译 以下为原文 Attached is a basic project you can modify to suit your needs. Measures pulse width and duty cycle. It does this not on every input cycle as it is not a pure HW approach and I chose to do it with one timer. With two timers you could do it on a per cycle basis, or use Verilog for an optimal; solution. Regards, Dana. |
|
|
|
你好亲爱的黛娜,
感谢您审核我的项目并使之有效。 最好的问候Markus 以上来自于百度翻译 以下为原文 hello dear dana, thank for your reviewing my project and make it work. best regards Markus |
|
|
|
@ Markus
你的位置在哪里?我住在德国不来梅附近 鲍勃 以上来自于百度翻译 以下为原文 @Markus Where are you located? I live near Bremen, Germany Bob |
|
|
|
这里是另一种方法,使用一个连续运行的固定功能计数器,
更少的资源,更简单。 问候,Dana。 脉冲宽度和周期测量方法 1.6兆字节 以上来自于百度翻译 以下为原文 Here is another approach, using a continuously running fixed function counter, takes less resources, simpler. Regards, Dana. |
|
|
|
@鲍伯
我住在奥格斯堡附近,在考夫博伊伦工作。 来自巴伐利亚南部的格雷兹。马库斯 以上来自于百度翻译 以下为原文 @Bob I live near Aug***urg and work in Kaufbeuren (Allgäu). greetz from southern Bavaria. Markus |
|
|
|
只有小组成员才能发言,加入小组>>
740个成员聚集在这个小组
加入小组1976 浏览 1 评论
1734 浏览 1 评论
3502 浏览 1 评论
请问可以直接使用来自FX2LP固件的端点向主机FIFO写入数据吗?
1665 浏览 6 评论
1445 浏览 1 评论
CY8C4025LQI在程序中调用函数,通过示波器观察SCL引脚波形,无法将pin0.4(SCL)下拉是什么原因导致?
211浏览 2评论
CYUSB3065焊接到USB3.0 TYPE-B口的焊接触点就无法使用是什么原因导致的?
116浏览 2评论
CX3连接Camera修改分辨率之后,播放器无法播出camera的画面怎么解决?
314浏览 2评论
266浏览 2评论
使用stm32+cyw43438 wifi驱动whd,WHD驱动固件加载失败的原因?
451浏览 2评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-8-16 11:01 , Processed in 1.047928 second(s), Total 83, Slave 77 queries .
Powered by 电子发烧友网
© 2015 www.ws-dc.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号