- Discrete LEDs
- Dot/Bar LEDs
- Matrix LEDs
- 7-Seg LEDs
- Serial -- Software
- Serial -- Hardware
- RS-232 via the MAX3232
- I2C -- EEPROM
- I2C -- DS1307 Real Time Clock
- 1-Wire -- DS18B20, Powered, Single-Drop
- 1-Wire -- DS18B20, Powered, Multi-Drop
- 1-Wire -- DS18B20, Parasitic, Multi-Drop
- TI Link Protocol -- Calculator Demo
- Infrared Communication
- MIDI -- Output Demo
- MIDI -- Input Demo
- MIDI to Analog Synth
4-Bit DAC Demo
Here we'll increase the resolution to 4 bits, giving 16 discrete voltage steps. This uses an old (but superior) topology known as R-2R, since it is a ladder made up of two sets of resistors, one set double in value of the other. It's been around forever, but I first saw it in Don Lancaster's CMOS Cookbook, (Indianapolis: Howard W. Sams & Company, 1977), pp. 288, 289. That, by the way, is still one of my favorite reads; I'm always getting something clever from it.
I've added a buffer/amplifier/shifter to transform the waveform to 10Vpp, a common music synthesizer standard. In the demo software, the frequency is about 1 kHz. The resulting waveform looks like this:
I found that I needed a 10pF feedback cap on the op-amp to eliminate an undershoot at the start of the signal. This may have been a result of the breadboard.
Click to get the source code.
Click to get the schematic PDF.
Next Project: 4-Bit Internal DAC Demo