S32K344 icu overflow

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

S32K344 icu overflow

262 Views
Neo1096
Contributor I

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.

 

 

0 Kudos
Reply
5 Replies

218 Views
RomanVR
NXP Employee
NXP Employee


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.

Best Regards!
0 Kudos
Reply

192 Views
Neo1096
Contributor I

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

0 Kudos
Reply

147 Views
RomanVR
NXP Employee
NXP Employee

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.

Best Regards!
0 Kudos
Reply

133 Views
Neo1096
Contributor I

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.

0 Kudos
Reply

110 Views
RomanVR
NXP Employee
NXP Employee

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:

RomanVR_2-1735320858785.png

Please let me know if this helps you.

- RomanVR.

Best Regards!
0 Kudos
Reply