16 Bit ADC advice wanted.

GroupDIY Audio Forum

Help Support GroupDIY Audio Forum:

This site may earn a commission from merchant affiliate links, including eBay, Amazon, and others.

Analog_Fan

Well-known member
Joined
Mar 22, 2022
Messages
570
Location
Universe
Hi there,

I'm looking around for a 16bit DAC to be coupled to a R2R DAC to be used in a modular synth for audio.
Don't have any experience with devices as such.
But what your opinion on these devices, suitable or not?

requirements are SPI, 16 bit.

ads8339
https://www.ti.com/lit/ds/symlink/ads8339.pdf(this had shipping for free yesterday @ mouser, now i wanted to buy it and the option is removed. )

Shows suggestion circuit on page 30

adc161s626
https://www.ti.com/lit/ds/symlink/adc161s626.pd
Shows suggestion circuit on page: 22

tlc4545
https://www.ti.com/lit/ds/symlink/tlc4545.pdf
 
Coupled to "R2R" (reel to reel?) - but then you mention synths (?). Title says ADC, but post says DAC - do you mean an A to D converter?

Links are to chips, you're building something from scratch?
 
Last edited:
Links are to chips, you're building something from scratch?

Indeed, from scratch.

using ...

AS6C4008-55SIN
Alliance Memory
4 mbit

Actually, i would like to use a AKM AK4954A, AK4621EF audio codec and my second choice is Cirrus Logic CS4272 or Cirrus Logic WM8904.
The last one is not expensive, stereo in/out, 3 band EQ, 16, 24 or 32 bit, 48kHz and doesn't require a lot of additional circuits.
They need both I²C and SPI (2x).
A similar variant has been used on "Mutable Instruments" clouds.
Mouser doesn't sell AKM.

BUT ...
There is a ton of registers inside, the manufacturer provides a windows based piece of software (Cirrus Logic WM8904) apparently to create setup files, but doesn't run on my computer, tried and failed. SPI and broad boarding is like a game, you're lucky or not.

To prevent complications, I'm gonna use octal flip flops to make a R2R2 array with sallen key filter and trade off some PCB space instead.
My microchip Fubarino needs a 16 bit ADC, when i saw these things first time, i didn't know what to with their differential inputs, now i have some understanding, but they are like 3 types of ADC at mouser.

TI ADS8339 is single ended.
TI ADS8867 is differential ended.
https://www.ti.com/lit/ds/symlink/ads8867.pdf* The device includes a
• Zero Latency at Full Speed capacitor-based, successive-approximation register
(SAR) ADC with an inherent sample-and-hold circuit.
Allows 5 V for reference voltage input.

I can't find any registers to set, but a "CONVST" pin pulled down to start conversion while clocking.
 
looking around for a 16bit DAC to be coupled to a R2R DAC

Can I assume you mean 16bit ADC and not 16bit DAC as you've written?

requirements are SPI, 16 bit

What device is interfacing with the ADC? SPI is more common for instrumentation applications, e.g. measure a sensor when commanded then read the value over SPI. Since audio data is (typically) continuously streaming SPI is a little bit of an awkward match. Can work with custom logic but likely to be difficult to impossible to get data streaming continuously with a typical microcontroller SPI interface.

They need both I²C and SPI

The I2C or SPI interface on the codecs is for configuring the settings, the audio data does not interface through the SPI connection. There are dedicated serial audio data interface pins.

SPI and broad boarding is like a game, you're lucky or not.

You can build prototypes with SPI, but if by bread boarding you mean the old style plug in boards for DIP and through hole passive components, indeed there may be difficulties getting SPI to run at high speeds with those. Some SPI interfaces can be clocked at lower speeds, those may work even on plug in bread boards if you lower the clock enough.
But for higher speed interfaces search for "dead bug prototype" techniques. More cumbersome, required a copper clad board and soldering connections, but more likely to work.

I can't find any registers to set, but a "CONVST" pin pulled down to start conversion while clocking.

How are you going to generate the timing signals for the ADC? You need very stable clock signals for good audio quality.
 
Can I assume you mean 16bit ADC and not 16bit DAC as you've written?

Yeah, use the ADC data to control a R2R (octal d-type flip flip array).

What device is interfacing with the ADC? SPI is more common for instrumentation applications, e.g. measure a sensor when commanded then read the value over SPI. Since audio data is (typically) continuously streaming SPI is a little bit of an awkward match. Can work with custom logic but likely to be difficult to impossible to get data streaming continuously with a typical microcontroller SPI interface.

Microchip Fubarino (PIC32MX250F256D)

