Showing results for 
Search instead for 
Did you mean: 

Synchron driving with 2 STM Boards using external trigger signal

Associate III

Hello guys. I got two STMF411RE Nucleo Boards and i want to start 10KHz pwm signals on each one of them with 25 microseconds delay between them and i MUST use an external trigger signal (Main synchronization computer) to trigger those STM's to create pwm signals. My main computer generates %25 duty cycle and 100 microseconds period on 10 KHz pwm signals and i tried to trigger my STM's with those signals but i couldnt achieve it. I used timers on Trigger mode with OPM mode ON so that i thought i could generate pulses at the same time that my Trigger pin is Triggered by the main computer synch-signal. But i think that pin is not getting triggered at high speeds such as 10 KHz because i couldnt get a signal out of the output pin. I could press a button and trigger it and generate a pulse with my hand and at another project i approached with the same technique but i worked between 1-100 Hz interval. Here are my timer configurations;




and i am using an FPGA to generate the main synch-signal and it is working perfectly fine generating %25 duty cycle 100 microseconds period of 10 KHz signals on each output shifted with 25 microseconds delay. Is there anyway to achieve this ? I am very new to working with STM Microcontrollers so there might be a lot of basic stuff that i am missing right now but i did my best now i need your help once again guys 🙂 Thanks to you all.

Associate III

for an addition, i tried setting up the timer to PWM mode (not One Pulse Mode) and when the trigger happens starting the PWM's, flashed the both boards with the same code, did my connections but the problem is my synchron-signal is not a one time signal so every time STM gets triggered, it tries to start the timer PWM again and it messes up with my synchronization (messes up the shift between the signals ) so i could get assistance on that too.

> every time STM gets triggered, it tries to start the timer PWM again

This is not how the Trigger mode of slave-mode-controller in TIM works, so you do something improperly.

If a trigger arrives, it set TIMx_CR1.CEN, that's all. Repeated triggers don't do anything, unless CEN is cleared by software, or by hardware (that happens only if One-Pulse Mode is enabled and Update occurs).

Read out and check/post content of TIM registers after configuration before the first trigger arrives, and compare to state after trigger arrived.