Hello
I‘m programming my S32k146/144 board with FTM function and I found a ridiculous issue. I used a data array to record the free running FTM chanle counter. The data stream indicated that the counter occasionally updates to a random number instead of following its normal cyclic way. I tested all FTM chanles with almost the same code on both S32K144 and S32K146,the error perfectly repeated. Beacause the testing code is very simple, I am quite confused. I post the code and result here. Is there anyone could tell me what happed.
Thanks Robin
I have checked my code and confirmed your conclusion. I was not sure about setting FTM IRQs and capturing wave singnal correctly . So I launched this test .But I didn't notice the updating sittuation of the recording array and made a mistake. Now I can continue working with my signal capturing happily.
Thank your very much.
Sincerely
I clicked Resume and then Suspend during debug.
I observed the continuity of the values in the IOC_CH0[] array. I only saw a large difference between IOC_CH0[j] and IOC_CH0[j+1].
This is expected, as FTM0->CNT is only updated to IOC_CH0[j], and the value in IOC_CH0[j+1] has not yet been updated.
Thank you Robin
I tried your advice this morning. It is a pitty that the problem remains. I used a LED Toggling schem to indicating the problem and let the code run independently. (Only power connected to the testing board.)The LED blinked randomly.
Here I post my whole project. Please check it. Thank you very much.
Best Regards
Hi
It looks like you're observing the data array during debug.
Does this happen when the program is run without debugging? By comparing the difference between the arrays, if the difference exceeds 143, flip the GPIO pin to observe whether this abnormal jumping occurs.
If the issue is related to debugging, it is recommended to check section 47.5.28 Debug mode of S32K1XXRM.
Best Regards,
Robin
-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "ACCEPT AS SOLUTION" button. Thank you!
- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------