cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F4 ADCs triggerd by TIM1 possible?

maier
Associate
Posted on March 30, 2014 at 18:34

Hello,

at first, I try to explain my target functinality:

-TIM1 generates a 3PH Center aligned PWM

- the ADCs are configured in triple mode, some channels are converted and the DMA generates an Interrupt when the Transfer of data to RAM has finished (regular channels)

-TIM1 should Trigger the sampling sequence of the ADCs when 0, Period, or both (Software selectable)

What is working:

-the timer is configured proper an generates the PWM pattern

-the ADCs and DMA work, but only with Software Trigger

The question:

Is it possible to configure TIM1 to generate the Trigger for the ADCs in that way?

The Statements ''TIM1_CHx Event'' in RM0090 on page 396 are not clear to me. It seems to me, that a new conversion is immediately started, after the last has finnished.

Thanks in advance for your help!

#adc #trog #triple-mode #dma
3 REPLIES 3
Posted on March 30, 2014 at 23:47

Triple mode implies they all trigger at the same time, some how I think you want them phase aligned with the respective channels.

You should be able to configure each of the three ADC with a different channel, and different trigger TIM1_CH1, TIM1_CH2_ TIM1_CH3, and you'll need three independent DMA, or IRQ
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
maier
Associate
Posted on March 31, 2014 at 06:21

Hi Clive,

the three PWM-Channels are running with no Phase shift, simmilar to the Picture (sorry for Picture source, Google did it ;) :(

http://e2e.ti.com/cfs-file.ashx/__key/communityserver-discussions-components-files/908/6036.pwm_5F00_cent.JPG

I want all regular ADC channels on all ADCs converted at PWM Counter == 0, Counter == ADD or both.

When does the ''TIM1_CHx Event'' Trigger the ADC? I can't find further Information for this Events...

Is it right, that the Trigger for triple mode ADC are only the ADC1 ones?
Posted on March 31, 2014 at 15:08

You should be able to start the conversion on multiple channels using the trigger. You only have a single trigger, although you can presumably reconfigure it on the fly.

The conversions on an ADC will occur one after another at the sampling rate, in non-continuous mode it will stop after the list is enumerated.

In Triple mode the triggering is mastered by ADC1, but you really want all the ADC configured in a balanced fashion. In this mode you get 3 channels sampled in a synchronous fashion.

For a TIM1 Channel1 Trigger, it should occur when TIM1->CNT == TIM1->CCR1
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..