I am trying to implement quad decoder on the FTM module to count on the FTM counter whenever a rising or falling edge happens on either channel A or B. I have read that I need to set the BDM Mode in order to use the FTM counter. I believe I have set this properly however my counter always reads 0 and view the registers during debug it appears that the BDM is still set to 0. Below is my code for reference.
Thanks
Hello Jake,
Which chip do you used ?
And how about these functions ""FTM_Init() , they are write by yourself or from which lib?
And have you enable the FTM clock, also check whether start the FTM .
BR
Alice
Hi Alice,
Thanks for the reply. I am using a TWR-K65F180M and SDKv2.0. The FTM_Init() comes from the SDK library and should enable to FTM clock. I have added the FTM_StartTimer function to start the timer and the counter reads 77.
Jake
Hello Jake,
I only test the BDM mode , when i configure it , i check the register FTM2_CONF -> BDMMODE,
it is 3 , on you side , does it 0?
On our first information , you said "my counter always reads 0" , while last information , you said"the counter reads 77"
So i have some confused , could you please send the main file not the screenshot , and also take a screenshot
about the error register , what the right data is should be ? I will debug it on my side .
BR
ALice