AnsweredAssumed Answered

generate pulse wave with stm32f10x and cmsis library

Question asked by mohamadi.parisa on Dec 23, 2016
Latest reply on Dec 26, 2016 by mohamadi.parisa

Hello

I'm supposed to generate pulse train with stm32f10x and cmsis library.

 

TIM_TimeBaseInitTypeDef TIMST;
TIMST.TIM_Prescaler=72;
TIMST.TIM_Period=1000;
TIMST.TIM_ClockDivision=TIM_CKD_DIV1;    
TIMST.TIM_CounterMode=    TIM_CounterMode_Up ;
TIM_TimeBaseInit(TIM2, &TIMST);

 

         TIM_OCInitTypeDef TIMCRC;

        TIMCRC.TIM_OCMode=TIM_OCMode_Toggle;
        TIMCRC.TIM_OCIdleState=TIM_OCIdleState_Reset;
        TIMCRC.TIM_OCNIdleState=TIM_OCNPolarity_Low;
        TIMCRC.TIM_OCPolarity=TIM_OCPolarity_High;
        TIMCRC.TIM_OCNPolarity=TIM_OCPolarity_Low;
        TIMCRC.TIM_OutputNState=TIM_OutputNState_Disable;
        TIMCRC.TIM_OutputState=TIM_OutputNState_Enable;
        TIMCRC.TIM_Pulse=

 

But I don't know how I can define Pulse variable value for specific output frequency.(Is this code correct? or I did some mistake? )

Outcomes