STM32 MCP4822 DAC no audio

Post here first, or if you can't find a relevant section!
Post Reply
justinjools
Posts: 41
Joined: Thu May 02, 2024 11:10 am

STM32 MCP4822 DAC no audio

Post 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/
STM32ardui
Posts: 142
Joined: Mon May 06, 2024 1:46 pm
Answers: 1
Location: Germany

Re: STM32 MCP4822 DAC no audio

Post 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.
justinjools
Posts: 41
Joined: Thu May 02, 2024 11:10 am

Re: STM32 MCP4822 DAC no audio

Post 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
Attachments
MPC4822 pins_sm.jpg
MPC4822 pins_sm.jpg (95.98 KiB) Viewed 616 times
Post Reply

Return to “General discussion”