1 Reply Latest reply on Jan 24, 2018 6:24 AM by aceh

    Issue with reading a PWM signal

    schuyler.prm_3093866

      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;