TIM1 as System Timer?
Posted: Thu Jan 28, 2016 9:45 pm
Hello, and thanks in advance for this great software. I teach robotics and this is my first attempt at using a RTOS with students. I'm coming from the Arduino world where everything is busy wait. Also new to ARM, so I'm facing a few questions that are not so clear by looking at the doxygen / source code.
I'm using a STM32F103C8T6 MCU (aka $2.5 dev board from aliexpress, aka "the blue board with the yellow headers", aka "Bluepill / Redpill") to build a robot. I'm using TIM2, 3 and 4 for PWM and quadrature encoder inputs, so I only have TIM1 left.
First question... I see that the only valid values for STM32_ST_USE_TIMER are 2, 3 and 4. But because I'm using the LQFP48 package and a bunch of other peripherals, TIM1 is my only leftover timer. Is there any way to use TIM1?
Which brings another question. Why is even a regular timer necessary when I can use the cortex core systick timer?
The third question is... What's the best way to do a 10 uS delay, either interrupt-driven or polled? My understanding is that chThdSleepMilliseconds is limited by the SysTick resolution.
Thank you!
I'm using a STM32F103C8T6 MCU (aka $2.5 dev board from aliexpress, aka "the blue board with the yellow headers", aka "Bluepill / Redpill") to build a robot. I'm using TIM2, 3 and 4 for PWM and quadrature encoder inputs, so I only have TIM1 left.
First question... I see that the only valid values for STM32_ST_USE_TIMER are 2, 3 and 4. But because I'm using the LQFP48 package and a bunch of other peripherals, TIM1 is my only leftover timer. Is there any way to use TIM1?
Which brings another question. Why is even a regular timer necessary when I can use the cortex core systick timer?
The third question is... What's the best way to do a 10 uS delay, either interrupt-driven or polled? My understanding is that chThdSleepMilliseconds is limited by the SysTick resolution.
Thank you!