ch32v003fun icon indicating copy to clipboard operation
ch32v003fun copied to clipboard

Understanding how the DMA example spi_dac works

Open karstengit opened this issue 1 year ago • 11 comments

Thank you for this nice project, that gives a much more direct hardware access to the MCU as the MounRiver Studio and works fine in Linux.

At this moment I am trying to test a little breakout board I have made for the use of this interesting MCU. https://www.mikrocontroller.net/topic/548353#7427694 Without the knowledge of your project details I have choosen to implement the same interesting IC's like WS2811 and PT8211. :-)

peripheral

For the first test I tried to use the DAC, but I used an TDA1387 instead of an PT8211 and get an curious output on the sine channel. The pin WS is of course connected to PC4 and not to PC3 as suggested in the diagram (jumper bridge).

channel-r

The other channel works as expected.

channel-l

I am not familiar with the use of an DMA and your example uses the hardware on a high level. You already commented your code a much, but at this time I have no idea why this output happens?

TIM1CH4 generates the signal for WS and interrupts to fill the buffer for the DMA. But how this works in detail? The DAC buffer is filled in a mystery way and the output is only strange for one channel.

WS-clocking

Is it possible to output a wave directly from the flash with the DMA?

Has someone tips for a low skilled programmer to learn?

karstengit avatar Jun 20 '23 11:06 karstengit