Hi,
I am trying IC_PAL module of S32SDK with S32K144 MCU.
I am having difficulties:
Can someone give me a hand?
Thanks. I looked at FTM_IC usage in that example you mentioned and added the FTM_IC component to the existing work project which is based on LPSPI_DMA sample. The LPSPI_DMA sample loop does 1000 xfers (each size is 16B) and checks the result.
I added calls like below:
before entering the SPI test loop. Everything seems fine here.
However, if I comment out step 3 and 4 so that to keep FTM_IC running, I then noticed the SPI test loop never ends, at least for more than 400 loops. It does end if loop count is 350. I am guessing the FTM component initialization might have some interferences with the LPSPI DMA sample but not sure what it is. Things might be fine if the SPI xfer count is small... but it will happen if there are many xfers (such as 375 times).
For your reference, I am using fixed frequency configuration as my FTM_IC clock source as I want an effective 1Mhz clock. I have overflow interrupt enabled but didn't do anything meaningful yet.
Do you experience the same behavior there?
Some updates on FTM_IC component's strange behavior described above: it seems that if I disable the "overflow interrupt", the strange behavior won't happen. If I enable the overflow ISR, it will happen when the # of xfers are large enough (probably longer than the interval needed for an overflow to occur?).
Anyway, @Robin_Shen please see if the FTM_IC component's overflow ISR is properly implemented?
Sorry for the delay!
If you enabled the Timer overflow interrupt, you may need to input the callback function. Otherwise it will run into faultISR.
But the FTM_IC driver seems does not count the times of overflow. FTM_DRV_InputCaptureHandler only counts the overflow situation once.
Here is the topic once discussed: The issue about FTM input capture for S32K114 and used SDK configuration
Robin,
Not sure I can catch your explanations.
Here I used an empty callback like:
void ic_pal1_cb(ic_event_t ev, void*p){
}
and referred to it in ProcessorExpert's configuration for FTM1 channel#0. With this callback and "timer overflow interrupt" optioin enabled, I still get the strange behavior as described above.
I am wondering if this is the right way to handle the timer overflow interrupt? I assume the callback is called from an ISR defined by the IC_PAL driver which shall manage the ISR flags correctly...
Regards,
Hi yfliu,
Continuous Measurement can be checked for some of the Signal Measurement Mode.
I did not find the call back for counter overflow event.
Would you please have a look at ftm_signal_measurement_s32k144 SDK example. Check whether the ftm_ic meet requirements.
Best Regards,
Robin
-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" 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.
-------------------------------------------------------------------------------