cancel
Showing results for 
Search instead for 
Did you mean: 

How to enable a slave timer but not triggering it.

Zef.M
Associate

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:0693W00000NrMIjQAN.jpgMy timer config are shown below0693W00000NrMJ8QAN.jpgWhen 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!

1 REPLY 1

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