The I2C or SPI interface on the codecs is for configuring the settings, the audio data does not interface through the SPI connection. There are dedicated serial audio data interface pins.

It should be compatible with SPI to deliver and retrieve audio data.


How are you going to generate the timing signals for the ADC? You need very stable clock signals for good audio quality.

using a 40K1 timer or around with 48 MHz clock and interrupt priorities.
The ADS8867 doesn't require a setup, it starts sampling when pulling a pin low.
 
Last edited:
i have drawn something and decided for the ADS8867 for being true differential.
https://www.ti.com/lit/ds/symlink/ads8867.pdf
AVDD supply created via opamp
ADS8857.jpeg

AVDD, Roland style using a 100R resistor and capacitor.
ADS8857 - AVDD.jpeg

using ths4521
https://www.ti.com/lit/ds/symlink/ths4521.pdfLike indicated on page 33 from the "ads8867" datasheet.
The Vcom pin from the THS4521 isn't indicated here.

reference amplifier circuit.jpeg

i have the used the "REFERENCE DRIVE CIRCUIT" from page 34, but to keep the cost down used TL072.
I'm wondering if i should use the that same circuit to generate AVDD or not.
I created the circuit in the Falstad simulator, turned on "log spectrum" it seams this circuit is moving around 75 Hz.
(i know: ideal opamp model).

The input is a 10 V.p.p signal (Eurorack modular), divided by 2 and then offset to be positive.
 
Prolly just me, but this seems like a bit of overkill just to digitize the output of a synth, unless there's something I'm missing.

Couldn't you just use an old Midiman Flying Cow, or something?
 
Your schematic shows an AVDD and DVDD which exceed the maximum allowed supply voltage by a substantial margin.

a 40K1 timer or around

Not familiar with a "40K1 timer or around," can you elaborate on what device that is, or provide a link?

Wait, are you referring to a timer in the MIPS M4K core of the microcontroller?

It should be compatible with SPI to deliver and retrieve audio data.

I was referring to the codecs you listed as your first and second choice. Those do not provide audio data on the SPI interfaces.

Codecs typically provide audio data on I2S interfaces, and the microcontroller you referenced has I2S interfaces available. Why are you making some convoluted design instead of just connecting an audio codec to the audio data interface of the processor?!
 
Your schematic shows an AVDD and DVDD which exceed the maximum allowed supply voltage by a substantial margin.

indeed, weird the REF van be 5 Volt + some few %, but AVDD 3V33.
That's weird.

That means the THS4521 is also affected, than i need to divide the incoming audio by 4, to have 2.5 V.p.p. input.
Loosing some resolution but well within the range unless i make AVDD around 2.65 V.

Not familiar with a "40K1 timer or around," can you elaborate on what device that is, or provide a link?

Wait, are you referring to a timer in the MIPS M4K core of the microcontroller?

Yes, timer of PIC32MX250F256 and poll the data.

I was referring to the codecs you listed as your first and second choice. Those do not provide audio data on the SPI interfaces.

Codecs typically provide audio data on I2S interfaces, and the microcontroller you referenced has I2S interfaces available. Why are you making some convoluted design instead of just connecting an audio codec to the audio data interface of the processor?!

https://statics.cirrus.com/pubs/proDatasheet/WM8904_Rev4.1.pdfmore technical detail % documents here:
https://www.cirrus.com/products/wm8904/
MCLK: Digital Input Master clock for CODEC
BCLK / GPIO4: Digital Input / Output Audio interface bit clock / GPIO4
LRCLK: Digital Input / Output Audio interface left / right clock (common for
ADC and DAC)
DACDAT: Digital Input DAC digital audio data
ADCDAT: Digital Output ADC digital audio data

SCLK:Digital Input Control interface clock input
SDA: Digital Input / Output Control interface data input / output

AKMAK4954A
https://www.akm.com/akm/en/file/datasheet/AK4954AEN.pdf
System design page: 107

SCL (I) Control Data Clock Pin
SDA (I/O) Control Data Input/Output Pin

SDTI: (I) Audio Serial Data Input Pin
SDTO: O Audio Serial Data Output Pin
LRCK: I/O Input/Output Channel Clock Pin
BICK: I/O Audio Serial Data Clock Pin


Here I²C is used to setup to the chip and SDTI, SDTO are data pins and i think only SPI can handle this (shift register).

These are easier to implament circuit wise, but maybe my pic aint up for the job thouhg it has 2 x SPI, but that's hat i got and there is a huge amount of registers to be set on both. 40 pages for the WM8904, probably will be bald after compiling 100+ times.
 
Prolly just me, but this seems like a bit of overkill just to digitize the output of a synth, unless there's something I'm missing.

