R2R Dac on Arduino?

Hello,

I’ve bought this dac before realising that the only documentation and code written for it is for the raspberry pico and in Python.

I can write code, but I need some pointers on what a should do with each pin to get it working.

Connect 3.3V or 5V to Vcc and Gnd to Gnd. Then connect the Arduino I/O pins to the ‘GP’ pins and set them to OUTPUT. Think of a number between 0 and 2^10 and apply the binary digits of that number, in sequence of the DAC GP numbers, to the ARDUINO outputs. The voltage representing that number (with respect to Vcc) will then appear at the Vout pin. Note the comment on the product page re using less than 10 bits of data - use the highest-number inputs for data and ground the others.

1 Like

A previous project of mine Arduino Audio Recorder with playback might help although it does not use a DAC.

At the time I attempted to use a 8 bit DAC but the Arduino processor was not fast enough to write the bytes from the .wav file to the DAC. In the end I setup an interrupt routine which wrote the bits to a pin as a PCM signal. Direct register writes were used to speed it up. The memory capacity of the Arduino was a limitation too.

Other projects that produce audio from the Arduino type devices use a single pin output and similar method. The quality is not as good but for my purpose it worked as I wanted. I spent many months understanding .wav files, Arduino low level registers, timing and interrupts. It was not an easy project.

All the best.
Jim

Hi All,

I don’t have much to offer here, but I do know the Makerverse R2R DAC makes heavy use of DMA, something that the Arduino doesn’t have, We went on a deep dive on exactly how below:

One thing I’ve always wanted to try is implementing a parallel interface by writing to a whole GPIO register in one go, but I’m not sure the Arduino CPU has enough grunt to handle the required processing to get it there fast enough for audio applications:
image

I think it’s still worth a go though! Worst case, you get a DAC you can use for another analog project, best case you get something that can play a bit of audio :slight_smile:

1 Like

So what’s the best solution to have a board that can listen to wake words and output audio?

Getting a raspberry pi pico?

Teensy are super fast and have an associated audio board that is very capable. I’m sure it would work, although I admit I haven’t done the listening bit.
Try the pjrc forum, I think they would have some one that would help if you go down this route.

2 Likes