Technical Field
This invention relates to methods and circuits for multiplexing an input port and an output port of a microprocessor into a single external interface.
Background Art
There are times in which a product is manufactured with a microprocessor having a pin/port that functions as both an input port and an output port. Testing and verification of this product typically involves using a testing interface that has one port that also functions as an output port and an input port. However, if a subsequent model of the product is manufactured with a microprocessor having separate ports to perform the functions of the single input/output port, then the testing interface is no longer feasible for mating with the product. The testing/development engineer must build a new testing interface to accommodate the new version of the product, thereby incurring extra cost and complexity.
Disclosure of the Invention
It is thus a general object of the present invention to provide a method and circuit interface for multiplexing a separate input port and a separate output port of a microprocessor into a single external interface for use with testing interfaces that embody only one port.
In carrying out the above object and other objects, features, and advantages of the present invention, a method is provided for multiplexing an input port and an output port of a microprocessor into a single external interface, the microprocessor having control logic for preventing operation of the input port and the output port at the same time. The method includes providing a resistor network coupled between the output port and the single external interface for receiving an input signal from the single external interface for receipt by the input port and for receiving an output signal from the output port for receipt by the single external interface. The method further includes translating the input signal from the resistor network into a second input signal recognizable by the input port. Finally, the method includes providing power to the input port so as to enable the input port to recognize the second input signal.
In further carrying out the above object and other objects, features, and advantages of the present invention, a circuit interface is provided for carrying out the method steps described above. The circuit interface includes a resistor network, a level shifter, and a power supply. The resistor network is coupled between the output port and the single external interface for receiving an input signal from the single external interface for receipt by the input port and for receiving an output signal from the output port for receipt by the single external interface. The level shifter is coupled to the input port and the resistor network for translating the input signal from the resistor network into a second input signal recognizable by the input port. The power supply is coupled to the resistor network and the level shifter for providing power to the input port so as to enable the input port to recognize the second input signal.
The above object and other objects, features and advantages of the present invention are readily apparent from the following detailed description of the best mode for carrying out the invention when taken in connection with the accompanying drawings.
Brief Description of the Drawings
FIG. 1 is a block diagram of the circuit interface of the present invention;
FIG. 2 is a schematic diagram of the circuit interface of the present invention; and
FIGS. 3a-3c are graphs illustrating simulation results for operation of the circuit interface when the output port is active and the single external interface is open;
FIGS. 4a-4c are graphs illustrating simulation results for operation of the circuit interface when the output port is grounded and the single external interface is open; and
FIGS. 5a-5c are graphs illustrating simulation results for operation of the circuit interface when the output port and the single external interface are grounded.
Best Modes for Carrying Out the Invention
Turning now to FIG. 1, there is shown a block diagram of the circuit interface of the present invention, denoted generally by reference numeral 10. A microprocessor 12 having an input port 14 and an output port 16 are coupled to the circuit interface 10 to provide a single external interface 18. The microprocessor 12 includes control logic (not shown) for preventing operation of the input port 14 and the output port 16 at the same time. That is, the input port 14 and the output port 16 are never utilized during the same time period.
The circuit interface 10 includes a resistor network 20, coupled between the output port 16 and the single external interface 18, for combining the input port 14 and the output port 16. The resistor network 20 receives an input signal from the single external interface 18 for receipt by the input port 14 and receives an output signal from the output port 16 for receipt by the single external interface 18.
The circuit interface 10 further includes a level shifter 22 coupled to the input port 14 and the resistor network 20 for translating the input signal from the resistor network 20 into a second input signal recognizable by the input port 14. The level shifter 22 is needed since the resistor network 20 prevents the full power voltage from reaching the input port 14. There is typically a minimum voltage which the input port 14 will recognize as a "high" and a maximum voltage which the input port 14 will recognize as a "low". Since the resistor network 20 reduces the voltage to the input port 14 to a point below this minimum threshold, the voltage must be increased, or shifted up, to the correct reference level.
Finally, the circuit interface 10 includes a power supply 24 coupled to the input port 14 and the resistor network 20 for providing power to the input port 14 so that the input port 14 can recognize the input signal translated by the level shifter 22. The power supply 24 is compatible with the microprocessor being used, such as a 5 volt DC power supply.
Turning now to FIG. 2, there is shown a schematic diagram of the circuit interface 10 of the present invention. Resistor network 20 is preferably a voltage divider consisting of resistors R1 and R2 connected in series between the power supply 24 and level shifter 22. Resistor R2 has an impedance which is significantly larger than an impedance of resistor R1 in order to minimize the effect of the power supply 24 on the signal from the output port 16. Resistor R1 is preferably 3.3 kilohm and R2 is preferably 47 kilohm.
A third resistor R3 is coupled to the resistor network 20 between the voltage divider resistors R1 and R2 at one terminal and the output port 16 at the other terminal so as to further prevent power from being supplied to the output port 16. In automotive vehicle applications, resistor R3 also prevents damage from occurring at the output port 16 in the event of any unusual transient voltages that may be applied to the single interface 18. Resistor R3 is preferably 1 kilohm.
Level shifter 22 consists of an NPN transistor Q1 for switching the voltage from resistor R2 ON and OFF in order to reach the full voltage supplied from the power supply 24, i.e., 5 volts, at the input port 14. (Anything else we should add here about the level shifter?) In order to limit the current through the transistor Q1 to a safe level, a limiting resistor R4 is coupled between the transistor Q1 and the power supply 24. Resistor R4 is preferably 47 kilohm.
To aid in reducing electromagnetic interference, an RC circuit is included in the circuit interface 10. The RC circuit consists of a resistor R5 and a capacitor C1. Resistor R5 is coupled between the output of the resistor network 20, or voltage divider, between resistors R1 and R2, and the single external interface 18. Capacitor C1 is coupled between resistor R5 and the single external interface 18 at one terminal and coupled to ground at another terminal. Preferably, resistor R5 is 100 ohm and capacitor C1 is 100 pF.
Simulations were performed to verify operation of the circuit interface 10. The circuit interface 10 should provide certain results as defined below:
1) If output port 16 is active and the interface 18 is open, then an output signal should appear at the single external interface 18, as illustrated in FIGS. 3a-3c;
2) If the output port 16 is active and the single external interface 18 is grounded, then there should be no damage to the output port 16;
3) If the output port 16 is grounded (i.e., not active) and the single external interface 18 is open, then 0 volts should appear at input port 14, as shown in FIGS. 4a-4c; and
4) If the output port 16 is grounded and the interface 18 is grounded, then a 5 volt signal should appear at input port 14, as shown in FIGS. 5a-5c.
While the best modes for carrying out the invention have been described in detail, those familiar with the art to which this invention relates will recognize various alternative designs and embodiments for practicing the invention as defined by the following claims.