cancel
Showing results for 
Search instead for 
Did you mean: 

ADC Trigger TIM8

bmwael1
Associate II
Posted on April 03, 2013 at 13:35

Hi,

I create a TIM8 mode up and down using this Instruction

TIM_TimeBaseStructure.TIM_Period = 2000;
TIM_TimeBaseStructure.TIM_Prescaler = PrescalerValue;
TIM_TimeBaseStructure.TIM_ClockDivision = 0;
TIM_TimeBaseStructure.TIM_CounterMode = TIM_CounterMode_CenterAligned3;
 TIM_TimeBaseInit(TIM8, &TIM_TimeBaseStructure);

0690X00000603D8QAI.jpg Then I create a PWM signal using TIM8_CH1

TIM8->CCR1 = 1500 ; 
// PC6 Signal 1

I have another part of my program that read ADC value of 5 signal using DMA. I want to trigger the reading of ADC 4 time in period (The red circled in figure) Ie when TIM8 = 0 , TIM8 = 1500 Up,, TIM8 = 2000, TIM8 = 1500 Down memorize them then repeat the cycle conversion . I use this line in ADC configuration

ADC_InitStructure.ADC_ScanConvMode = ENABLE;
 ADC_InitStructure.ADC_ContinuousConvMode = DISABLE;
 ADC_InitStructure.ADC_ExternalTrigConvEdge = ADC_ExternalTrigConvEdge_RisingFalling; 
ADC_InitStructure.ADC_ExternalTrigConv = ADC_ExternalTrigConv_T8_CC1;

But i don't know what this 2 line do exactly :\ And how to verify if The trigger works in the desired Time or no ? Can someone help me to read ADC in this 4 time Thanks :) 0690X0000060MnoQAE.gif
1 REPLY 1
bmwael1
Associate II
Posted on April 12, 2013 at 10:30

Any help

Thanks :)