ADC and DAC field guide
Twyyx
Posts: 66
in Propeller 2
I'm starting this thread as a call for comments and consolidation for material related to using the smartpins for various applications analog.
Specifically, discussion and pointers for practical use for good quality audio, accurate scope sampling, etc.
I'm already somewhat read on all the previous material in the forums, in particular the intense collaborative effort on "ADC Breakthrough".
While that 50+ page read is quite rich with details and ADC theory, I'm specifically trying to start a field guide about ADC and DAC usage that doesn't require new users to try to curate and understand all those details. That was necessary work to find the limits of what could be done in R&D and potentially impacting to next and future revs of the smartpin design. However, that level of detail is best left in the R&D view when trying to get newer users oriented and building with known parameters and patterns.
So, it is with great hope that I start this thread as a small snowball that will hopefully pick up many useful bits of information into one place. I'd call it a curated list of "how to" guides, a list of known parameters and design decision points. Even if this is a pick list of things to go into the user guides that will necessarily be coming along at some point, that is enough of a value for us to put it together.
I post the following questions as examples of the kinds of things I would hope to see as a new P2 audio experimenter:
I would like to know whether I can just use the built-in ADC capabilities for an audio application. What is the comparative quality of the audio signal that I can digitize with a simple circuit before I must consider adding an off-board ADC chip? What is the relative noise floor of audio that has been digitized and then reconstructed through the P2 with the DAC streaming?
What are the top few modes I should consider for audio conversion on a smartpin, and what are the specific trade-offs between them, practically speaking?
Where are the pointers to good reference circuits for effective impedance matching external sources?
I hope that we can keep this on the "field guide" track and avoid delving too much into theory. I like reading that too, but there is an appropriate time and place for everything. It is time for curation and consolidation of the vast knowledge in this form. This will help drive understanding and adoption of the P2.
Specifically, discussion and pointers for practical use for good quality audio, accurate scope sampling, etc.
I'm already somewhat read on all the previous material in the forums, in particular the intense collaborative effort on "ADC Breakthrough".
While that 50+ page read is quite rich with details and ADC theory, I'm specifically trying to start a field guide about ADC and DAC usage that doesn't require new users to try to curate and understand all those details. That was necessary work to find the limits of what could be done in R&D and potentially impacting to next and future revs of the smartpin design. However, that level of detail is best left in the R&D view when trying to get newer users oriented and building with known parameters and patterns.
So, it is with great hope that I start this thread as a small snowball that will hopefully pick up many useful bits of information into one place. I'd call it a curated list of "how to" guides, a list of known parameters and design decision points. Even if this is a pick list of things to go into the user guides that will necessarily be coming along at some point, that is enough of a value for us to put it together.
I post the following questions as examples of the kinds of things I would hope to see as a new P2 audio experimenter:
I would like to know whether I can just use the built-in ADC capabilities for an audio application. What is the comparative quality of the audio signal that I can digitize with a simple circuit before I must consider adding an off-board ADC chip? What is the relative noise floor of audio that has been digitized and then reconstructed through the P2 with the DAC streaming?
What are the top few modes I should consider for audio conversion on a smartpin, and what are the specific trade-offs between them, practically speaking?
Where are the pointers to good reference circuits for effective impedance matching external sources?
I hope that we can keep this on the "field guide" track and avoid delving too much into theory. I like reading that too, but there is an appropriate time and place for everything. It is time for curation and consolidation of the vast knowledge in this form. This will help drive understanding and adoption of the P2.
Comments
As for the sound quality specs, most experimenters here just make it roughly work and don't stop to measure the results. As long as it sounds okay on the $5 speakers we're good to go.
Although, some math will probably be necessary as well as some basics on how the converters work in an applied sense.
In contrast (for example), I'm not sure having an impulse response diagram will help users as much unless it comes along with a "here's how to understand impulse response" guide. So hopefully we end up with something that is either a list of references and links that can be pulled together, or we have a topic list or outline that comes together with suggestions.
In terms of getting hard measurements, as long as we indicate what people have measured or calculated as anecdotal as it is, then I think it is good to have some basic characterization data. I'm also a tinkerer and as prone to plugging it in and listening and nodding as the next person, but I'm hoping we can save some users from having to experiment and learn how to measure these things before they decide whether to go forth (pun intended) with the P2 or to look at a set of chips instead. Letting potential users know that (when) everything they need is already on the die will be a significant boost to P2 uptake when the time comes.
The relative performance of smart pins for ADC conversion is a particularly interesting question, given the unique capabilities already onboard the P2. Even more so with the high sampling rate (by audio standards) even if the bit depth is not that of a dedicated audio chip. Figuring out how to map this to a domain of applications which are "well within bounds" for doing everything on the P2 is going to take some experimentation for the marginal cases, but it can be more easily estimated for others which are on the 8-bit ADC end of the spectrum. Testing will always be needed to prove things out for any given application, of course.
It also seems clear to me that we're not going to be able to author a field guide in place. So maybe the second closest goal to that is figuring out collectively what the venn diagram of topics for a good level 1 guide would be and finding example content or libre content that can go into one. If anybody has links to "entry level" theory, "design guide" information, or other useful things to kick start this list, I kindly ask you to link it here. I'll try to spend more time finding resources to link here as well when my own schedule permits.
A table, for the Prop2, of the Smartpin ADCs for effective bit depth vs sample rate vs Vio could be very helpful.
Before I post it here, I want to have Chip or Ken or someone review it to make sure it isn't too duplicitous or otherwise a distraction.
If it looks like it will be complimentary to other documentation efforts, and the Parallax crew agree on the format/approach of it, we'll continue with more information in this thread.
I'll post an update on the outcome of that either way.
We're about to have a go at seeing if we can improve DAC quality using an adjacent pin as a 'fine trim' (earlier testing showed around a 0.2 small nonlinearity in the dac graph. I believe we can compensate that out and also extend the effective number of bits using a LUT table
@Twyxx - It would be great if more work can be undertaken in characterisation in the analog area as the P2 offers so much promise - given the possibility of having DAC's/ADC's on every pin.
When I did this work I was quite limited in the quality of test equipment to hand. Access to a really low distortion sine wave oscillator - whose performance had been independently verified - would have been very handy in order to really pin down what was happening with the P2.