Design Ideas: October 13, 1994
Experiments show that you can safely raise the µC's low reference input (VRL) if you keep it lower than the high reference input (VRH). Thus, you can devise a µC test circuit that performs its own reference-voltage tests. You can also use this adjustable-reference setup to construct an ADC system having an effective 10- or 11-bit resolution.
The test setup takes advantage of the µC's synchronous serial interface (SPI port) for high-speed peripheral communications. The pair of MAX543 12-bit serial-input D/A-converters attached to the µC's SPI port provides the µC with the two adjustable reference voltages that are under the µC program's control.
The SPI port of 68HC11 operates as a master, and the D/A converters operate as slaves. The µC's parallel-port outputs, PA3 and PA4, select one of the D/A controllers for programming as appropriate. Because communication needs to occur in only one direction, pin SS of SPI on drawing is unused, and you should configure it as an output.
In this circuit, the SPI-output stages are open-drain connections. Therefore, the circuit needs the two pullup resistors. You can program the µC's SPI outputs for push-pull operation (no resistors needed). For circuits having minimal loading, this alternative might be the best.
Using standard dynamic-test methods (sine-wave histogram testing), this setup has measured the integral nonlinearity (INL) of one sample µC's 8-bit converter. The converter showed good characteristics, even for a reference voltage less than 1V. For the tested device, INL was approximately 0.4 LSB at room temperature with a 1.25V reference. INL increased significantly at 50°C. At 70°C, INL reached its specified limit of 1 LSB, but even then no missing codes were detected.
Consider the reference voltage's settling time. The MC68HC11 µC performs analog-to-digital conversions as a sequence of four operations. Do not change references during this sequence. Sampling periods (6 µsec/12 clock cycles) between SAR periods (10 µsec/20 clock cycles) are not long enough for reference adjustment.
The ZIPfile attached to the EDN Readers' bulletin-board system /DI_SIG DI [#]1596 includes assembler subroutines for handling the converter, writing results to external memory, converting digital to ASCII, handling the SPI port, dumping memory to the serial bus, and more. The listings are far too long to reproduce here. (DI [#]1596)