EDN Access -- 07.07.94 12-bit converter upgrades µC's AD
Design Ideas:July 7, 1994
12-bit converter upgrades µC's ADC
Maxim Integrated Products, Sunnyvale, CA
The simple circuit in Fig 1 and an accompanying software routine let you easily substitute a multichannel 12-bit ADC for the 8-bit ADC internal to the 87C752 µC. A single assembly can then implement both the low- and high-performance version of a system. A socket lets you plug in the external ADC when you need it; otherwise, you plug in the network of 10 100V resistors. At power-up, the µC executes a routine that looks for the external converter. If the converter is present, the µC uses the external ADC. If the converter is absent, the 8-bit ADC takes over. The mC internally handles all conversion results as 12-bit values.
This idea relies on the fact that the 87C752's five ADC input pins can also serve as the bidirectional pins of an 8051 port (Port 1). The resistor network connects the internal ADC directly to the applied analog inputs. Alternatively, replacing the network with the external ADC connects those inputs to corresponding channels on that converter, and the mC's ADC input pins (now acting as a bidirectional port) serve as a digital interface to the converter.
The assembly-language software routine attached to EDN BBS /DI_SIG #1554 determines the presence of an external converter by triggering a conversion and noting whether the converter's busy flag (SSTRB) goes low. If it does, the µC sets an internal global flag (AD12) that tells it to use the external-converter routines for each subsequent conversion. This action is transparent to the calling routine. The conversion result, returned as bytes ADHI and ADLO, has the same format in either an internal- or external-ADC case, except the four LSBs are 0 for 8-bit converter data.
The µC's full-scale range is 5V, but the MAX186 ADC sets it full-scale input range with an internal reference of 4.096V. Software resolves the incompatibility in this example, but you can also use a different ADC, such as the MAX188, with an external 5V reference. (DI #1554)EDN Magazine. EDN is a registered trademark of Reed Properties Inc, used under license.