AnsweredAssumed Answered

Timers Synchronization

Question asked by Keaven on Nov 2, 2015
Latest reply on Nov 6, 2015 by Keaven
I need to use the timer synchronization in my STM32F7 project.  The purpose of the timers are to provide the necessary signals to a CCD sensor.  I have a shutter pulse (T5-CH4) and a pixel clock (T4-CH2).  I am also using another channel of the same timer as the pixel clock for the ADC trigger (T4-CH4).

The frequencies are the following: Shutter is 20 Hz and pixel clock/ADC trigger are 60 KHz.

My requirements are:  
- the shutter is a variable PWM with the falling edge used as start event
- the pixel clock must have his rising edge synchronized with the falling edge of the shutter and has to be present all the time.
- The ADC trigger is the inverse of the pixel clock but must be start on the falling edge of the shutter.  This clock is present for the length on the acquisition.  It is stopped once the DMA transfer is done.

Now, the problem I have now is that I can have a bad pixel synchronization since I didn't sync anything and the pixel clock is free running and the ADC trigger is misplaced. Finally, I am enabling the ADC trigger on the pulse completion callback of the shutter.

Before determining the required configuration, first are the channels of the same timer synchronous to each other.  Here, in my application the pixel clock is always running but the ADC trigger is enable when I need to convert the signal.  If I enable the ADC trigger at a time X  will it be perfectly synchronous with his paired channel but inverted?

If so that will means I will only need to synchronize the falling edge of the shutter with the rising edge of the pixel clock?  If not I will need to synchronize all three timers/channels together.

I think we can only use the rising edge for synchronization if I read correctly.  So this mean I will need another timer to start everyone together right?

Hope you have all the information needed to answer.