- 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 Internal DAC Demo
Many of the PIC microcontrollers, like the PIC16F88, give you access to an internal DAC. In this exercise, we'll see how to do so. It's a 4-bit DAC, so has a 16-step resolution.
As you can see, the circuit is simple. The internal DAC needs to be buffered, so I also took the opportunity to amplify and level-shift the waveform. What comes out is a nominal 10Vpp (suitable for music synthesizer use). In the demo, the waveform runs near 9 kHz, but this can be slowed down with some appropriate delays in the code.
Once again, I found a 10 pF feedback cap useful for truncating the undershoot occurring on reset.
Click to get the source code.
Click to get the schematic PDF.
Next Project: 7-Bit DAC Demo