Couldn't you just use an old Midiman Flying Cow, or something?

I have also bee working on reading *.WAV files, made some C++ program that makes me header files from wav files.
The dac will simple, like Roland did in the TR-909 using flip flops and while you at it you also want to have the possibility to record audio and include some ram.
 
Back in the day Burr Brown was the go to source for r2r ladder DACs.... Just roll your own SAR and make an A/D

Now you can buy IC ADC solutions.

JR

PS: Last time I messed around with DSP I used a Microchip DSPic that had a 16B DAC built in... it was pretty handy.
 
weird the REF van be 5 Volt + some few %, but AVDD 3V33

Might seem weird, but is also in bold print in the first column of the first page of the datasheet:
Wide Operating Range:
– AVDD: 2.7 V to 3.6 V
– DVDD: 1.65 V to 3.6 V
– REF: 2.5 V to 5 V (Independent of AVDD)


Also in the absolute maximum ratings table:
AVDD to GND or DVDD to GND –0.3 4 V

Not to harp on the point, but that is really basic, it likely indicates that either you are jumping in a little farther than you are ready for on this project, or that your lack of attention to detail is going to bite you hard. I hope I'm not overstepping here, I usually try to avoid personal criticism and just answer technical questions, but I think that taking one step back and evaluating whether starting with a project that has more of the basics worked out already might be a better starting point.

Yes, timer of PIC32MX250F256 and poll the data

Make sure that can handle conversions with no gaps, i.e. continuous clock. Most processors have difficulty sustaining data movement when the processor is responsible for grabbing every sample with no buffering. If you can get that to work at all I would be surprised if the processor core has time to do anything else.

WM8904 | Cirrus Logic

That device is optimized for portable (i.e. battery powered) use. Do you really need a device which can run from a single 1.8V supply? If you are interfacing with standard audio equipment (e.g. 2V RMS output levels) that will create more headaches than it solves.
The device also has a microphone input made for cheap electret mics like used for headsets. Do you need that feature?
Can you handle the package type? No legs and a thermal pad under that package which must be soldered. Those are very hard to solder properly if not using a reflow oven. You can do it with PCB heater and hot air, but takes some experience.

Something like a CS4271 would have a simpler power supply, can be soldered by hand, and has a less complicated configuration required (just 8 registers to setup).

SDTI, SDTO are data pins and i think only SPI can handle this

From the "Introduction" section of the WM8904 datasheet:
"The WM8904 has a highly flexible digital audio interface, supporting a number of protocols, including I2S...."

From the AK4954A datasheet "Audio Interface Format" section:
"Six types of data formats are available and selected by setting the DIF2-0 bits...."
From the following table, mode 3: 24-bit/16bit I2S Compatible

From the top of the PIC32MX270F256D web page:
Two I2S/SPI modules for Codec and serial communication

You seem to be trying to do this the absolute hardest possible way. There are simple to use codecs available, and the processor has dedicated interfaces for connecting them.
 
Back in the day Burr Brown was the go to source for r2r ladder DACs.... Just roll your own SAR and make an A/D

Now you can buy IC ADC solutions.

JR

PS: Last time I messed around with DSP I used a Microchip DSPic that had a 16B DAC built in... it was pretty handy.

I have the microchip Fubarino, compatible with Arduino IDE, just plug the USB cable.
GitHub - chipKIT32/pic32-Arduino-Bootloader: pic32 Arduino Bootloader, your computer states: stk500v2 if you plug the "device".
Also handy, no more pulling the chip from the circuit and push in to a socket with pickit of ICDx programmer,
like i used to and risk pins to be damaged.

