Cypress技术论坛
直播中

杨雨凡

7年用户 135经验值
私信 关注
[问答]

读取PWM信号ICCP值没有保持恒定

我是一个使用SK-FM3-64 PMC1-M9AF132L进行开发的大学生,我想在AN03上读取一个5V的PWM信号。信号的周期为40s。
我正在打印ICCP寄存器的值,它对应于正在读取的PWM信号的十六进制值。现在,即使输入引脚上的信号是稳定的,ICCP值从0x0递增到0x0190,然后以每秒0x01的速率回落到0x0。我不明白为什么ICCP值正在增长和缩小,而不是保持恒定,因为PWM信号没有改变。
下面是我输入和多功能定时器的设置:
FM3YMFT0AICU-GT;ICFS10= 0x0;
FM3YMFT0SICU-GT;ICSA10= 0x00 04;
FM3YMFT0YFRT-GT;TCSA0= 0x00 60;
FM3YMFT0YFRT-GT;TCSB0= 0x0;
FM3YMFT0YFRT-GT;TCCP0= 0x0190;

以上来自于百度翻译


     以下为原文
  I'm a college student working on some development using the SK-FM3-64PMC1-MB9AF132L. I'm trying to read a 5V PWM signal on AN03. The signal has a period of 40us.

I'm printing the value of the ICCP register, which corresponds to the hex value of the PWM signal being read. Now, even though the signal on the input pin is stable, the ICCP value incrementally counts from 0x0 to 0x0190 and then back down to 0x0 at a rate of ~0x001 per second. I do not understand why the ICCP value is growing and shrinking instead of staying constant because the PWM signal is not changing.

Here is the setup I have for the input and multifunction timer:

    FM3_MFT0_ICU->ICFS10 = 0x0;   
    FM3_MFT0_ICU->ICSA10 = 0x0004;  
    FM3_MFT0_FRT->TCSA0 = 0x0060;
    FM3_MFT0_FRT->TCSB0 = 0x0;      
    FM3_MFT0_FRT->TCCP0 = 0x0190;   

回帖(1)

秦婷婷

2018-11-12 11:56:32
你好,
对不起,迟到了。
正如你所说的PIN AN03,你有没有禁用PIN的模拟功能?看。FM3YGPIO-G.ADE寄存器。
FM3YMFT0YFRT-GT;TCSA0= 0x060将停止FRT->应该是0x020,我猜。
可能附上的例子可以用作参考(密码是柏树)。它是一种基于中断的频率测量。
它是为不同的MCU编写的,但是MFT是相同的。
亲切的问候,
阿希姆
M9BFXXXXMFTTIICUQIQRYFQQCNT-V12Y-CyPress
101.3 K

以上来自于百度翻译


     以下为原文
  Hi,
 
Sorry for late response.
 
As you call the pin AN03, have you disabled the analog functions of the pin? See. FM3_GPIO->ADE register.
 
FM3_MFT0_FRT->TCSA0 = 0x0060 will stop FRT -> should be 0x0020 I guess.
 
Probably attached example can be used as reference (password is cypress). It is an interrupt based frequency measurement.
It was written for a different MCU, but the MFT is identical.
 
kind regards,
Achim


举报

更多回帖

发帖
×
20
完善资料,
赚取积分