An R-2R resistor ladder is a nice little method of doing digital to analog conversion.
The one I made is 8-bit, so it can output 256 different voltages from 0V to 3.3V. Here are some pics:
You can see on my oscilloscope that I'm generating a saw wave. All I'm doing is counting from 0 to 255 really fast over and over again, and putting the number onto the 8 pins of the PIC that are connected to the resistor ladder. You can also see on the oscilloscope that the wave isn't perfectly straight, and that's because of the resistors' tolerance that is differing the resistance slightly. There's nothing I can do to fix that, except use resistors with smaller tolerance.
Here's a close up pic of the ladder:
If you want to learn more about this take a look at the wikipedia page here.
The one I made is 8-bit, so it can output 256 different voltages from 0V to 3.3V. Here are some pics:
You can see on my oscilloscope that I'm generating a saw wave. All I'm doing is counting from 0 to 255 really fast over and over again, and putting the number onto the 8 pins of the PIC that are connected to the resistor ladder. You can also see on the oscilloscope that the wave isn't perfectly straight, and that's because of the resistors' tolerance that is differing the resistance slightly. There's nothing I can do to fix that, except use resistors with smaller tolerance.
Here's a close up pic of the ladder:
If you want to learn more about this take a look at the wikipedia page here.