the ADC800 is easy to use, looks pretty much the same as Roland used in the TR-707 (UPC624), even the same pins and pin numbers.
(ADC800 doesn't even have clock or chip select / enable pins, but also 2 output pins)
But you do have to take care of reference voltage, Roland used different of each drum sample via a old version of the CD4051.
I have no clue about the science of that. for simplicity i wanna use the 75HC574 and R2R.

DIY 4 Second Digital Delay
https://electricdruid.net/diy-digital-delay/build with dspic.

PIC's have 10 bit ADC on board. than you have to shift and it seems to be noisy.
 
Might seem weird, but is also in bold print in the first column of the first page of the datasheet:
Wide Operating Range:
– AVDD: 2.7 V to 3.6 V
– DVDD: 1.65 V to 3.6 V
– REF: 2.5 V to 5 V (Independent of AVDD)


Also in the absolute maximum ratings table:
AVDD to GND or DVDD to GND –0.3 4 V

Not to harp on the point, but that is really basic, it likely indicates that either you are jumping in a little farther than you are ready for on this project, or that your lack of attention to detail is going to bite you hard. I hope I'm not overstepping here, I usually try to avoid personal criticism and just answer technical questions, but I think that taking one step back and evaluating whether starting with a project that has more of the basics worked out already might be a better starting point.



Make sure that can handle conversions with no gaps, i.e. continuous clock. Most processors have difficulty sustaining data movement when the processor is responsible for grabbing every sample with no buffering. If you can get that to work at all I would be surprised if the processor core has time to do anything else.



That device is optimized for portable (i.e. battery powered) use. Do you really need a device which can run from a single 1.8V supply? If you are interfacing with standard audio equipment (e.g. 2V RMS output levels) that will create more headaches than it solves.
The device also has a microphone input made for cheap electret mics like used for headsets. Do you need that feature?
Can you handle the package type? No legs and a thermal pad under that package which must be soldered. Those are very hard to solder properly if not using a reflow oven. You can do it with PCB heater and hot air, but takes some experience.

Something like a CS4271 would have a simpler power supply, can be soldered by hand, and has a less complicated configuration required (just 8 registers to setup).

I look at schematic of a commercial eurorack module and saw; Wolfson
keywords: Wolfson + cirrus logic brought me to WM8904, also mouser's search engine.
AKM, because it used in AKAI S2000(xl), S3000XL, MPC3000, MPC one, LIVE, LIVE II, X.
That's why i made the question here.

From the "Introduction" section of the WM8904 datasheet:
"The WM8904 has a highly flexible digital audio interface, supporting a number of protocols, including I2S...."

From the AK4954A datasheet "Audio Interface Format" section:
"Six types of data formats are available and selected by setting the DIF2-0 bits...."
From the following table, mode 3: 24-bit/16bit I2S Compatible

From the top of the PIC32MX270F256D web page:
Two I2S/SPI modules for Codec and serial communication

You seem to be trying to do this the absolute hardest possible way. There are simple to use codecs available, and the processor has dedicated interfaces for connecting them.

Yes, i saw that in the datasheet of the pic, but at the time i wasn't looking for that info and now i forgot about that.

CS4271
https://statics.cirrus.com/pubs/proDatasheet/CS4271_F2.pdfThis chip looks good, thanks.

Page 32, 33 lots of odd resistors value though, the mute control is pretty much the same as used in the TR-909, TR-707.

Around 10€ at mouser, a bit more expensive than the ADS8867, but requires less (dedicated) external parts.

There is more to learn: Left Justified, up to 24-bit data (default), Right Justified, 24-bit Data, Dither, Interpolation.

But this looks like the appropriate device for experiments.
 
Just the basics: 16 bits is one part in 65536, if you want 1/2 LSB accuracy you are out to 1 part in 131072, less than 10 parts per million. Even with expensive 5PPM/C resistors (~$30 each for 0.01% parts) it is virtually impossible to homebrew anything that holds 10 PPM over any modest temperature range, not to mention you would need resistors in the sub 0.1% accuracy category, or a bunch of individually adjusted potentiometers just to tweak in the R2R steps. As for using octal latches in voltage output mode, bear in mind that the load on any one output will vary depending on the other bit values in the 16 bit word. Expecting constant, predictable output levels will only leave you disappointed. So, good luck with getting something that satisfies your goals!
 
AF,
Hey I have used in large capacity (>500K) products based on the PIC32MX270 which is just the larger memory model of the 250. I 12 products using that processor as a USB DAC converter.

Just a few thoughts....
Why SPI over I2S? I mean there are a ton of really nice ADC and DAC converters to make this easier.
Instead of trying to build an R2R dac why not just use I2S and use like a TDA1543 8 pin part excellent R2R architecture sounds great use it all the time.
Remember in something like this running the dac chip and the adc on the same master clock is a good thing. You can use the PLL from the USB controller 96MHz clock to divide down into good sample rates. Or provide a really good stable low jitter clock into a REFCLKI pin and then select that into the PLL to make your the MCLK, SCLK and WCLK.
Your not going to be able to POLL any of this, it has to be done with the DMA. There is example code on the Microchip site for all of that. There is also Microchip Harmony which if you go through their wizard interface will create code in C that you can link together and may get you close to what your looking for. There is also some Full Speed USB AD/DA code floating around that might be a bit easier to work with.
If you link the ADC and the DAC together on the same I2S port then things get a lot simpler. Ring in x# of samples then do your thing in the foreground then send the output to DAC output ring buffer. As long as the ADC being the aggregate input to the dac output you should not have any pops or clicks on the output.
Thanks,
Gordon
 
Back
Top