2022-06-07 02:46 PM
I`m hoping to have a slave timer enabled but idling and wait to be triggered by a master. The idea is to have the slave to trigger ADC reading for multiple cycles and synchronized with the master:My timer config are shown belowWhen I call functions such as HAL_TIM_OC_Start or anything along the line, the slave timer just starts triggering without waiting for the master to trigger.
Would there be a way I could have it enabled but stuck at certain value?
or do I have to clear the master trigger value?
Also slave is running at around 1MHz so software interrupt would cause time delay which won`t work in my case.
Any tips on how I shall set up the timer either in CubeMX or directly access its register maps?
Thanks!
2022-06-07 04:02 PM
Which STM32?
You want the slave's Slave-mode controller (i.e. TIM4_SMCR.SMS) to be Trigger mode, not Reset mode.
Also, maybe you want to consider, whether you really want to use Update event to be the TRGO source in master, i.e. TIM2->CR2.MMS.
> When I call functions such as HAL_TIM_OC_Start or anything along the line
Random Cube/HAL functions and "along the line" is not something the microcontroller recognizes. Read the TIM chapter in RM, and use terms from there.
JW