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

Board-Mount DC/DC Converters in Medical Applications

March 27, 2024
AC/DC or board-mount DC/DC converters provide power for medical devices. This article explains why isolation might be needed and which safety standards apply.

Use Rugged Multiband Antennas to Solve the Mobile Connectivity Challenge

March 27, 2024
Selecting and using antennas for mobile applications requires attention to electrical, mechanical, and environmental characteristics: TE modules can help.

Out-of-the-box Cellular and Wi-Fi connectivity with AWS IoT ExpressLink

March 27, 2024
This demo shows how to enroll LTE-M and Wi-Fi evaluation boards with AWS IoT Core, set up a Connected Health Solution as well as AWS AT commands and AWS IoT ExpressLink security...

How to Quickly Leverage Bluetooth AoA and AoD for Indoor Logistics Tracking

March 27, 2024
Real-time asset tracking is an important aspect of Industry 4.0. Various technologies are available for deploying Real-Time Location.

Comments

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