Input capture with hardware timer #83693
-
Can a general purpose hardware timer be used for input capture? For example, MIMXRT1166 has a number of general purpose hardware timers which have associated input capture pins, and I'd like to use one of them for pulse counting. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hi @rtborg , If not, I do not see a good option today for input capture on the RT1160. Zephyr's PWM driver has the CONFIG_PWM_CAPTURE feature, but I do not see this feature implemented in any PWM driver supported on the RT1160. And I see this RFC #71618 to add input capture to the Counter API, but today the Counter API seems lacking for input capture. If the Zephyr APIs do not work for you, another option is to call the MCUXpresso SDK APIs from your app, and configure a HW timer for input capture. NXP has a blog Zephyr Software Code Reuse with NXP MCUXpresso SDK, and an example Using MCUXpresso SDK drivers in Zephyr app. Let us know what you decide. Best regards |
Beta Was this translation helpful? Give feedback.
Hi @rtborg ,
Could you use the Quadrature Decoder (QDEC) driver for this? I see the QDEC sample has an overlay for the MIMXRT1050-EVK board, and the RT1160 devices share the same QDEC peripheral.
If not, I do not see a good option today for input capture on the RT1160. Zephyr's PWM driver has the CONFIG_PWM_CAPTURE feature, but I do not see this feature implemented in any PWM driver supported on the RT1160. And I see this RFC #71618 to add input capture to the Counter API, but today the Counter API seems lacking for input capture.
If the Zephyr APIs do not work for you, another option is to call the MCUXpresso SDK APIs from your app, and configure a HW timer for input capture. NXP has a b…