To test products in my R&D lab, I build many universal data-acquisition systems that connect to a PC or another controller through RS-232 links or LANs. These small systems typically include multiple ADC, DAC, and digital-I/O channels to control various hardware functions during product design and development. Over the years, I have established a simplified analogue-interface standard that spans a 0 to 5V range. On the digital side, many of the newer logic families no longer tolerate 5V inputs and have rendered 5V-only digital-I/O ports obsolescent. To solve the problem, I designed a flexible digital-interface circuit around a MAX7301 I/O expander from Maxim Integrated Products and a programmable linear-power supply comprising a MAX1658 adjustable linear-voltage regulator under the control of a MAX5400 256-position, digitally programmable potentiometer. This circuit provides a programmable interface matching the logic levels of ICs that require 2.5, 3, 3.3, and 5V power supplies.

EDNAOL 2016JUN16 AN 02Figure: A programmable power supply sets voltage thresholds for a universal digital-I/O device.

Two SPIs (serial-peripheral interfaces) control all 20 of the MAX7301AAI's input and output pins and voltage thresholds (figure). Unlike some SPI-port expanders that include weak, resistor-only pullups, the MAX7301, IC1, features true, active-pullup, "totem-pole" outputs that can source higher currents. When powered by the SPI-programmable linear regulator, the MAX7301's outputs can deliver logic levels of 2.5 to 5V. The programming interfaces for both devices comprise two three-wire (plus ground) SPI connections that use only six of the controller's signal lines. Six Vishay Si 1012R low-gate-voltage-threshold N-channel MOSFETs, Q1 through Q6, isolate the controllers' fixed-output-voltage levels from IC1's variable-input-threshold voltages. Although any of several IC-level-translator ICs work equally well, the inexpensive MOSFET buffers occupy small footprints on the interface's PCB (printed-circuit board). For operation at serial-interface clock rates approaching IC1's 26MHz maximum, optimise the values of resistors R1 through R6 to provide adequate rise times at the selected clock rate. These values are adequate for operation at the 1MHz SPI clock rate that a low-power microcontroller produces. To alter the circuit's output-voltage level, IC2, a 256-step Maxim MAX5400 digital potentiometer, controls IC3, a Maxim MAX1658 adjustable-voltage linear regulator. Writing all zeros to IC2 sets IC3's output voltage to slightly more than 5V, and writing all ones (255 decimal) to IC2 reduces IC3's output voltage to slightly less than 2.5V. To compensate for component tolerances, the circuit provides enough voltage overrange to cover the full 2.5 to 5V range. Writing 128 (decimal) to IC2 should produce a nominal 3.25V output. Measure IC3's actual output voltage and subtract it from the nominal voltage to produce an offset count for calibration correction. In operation, the host controller sets IC3's regulated output voltage through IC2 and determines the maximum voltages of IC1's logic inputs and outputs. Next, the controller configures IC1's inputs and outputs as necessary for the interface task at hand. The MAX7301's standard CMOS logic-threshold voltages of 0.3 to 0.7 times its supply voltage for low and high inputs, respectively, interface with other CMOS parts.
This article is a Design Idea selected for re-publication by the editors. It was first published on March 15, 2007 in