GPIO exercises
4-bit R-2R D/A converter
Use four port bits (P2.0, P2.1, P2.2 nd P2.3) to create an R-2R DAC. Connect 20k resistors to the four port pins, and connect the opposite end of the neighbouring resitors with 10k resistors. Ground the opposite end of the 20k reistor connected to P2.0 via an additional 20k reistor. The output is the opposite terminal of the resistor connected to P2.3. Configure the port bits to push-pull mode. Measure the transfer function of this DAC with a digital multimter for the 16 possible states.