Multiplexer Restores Analog Inputs To Flash Microcontroller

March 6, 2000
Several years ago, I designed a remote energy-control system that split a building into sections and wired the overhead space heaters into "zones." As space was an issue and OAC5s (optically isolated output modules) were way too big, each...

The Microchip PIC16F877 microcontroller provides data acquisition, digital I/O, and parallel port communication in an easy-to-use package. However, by design, if the parallel slave port is used, the analog input channels 5 through 7 aren't available.

The circuit shown in Figure 1 restores these analog inputs by adding a 74HC4053 multiplexer IC and one resistor. Notice that resistor R1 is required because port RA4 of the flash microcontroller is an open-drain output

Regaining the use of these analog inputs does require some additional hardware and software overhead. The user must disable the parallel slave port when reading the analog inputs. This should not present a problem. In a typical data-acquisition application, all eight channels are read. Then the results are passed on via the parallel slave port.

Adding the multiplexer does add between 40 and 100 Ù of series resistance to these inputs. Using an appropriate op amp to condition these inputs will eliminate this as a design issue.

The code listing provides the two subroutines necessary for enabling and disabling readings from analog input channels 5 through 7. Note that these subroutines are sufficient for analog-to-digital conversions based on polling the GO/DONE bit of ADCON0. If interrupt-based A/D conversions are used, however, it would be necessary to disable the A/D interrupt to use the parallel slave port, and enable it to use the analog-to-digital converter.

The circuit and code listing provided have been tested using an IBM PC and one of its printer ports for parallel communication. To do this, additional circuitry is required to complete the interface. Also, the microcontroller must be stepped through desired functions. A Windows-based demonstration program, using parallel port 0378H and displaying all eight analog inputs, is available from the author.

Sponsored Recommendations

What are the Important Considerations when Assessing Cobot Safety?

April 16, 2024
A review of the requirements of ISO/TS 15066 and how they fit in with ISO 10218-1 and 10218-2 a consideration the complexities of collaboration.

Wire & Cable Cutting Digi-Spool® Service

April 16, 2024
Explore DigiKey’s Digi-Spool® professional cutting service for efficient and precise wire and cable management. Custom-cut to your exact specifications for a variety of cable ...

DigiKey Factory Tomorrow Season 3: Sustainable Manufacturing

April 16, 2024
Industry 4.0 is helping manufacturers develop and integrate technologies such as AI, edge computing and connectivity for the factories of tomorrow. Learn more at DigiKey today...

Connectivity – The Backbone of Sustainable Automation

April 16, 2024
Advanced interfaces for signals, data, and electrical power are essential. They help save resources and costs when networking production equipment.

Comments

To join the conversation, and become an exclusive member of Electronic Design, create an account today!