ICU this mining cycle overflow function, is there a routine, is it necessary to enable something at the time of initialization? I added this function but did not enter the callback function when overflow. The overflow mode is a continuous high level given by another pin, connected to the detection pin of the icu with a jumper.
Hi @Neo1096
As I can infer from the attached images, you are using ICU Mode set to "Signal Measurement". However, when enabling "IcuOverflowNotification" in this mode, the notification will only be triggered once a measurement completes. Since you are introducing a continuous high-level signal, this notification won't trigger because your ICU is configured to measure on rising edges.
For further details on the ICU Driver and the use of the Icu Overflow Notification, please refer to section 4.99 (Parameter IcuOverflowNotificationApi), in the ICU User Manual. You can find the manual at the following location on your computer:
C:\NXP\S32DS.3.5\S32DS\software\PlatformSDK_S32K3\RTD\Icu_TS_T40D34M50I0R0\doc
Please let me know if you have more doubts.
- RomanVR.
Now I want to measure the period of the incremental encoder, because at low speeds, checking the number of encoder pulses is not applicable, so I want to calculate this period value
But this period value seems to be the maximum can only be taken 16 bits, the period is slightly longer can only use the overflow way to calculate the period? What if it is an overflow and lcuOverflowNotification cannot be used?
Or is there a routine or method for calculating the encoder pulse period? Consider the case where the pulse cycle time is longer.
AN13767 this document also provides only the method of calculating the number of pulses, when the cycle needs to be calculated at low speed?
thanks
Hi @Neo1096
To measure the period of an encoder you can use ICU Mode set to Edge Detection in order to detect any edges of your encoder signal not worrying if there has been an overflow on the timer, since this functionality allows you to configure a notification when an edge is detected, calling a user function to do the necessary processing.
You can use the example "Emios_Icu_Ip_BlinkLed_S32K344" available on the RTDs to test this functionality and see if it matches your application.
Please let me know if you have more doubts.
- RomanVR.
I need to know the pulse cycle time, not when the edge change was triggered. How do I know how long the pulse period is with edge detection?
I need to run in the mode of measuring cycles, and need to know how many times the counter overflows while measuring a full cycle, rather than preventing overflows.
Does the S32K312 not have this common feature, or does the S32 series of chips not support this feature? If not, please let me know, instead of implementing the function I need in some strange way, thank you.
Hi @Neo1096
Sorry for the misunderstanding, and thank you for clarifying your needs.
If my understanding is correct, you want to measure the time of a high or low pulse, therefore you can configure the ICU Mode set as "Signal Measurement" and set "IcuSignalMeasurementProperty" to "ICU HIGH TIME" or "ICU LOW TIME" as shown in the image below:
Please let me know if this helps you.
- RomanVR.