Issues with MCP4922 on Custom Board

16 views
Skip to first unread message

udu3324

unread,
Aug 5, 2025, 8:45:36 PMAug 5
to Mozzi-users
Hi, I have just designed my own custom board on the esp32-s3 wroom for a synthesizer mimicking the modulin. 

I have built a functional MCP4922 circuit before with Mozzi working great on it, but it seems like my more professional setup is creating some problems. (added two op-amps after the mcp4922)

I am on platform io (arduino) with a slightly modified version of MCP4922_mono_24bits for my setup as it has some different pinout.


//...
#define SPI_SCK   12  // SCK (Clock)
#define SPI_MOSI  11  // SDI (MOSI)
#define SPI_MISO  9   // SDO (MISO) unused

// External audio output parameters and DAC declaration
#define SS_PIN 10
//...
void setup() {
//...
SPI.begin(SPI_SCK, SPI_MISO, SPI_MOSI);
dac.init();
//...


I have attached a pdf of my schematic for my design. I am making sure to take little steps first like getting audio output setup before doing anything else big.

schematic.pdf

udu3324

unread,
Aug 5, 2025, 10:19:36 PMAug 5
to Mozzi-users
It seems like changing the " mozzi audio bits"  to something lower like 16 or 8 makes the output more audible, but some noise is still there. 
I thought a higher value means higher quality though.

#define MOZZI_AUDIO_BITS 24

tomco...@live.fr

unread,
Aug 7, 2025, 5:25:29 AMAug 7
to Mozzi-users
Hi!

If I remember correctly, the example you are referring to ("MCP4922_mono_24bits") uses the two 12 bits channels of the DAC to produce a single 24bits "HiFi" output, in the same way Mozzi produces HiFi from PWM, with the lowest bits being taken care of by one channel and the highest bits by the other. In order to do that, the channels should be merged in a very specific way (look at the header of that example).
However, your schematic shows that you are outputting the two channels independently, so you are not outputting 24 bits but two times 12 bits,  so the correct config is: "#define MOZZI_AUDIO_BITS 12". This define tells Mozzi, what number of bits the audio outputting system (the DAC here) expects in order to produce the correct scaling and so on.

Hope this helps,
Tom
Reply all
Reply to author
Forward
0 new messages