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

Highly Integrated 20A Digital Power Module for High Current Applications

March 20, 2024
Renesas latest power module delivers the highest efficiency (up to 94% peak) and fast time-to-market solution in an extremely small footprint. The RRM12120 is ideal for space...

Empowering Innovation: Your Power Partner for Tomorrow's Challenges

March 20, 2024
Discover how innovation, quality, and reliability are embedded into every aspect of Renesas' power products.

Article: Meeting the challenges of power conversion in e-bikes

March 18, 2024
Managing electrical noise in a compact and lightweight vehicle is a perpetual obstacle

Power modules provide high-efficiency conversion between 400V and 800V systems for electric vehicles

March 18, 2024
Porsche, Hyundai and GMC all are converting 400 – 800V today in very different ways. Learn more about how power modules stack up to these discrete designs.

Comments

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