MarsRoverFirmware icon indicating copy to clipboard operation
MarsRoverFirmware copied to clipboard

Investigate using timer hardware to capture a PWM signal

Open jetkov opened this issue 6 years ago • 3 comments

Measuring a PWM signal period and duty cycle using timers in capture mode should be more precise and efficient than using rising/falling edge interrupts.

jetkov avatar Oct 25 '19 03:10 jetkov

@jetkov I'm looking on taking up another task as I've put a short pause on the current sensor task I was working on. Can you give me some more information about this issue? I'm a bit unsure about how this is used on the rover and would help give me context if I'm able to take it.

FK3wong avatar May 21 '20 02:05 FK3wong

Hey @FK3wong, the purpose of this and issue #19 is to use the STM32 timer functions for measuring duty cycle, and quadrature decoding, instead of using rising/falling edge interrupts and the system timer. This should free up system resources a bit and allow more asynchronous operation: https://www.st.com/content/ccc/resource/training/technical/product_training/c4/1b/56/83/3a/a1/47/64/STM32L4_WDG_TIMERS_GPTIM.pdf/files/STM32L4_WDG_TIMERS_GPTIM.pdf/jcr:content/translations/en.STM32L4_WDG_TIMERS_GPTIM.pdf

jetkov avatar May 22 '20 00:05 jetkov

Possible useful resources: https://www.st.com/resource/en/application_note/dm00236305-generalpurpose-timer-cookbook-for-stm32-microcontrollers-stmicroelectronics.pdf https://www.st.com/content/ccc/resource/training/technical/product_training/c4/1b/56/83/3a/a1/47/64/STM32L4_WDG_TIMERS_GPTIM.pdf/files/STM32L4_WDG_TIMERS_GPTIM.pdf/jcr:content/translations/en.STM32L4_WDG_TIMERS_GPTIM.pdf https://www.st.com/content/ccc/resource/technical/document/user_manual/2f/71/ba/b8/75/54/47/cf/DM00105879.pdf/files/DM00105879.pdf/jcr:content/translations/en.DM00105879.pdf page 868

FK3wong avatar May 22 '20 18:05 FK3wong