2015-05-26 04:16 PM
2015-05-26 04:33 PM
Ok, you can't make random associations between TIM and DMA
TIM2_UP is DMA1 Channel 2 per RM0008 You could associate TIM2_CH3 (CC3) with DMA1 Channel 1, but I wouldn't advise that.2015-05-26 04:41 PM
Specifically, not
TIM_DMACmd(TIM2, TIM_DMA_CC1, ENABLE); // CC3 ?
Pulse = 0; // Something >=1
2015-05-26 05:07 PM
Thanks clive1, I knew it was something stupid! Is there a reason why you would not recommend the TIM2CH3 and DMA1CH1 combo? is there another combo you would recommend?
Edit: Just for clarification for other users, the issue was resolved by changing the following.DMA_InitStruct.DMA_PeripheralBaseAddr = (uint32_t)&TIM2->CCR1; toDMA_InitStruct.DMA_PeripheralBaseAddr = (uint32_t)&TIM2->CCR3; and TIM_DMACmd(TIM2, TIM_DMA_CC1, ENABLE); toTIM_DMACmd(TIM2, TIM_DMA_CC3, ENABLE);2015-05-26 05:20 PM
I prefer the Update trigger. With CCx you're going to have to be careful about the preload mode, and if you just advance the current count vs the next iteration of the timer period.
At the end of the day it might come down to the TIM/DMA resources you have available.2015-05-26 05:38 PM
I see. This is my first time using DMA so i'll have to read up on that later. In the mean time i need to figure out how to get the PWM wave working properly for these LEDs. Thanks so much for your help!
2015-05-26 08:37 PM
Can someone explain why im getting impulses instead of a PWM signal?
Here is a picture:2015-05-31 10:16 PM
I'm pretty sure 50 K sample per second is not going to do well with a signal at 800 KHz, try 2 MSps