Page 1 of 1

STM32 MCP4822 DAC no audio

Posted: Thu Jun 27, 2024 5:00 pm
by justinjools
I've been trying to get MCP4822 working with STM32F103C8T6 blue, after having working circuit with Arduino Nano. I have posted circuit examples on Reddit but though I might get some help here as well. I was thinking do I need to include STMDuino as well as Mozzi?

https://www.reddit.com/r/arduino/commen ... _no_audio/

Re: STM32 MCP4822 DAC no audio

Posted: Thu Jun 27, 2024 8:19 pm
by STM32ardui
1. If MCP4822 can work also with 3,3 V, you can use it with STM32 MCUs.
If you use default pins of BluePill-board, SPI should work.

2. If you want to program this DAC with ArduinoIDE, you will need STM32duino and for upload STM32CubeProgrammer.

BTW: your subject "no audio" sounds like you already uploaded a sketch to STM32F103.
Do you have a sketch or not?
If you have one, you should show it!

Mozzi is a library? Normally libraries are installed inside ArduinoIDE with library manager.

3. Which MCP4822-library you used for Arduino Nano?
No information about from you!
May be it will work also with a STM32F103.
And why you don't use a STM32, that has DAC inside???

Two years ago was a similar topic here and a link to a library: https://github.com/SteveGdvs/MCP48xx/tr ... 9001970323

Otherwise ST has published something, you should type in "MCP4822 STM32" at Google (there is no real link). It was made for Keil and a NUCLEO-STM32L476RG board, but there is a definition for a sine wave table inside code.

Re: STM32 MCP4822 DAC no audio

Posted: Wed Jul 03, 2024 1:14 pm
by justinjools
Update:

For anyone else using MCP4822 I got it working connecting to SPI1 pins. It works with the MCP49xx driver and external audio Mozzi example code:

https://github.com/tomcombriat/DAC_MCP49XX
https://github.com/sensorium/Mozzi/tree ... ono_12bits

Image