This project is built on a simple sigma-delta DAC. The DAC is given an n-bit control word and generates a single-bit digital output where the pulse density is proportional to that control word. By integrating this pulse train, for example with an RC filter, an analogue output voltage is produced.
The ADC operates by generating an analogue output voltage which is compared to the analogue input by an off-chip comparator. The comparator result is used as a digital input to a simple control loop that adjusts the output voltage so that it tracks the input signal. The control word for the DAC generating the output voltage is then the ADC reading. This control word is regularly transmitted as hex-encoded ASCII over a UART running at the clock rate.
A second dedicated 8-bit DAC is controlled by received words over a UART.
Transmit the control word at 1/10th the clock speed into
add a second external RC circuit to filter
dac_out to an analogue voltage.
Ensure in is clocked. Connect out through a series resistor to both a capacitor to ground and the non-inverting input of a comparator. Connect the analogue input to measure to the inverting input, and connect the comparator output to in. Connect out to a UART receiver at the clock rate and receive ADC readings as hex-encoded ASCII lines.
Connect out to a second RC filter, and feed one-byte DAC settings to the UART on in at a baud rate 1/10th the clock. Measure the resulting analogue output.