Re: WS2812 LEDs - Driver
Posted: Thu May 07, 2015 4:28 pm
Hi
So. I read the DMA and Timer section of the manuel and everything is much clearer now. Very interesting indeed.
Well, I returned to the first driver again (that one already written using ChibiOS and for a STM32F3), and according to the manual, only the streamer channel numbers changed in my case.
Streamer 2 became Streamer 7
Streamer 3 became Streamer 2
Streamer 6 became Streamer 4
The other settings (or the default ones) are ok I think, I only added the STM32_DMA_CR_CHSEL(5) that you mentioned.
But I can't really test it if it works now. I accidentally burned my unique compatible level translator (74HTC256), I have to wait that another one arrives, I also ordered a cheap USB logic analyser, I think it will help int he future
.
But since the discovery board has 4 onboard LEDs, I have connected the 2 channels of the TIM3 to them, and slowed down the frequency of the timer (I changed the period from 1.25us to 1s) so that so that I could see the ticks of the timer, and the resulting datastream coming out of the DMA/GPIO pin.
(I disabled the master PWM2, I can't find the rights settings that fits to the modified PWM3 settings values, so I started the PWM3 slave manually, if I understood the algorithm right it won't have any repercussion on the behavior of the DMA transfers, so it's ok for debugging the code)
Well the timer 3 runs fine, but still no data on the output port, it's frustrating.
Is it normal that I can't read the values of some registers with OpenOCD???
I wanted to check if the DMA requests were triggered or not.

mmh. I think I will try to activate the CC interrupts, the are triggered at the same time as the DMA request (no idea how to implement it, it will be funny
). 
EDIT:
mmh, why is there no Capture Compare Interrupt for the TIM3 defined in the stm32f4xx.h file
There are only one for the TIM1 and another one for the TIM8.
So. I read the DMA and Timer section of the manuel and everything is much clearer now. Very interesting indeed.
Well, I returned to the first driver again (that one already written using ChibiOS and for a STM32F3), and according to the manual, only the streamer channel numbers changed in my case.
Streamer 2 became Streamer 7
Streamer 3 became Streamer 2
Streamer 6 became Streamer 4
The other settings (or the default ones) are ok I think, I only added the STM32_DMA_CR_CHSEL(5) that you mentioned.
But I can't really test it if it works now. I accidentally burned my unique compatible level translator (74HTC256), I have to wait that another one arrives, I also ordered a cheap USB logic analyser, I think it will help int he future
But since the discovery board has 4 onboard LEDs, I have connected the 2 channels of the TIM3 to them, and slowed down the frequency of the timer (I changed the period from 1.25us to 1s) so that so that I could see the ticks of the timer, and the resulting datastream coming out of the DMA/GPIO pin.
(I disabled the master PWM2, I can't find the rights settings that fits to the modified PWM3 settings values, so I started the PWM3 slave manually, if I understood the algorithm right it won't have any repercussion on the behavior of the DMA transfers, so it's ok for debugging the code)
Well the timer 3 runs fine, but still no data on the output port, it's frustrating.
Is it normal that I can't read the values of some registers with OpenOCD???
I wanted to check if the DMA requests were triggered or not.

mmh. I think I will try to activate the CC interrupts, the are triggered at the same time as the DMA request (no idea how to implement it, it will be funny
EDIT:
mmh, why is there no Capture Compare Interrupt for the TIM3 defined in the stm32f4xx.h file
There are only one for the TIM1 and another one for the TIM8.