STM32 Time capture with channel 3
Posted: Sat Nov 09, 2013 6:55 am
Hi all,
for my project with STM32F105 chip I needed input capture to measure CPPM stream from radio on channel 3 of one of the general purpose timers.
ICU driver is meant to measure duty cycle and period of PWM signal, and according to the datasheet only first two channels can be used for this (look for Filtered Timer Input 1/2). However, I wanted to reuse the ICU code and just allow it to have the third channel.
Here is the code. Just channel 3 for now, channel 4 would be very similar.
I think it is a question mainly for Giovanni - is it ok to have the driver with different functionality for different channels? I.e. PWM measure (CH1 and CH2) vs input capture only (CH3 and CH4)?
for my project with STM32F105 chip I needed input capture to measure CPPM stream from radio on channel 3 of one of the general purpose timers.
ICU driver is meant to measure duty cycle and period of PWM signal, and according to the datasheet only first two channels can be used for this (look for Filtered Timer Input 1/2). However, I wanted to reuse the ICU code and just allow it to have the third channel.
Here is the code. Just channel 3 for now, channel 4 would be very similar.
I think it is a question mainly for Giovanni - is it ok to have the driver with different functionality for different channels? I.e. PWM measure (CH1 and CH2) vs input capture only (CH3 and CH4)?