PWM control with DMA and ADC
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2012-06-21 7:58 AM
Posted on June 21, 2012 at 16:58The original post was too long to process during our migration. Please click on the attachment to read the original post.
This discussion is locked. Please start a new topic to ask your question.
2 REPLIES 2
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2012-06-21 8:23 AM
Posted on June 21, 2012 at 17:23
Don't know about the general viability of this
But you'll need to fix the Channel# here TIM_OC3Init(TIM4, &TIM_OCInitStructure); // Initializes the TIM Channel 3 according to the parameters specified in the TIM_OCInitStruct
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Up vote any posts that you find helpful, it shows what's working..
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2012-06-21 11:01 AM
Posted on June 21, 2012 at 20:01
THANKS!!! clive1,,,
%%%%% BELOW THE SOLUTION%%%%%%%%void TIM_Configuration(void)
{ /* Time base configuration */ TIM_TimeBaseStructure.TIM_Period = 0xFFF; TIM_TimeBaseStructure.TIM_Prescaler = 3000; TIM_TimeBaseStructure.TIM_ClockDivision = TIM_CKD_DIV1; TIM_TimeBaseStructure.TIM_CounterMode = TIM_CounterMode_Up; TIM_TimeBaseStructure.TIM_RepetitionCounter = 1; TIM_TimeBaseInit(TIM4, &TIM_TimeBaseStructure); /* PWM1 Mode configuration: Channel1 */ TIM_OCInitStructure.TIM_OCMode = TIM_OCMode_PWM1; TIM_OCInitStructure.TIM_OutputState = TIM_OutputState_Enable; TIM_OCInitStructure.TIM_Pulse = 50; TIM_OCInitStructure.TIM_OCPolarity = TIM_OCPolarity_High; TIM_OC3Init(TIM4, &TIM_OCInitStructure); TIM_ARRPreloadConfig(TIM4, ENABLE); // ''connecting'' DMA and TIM3 TIM_DMACmd(TIM4, TIM_DMA_Update, ENABLE);/* TIM3 enable counter */
TIM_Cmd(TIM4, ENABLE);// turning on TIM3 and PWM outputs
TIM_CtrlPWMOutputs(TIM4, ENABLE); }