Issue with reading a PWM signal

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

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;   

0 Likes
1 Solution
lock attach
Attachments are accessible only for community members.
AchimE_41
Employee
Employee
10 sign-ins 5 sign-ins First comment on KBA

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

View solution in original post

0 Likes
1 Reply
lock attach
Attachments are accessible only for community members.
AchimE_41
Employee
Employee
10 sign-ins 5 sign-ins First comment on KBA

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

0 Likes