Following @Elliot Williams on youtube I noticed his next "logic noise" HaDblog post will feature R-2R DACs and an hour later I had this idea for a little project, using a shift register with some 6.8kOhm resistors I have too many of. Since I really liked the Idea of using the accessible ISP header on arduinos to send data to the shift register like the #tiny7 by @al1 does, I had to put this on a protoboard. Expect some weird sounds to follow, because they are nowhere near to be accurate with 5% tolerance resistors. This just screams for a self checking arduino script that writes data out and checks the output with analog input.

davedarko
討論
成為 Hackaday.io 會員
建立帳戶來新增留言 已經有帳號了? 登入.
That's awesome. I'm sure that you'll find for audio (for instance) that it works well enough.
Great call to drive it with a shift reg.
Watch the 127-128 transition (the most significant bit). That's where the worst glitching will show up. If you trim that out, 5%ers can work just fine.
It's not like a R-2R DAC is rocket science, though. They're hella forgiving and super fun.
您確定嗎? 是 | 否
I read somewhere they used this method to build sound-cards on parallel ports way back in the day... there were even products based on it.
您確定嗎? 是 | 否
https://en.wikipedia.org/wiki/Covox_Speech_Thing
您確定嗎? 是 | 否
I wonder if you could do speech synthesis with it, like https://web.archive.org/web/20150607070905/http://letsmakerobots.com/content/help-convert-blank-atmega328-speech-synthesizer-chip-under-5
您確定嗎? 是 | 否
I now remember ... it all started with a voice changer on instructables that used an arduino with a wave shield and the DAC was controlled by SPI. Seems like 4bit on a port would be much faster then a software controlled shift register though.
您確定嗎? 是 | 否
I was investigating this a few months ago as a method of building a super cheap analog value, and I think the numbers I came up with were max 5-bit accuracy with 5% resistors.
For bonus points, can you design something with tri-state outputs like a 74hc595 shift register and use a single resistor on each output as a voltage divider, using highs, lows, and high-Zs to stack resistors in parallel?
It's much harder to conceptualise, and your resistor values will need to be cleverly chosen, but it might be a fun brain problem. :)
您確定嗎? 是 | 否
Sadly I have enough brain problems already and don't quite get what you mean ;)
Most of the time I'm too lazy to do the maths and just try it out, so I'll post some graphs soon. I also have a MCP41100 or two, that should be interesting as well.
您確定嗎? 是 | 否
http://imgur.com/wUbhKX5
Drew a couple possible equivalents. Using 5v, 0v, or high-impedance outputs on the shift register, you should be able to generate an arbitrary analog value.
您確定嗎? 是 | 否