AnsweredAssumed Answered

ADC Trigger TIM8

Question asked by waytae on Apr 3, 2013
Latest reply on Apr 12, 2013 by waytae
                                                               
           
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);

image.jpeg

            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 :)
           

           
blank.gif

Outcomes