Disclosure of Invention
In view of the above, the main objective of the present invention is to minimize the number of ports required for mode selection of an integrated circuit, and to reduce the number of external ports, thereby saving the PCB layout area and reducing the number of external devices, and achieving miniaturization and low cost of products.
In order to achieve the above object, the present invention provides a single port mode selection circuit, which is characterized by comprising a constant current source, a comparator, a logic control circuit, a divider resistance network, a multiplexer and a decoder; the input of the constant current source circuit is connected with a reference voltage VREFThe output is connected with an external MODE setting resistor R through a MODE pinMODEIs connected to the positive input terminal of the comparator, and a mode setting resistor RMODEThe other end of the first and second electrodes is grounded; one end of the divider resistor network is connected with a reference voltage VREFThe other end of the voltage divider is connected with the ground, the voltage division values of the voltage division resistance network are respectively connected with the input end of the multi-path selector, and the output end of the multi-path selector is connected with the negative input end of the comparator; the output end of the comparator is connected with the holding control end of the logic control circuit, the clock signal CLK is connected with the CLK port of the logic control circuit, and the output signal of the logic control circuit is connected with the selection control end of the multiplexer and is simultaneously connected with the input end of the decoder;
during operation, the logic control circuit performs binary sequential counting under the control of a clock signal CLK, selects a voltage division value through the multiplexer in each clock period, and is connected with an external MODE setting resistor R connected with a MODE pinMODEThe generated pattern recognition voltage VMODEMaking a comparison at the comparator if VMODEThe comparator controls the logic control circuit to continue counting through the holding control end of the logic control circuit, if the mode identification voltage V is different from the selected voltage division valueMODEThe comparator controls the logic control circuit to keep the current count value through the holding control end of the logic control circuit, and the count value is decoded by the decoder to select the working mode.
The invention also provides a multi-working mode integrated circuit which is characterized in that the single-port mode selection circuit is adopted to select the working mode.
The single-port mode selection circuit has the advantages that compared with the traditional decoder circuit structure, the single-port mode selection circuit introduces the constant current source and the mode setting resistor RMODEA control loop consisting of a divider resistor network, a multiplexer, a comparator and a logic control circuit, and a MODE setting resistor R connected with the MODE pinMODEThe generated different pattern recognition voltages VMODEConversion to input digital code Q of decoder1、Q2……QnDifferent mode setting resistor RMODECorresponding to different digital codes Q1、Q2……QnThe decoder is used for replacing input signals of a traditional decoder structure, effectively reducing the number of ports, realizing single-port mode selection, effectively saving the PCB layout area, reducing the number of external devices and realizing product miniaturization and low cost.
Detailed Description
A single-port mode selection circuit for integrated circuit operation mode selection and an integrated circuit including the same according to the present invention will be described in detail with reference to the accompanying drawings.
Fig. 2 shows a schematic diagram of the single port mode selection circuit of the present invention. As shown in the figure, the single-port mode selection circuit provided by the invention comprises a decoder, and a constant current source and a mode setting resistor RMODEA control loop consisting of a divider resistor network, a multiplexer, a comparator and a logic control circuit, and a setting resistor R for setting different external MODEs connected with the MODE pinMODEThe generated different pattern recognition voltages VMODEConversion to input digital code Q of decoder1Q2…QnDifferent mode setting resistor RMODECorresponding to different digital codes Q1Q2...QnThe method is used for replacing input signals of a traditional decoder structure, effectively reduces the number of ports, realizes single-port mode selection, and is a natural number more than or equal to 2.
The specific connection relationship of the single-port mode selection circuit is as follows: the input of the constant current source circuit is connected with a reference voltage V
REFThe output is connected with an external MODE setting resistor R through a MODE pin
MODEAnd is connected with the positive input end of the comparator, and one end of the divider resistor network is connected with a reference voltage V
REFThe other end is connected with ground, the voltage division value of the voltage division resistance network is connected with the input end of the multiplexer, and the output end V of the multiplexer
OThe negative input end of the comparator is connected, and the output end of the comparator is connected with the holding control end of the logic control circuit
The clock signal CLK is connected with the CLK port of the logic control circuit, and the output signal Q of the logic control circuit
1Q
2…Q
nThe selection control end of the multiplexer is connected, and the input end of the decoder is connected.
Fig. 3 is a schematic diagram of a constant current source circuit of the present invention. As shown in the figure, the constant current source comprises an error amplifier, an NMOS tube MN1, a PMOS tube MP1, a PMOS tube MP2 and a resistor R, and the reference voltage VREFThe positive input end of the error amplifier is connected, the output end of the error amplifier is connected with the grid electrode of an NMOS (N-channel metal oxide semiconductor) tube MN1, the source electrode of an NMOS tube MN1 is connected with a resistor R and the negative input end of the error amplifier, the drain electrode of an NMOS tube MN1 is connected with the grid electrode and the drain electrode of a PMOS tube MP1 and simultaneously connected with the grid electrode of a PMOS tube MP2, and the source electrodes of the PMOS tube MP1 and the PMOS tube MP2 are connected with a power supply voltage VINForming a current mirror structure, connecting the drain of the PMOS transistor MP2 with the MODE pin, the error amplifier andthe NMOS transistor MN1 forms a unit feedback control loop, and the voltage of the source end of the NMOS transistor MN1 is ensured to be equal to the reference voltage V through the feedback control loopREFThus, it can be determined that the current through R is VREFThe current is mirrored to the drain end of the PMOS tube MP2, namely a MODE port through a 1:1 current mirror consisting of the PMOS tube MP1 and the PMOS tube MP2, so that the output current of the constant current source can be determined to be IMODE=VREF/R。
The voltage-dividing resistance network is composed of 2nThe equal resistors are connected in series to divide the voltage into 2nEqual parts of, wherein V1=VREF/2n,V2=2×VREF/2n,…,Vi=i×VREF/2n…V2n=2n×VREF/2n=VREF。
The logic control circuit has two input ports, n output ports, the input ports are respectively clock input CLK and hold signal input
The output port is Q
1、Q
2…Q
nThe main function of the logic control circuit is that when the signal is kept, the n-bit digital code is output
At high level, output port data Q
1Q
2…Q
nGradually increasing in binary from the least significant bit (all 0) to the most significant bit (all 1) according to the number of clock cycles of the clock signal CLK while holding the signal
At low level, output port data Q
1Q
2…Q
nThe hold state is entered and no longer changes with the clock signal CLK. It is also contemplated that the circuit may be modified such that the logic control circuit performs a binary count by gradually decrementing the binary count when the logic control circuit enters the hold state when the hold signal is high.
The multiplexer has2nOne input signal, n bit selection control signal, 1 output signal VOThe main function that the multiplexer implements is to be 2nThe input signals are respectively connected with the output signal strobe V according to the decoding mode of the n-bit selection control signalOI.e. when Q1、Q2…QnWhen all 0 is set to V1And VOGating VO=V1When Q is1、Q2…QnWhen all 1 is reached, V is2nAnd VOGating VO=V2n。
The decoder has an n-bit input signal, 2nAn output signal, the decoder performing the main function of translating an n-bit input signal to 2nThe output control signals corresponding to each n-bit input signal are only one, namely D1, D2, … and D2 are output at each timenOnly one bit being active, i.e. when Q1、Q2…QnD1 is valid for all 0 s, and the remaining bits are all invalid when Q is equal1、Q2…QnTime D2 of all 1nValid, the remaining bits are all invalid.
Examples
Fig. 4 is a schematic diagram of a single-port eight-mode selection circuit according to an embodiment of the invention. As shown in the figure, the single-port mode selection circuit comprises a constant current source and a mode setting resistor R in an eight-mode selection circuit
MODEA comparator, a three-bit output logic control circuit, an eight-equal-division resistor network, an eight-out-of-one multiplexer and a three-eight decoder, wherein the input of the constant current source circuit is connected with a reference voltage V
REFThe output is connected with an external MODE setting resistor R through a MODE pin
MODEAnd connected to the positive input end of the comparator, and an eight-equal-division resistor network consisting of resistors R
1、R
2、R
3、R
4、R
5、R
6、R
7、R
8Are connected in series, one end of the resistor network is connected with V
REFThe other end is connected with the output end V of the voltage-dividing resistor network
1、V
2、V
3、V
4、V
5、V
6、V
7、V
8The input end of the one-out-of-eight selector is connected,output end V of one-out-of-eight selector
0The negative input end of the comparator is connected, and the output end of the comparator is connected with the holding signal input end of the first-stage trigger D1
The positive output end Q1 AND the comparator output end of the first stage flip-flop D1 are respectively connected with two input ends of a first AND gate AND1, AND the output end of the first AND gate AND1 is connected with the holding signal input end of the second stage flip-flop D2
The positive output end Q2 AND the output end of the first AND gate AND1 of the second stage flip-flop D2 are respectively connected with two input ends of a second AND gate AND2, AND the output end of the second AND gate AND2 is connected with a holding signal input end of a third stage flip-flop D3
The D end of each stage of trigger is connected with the reverse output end
The terminals C l k of each stage of flip-flop are connected to a clock input signal CLK and a positive output terminal signal Q of the three-stage flip-flop
1、Q
2、Q
3Respectively connected with the selection control end of the one-out-of-eight selector and the input end of the three-eight decoder.
The present embodiment employs a constant current source as shown in fig. 3.
The single-port eight-MODE selection circuit provided by the embodiment of the invention sets the resistor R by changing the MODE connected to the MODE portMODETo determine the working mode, the constant current source outputs a current IMODEFlow-through mode setting resistor RMODEGenerating a mode setting voltage VMODEMode setting voltage VMODE=VREF/R*RMODEDue to IMODEConstant, so that the resistance R can be set by changing the peripheral modeMODETo set different pattern recognition voltages VMODE。
In the single-port eight-mode selection circuit of the embodiment of the invention, an eight-equal-division resistor network is composed of resistors R1、R2、R3、R4、R5、R6、R7、R8Are connected in series to form1=R2=R3=R4=R5=R6=R7=R8The divider resistor network will divide VREFIs divided into V1、V2、V3、V4、V5、V6、V7、V8Eight different reference voltages, eight reference voltages obtained by voltage division are connected with the input end of an eight-to-one selector, and the eight-to-one selector enables the eight input reference voltages to be controlled according to three selection control signals Q1、Q2、Q3The decoding mode is respectively compared with the output end V of the one-out-of-eight selectorOGating, when Q1、Q2、Q3When is 000, V is1And VOStrobes, i.e. VO=V1When Q is1、Q2、Q3When it is 100, V2And VOStrobes, i.e. VO=V2And so on, when Q1、Q2、Q3When it is 111, V8And VOStrobing strobe, i.e. VO=V8=VREF。
The comparator circuit of the single-port eight-mode selection circuit of the embodiment of the invention sets the resistor R from the external modeMODESet pattern recognition voltage VMODEAnd one-out-of-eight selector based on control signal Q1、Q2、Q3Gated reference voltage VOThe comparison is carried out under the control of a logic control circuit consisting of D1, D2, D3, AND1 AND AND2, AND Q is obtained in the first clock cycle1、Q2、Q3An initial value of 000, i.e. VO=V1If V isMODEGreater than V1If yes, the comparator output is high, the flip-flop D1 is in a trigger state, and the flip-flops D2 and D3 are in a hold state; second clock cycle, Q1、Q2、Q3Becomes 100, i.e. has VO=V2If V isMODEIs still greater than V2Then the comparator output is still highFlip-flops D1 and D2 are in the on state, flip-flop D3 is in the hold state, and the third clock cycle, Q1、Q2、Q3To 010, i.e. having VO=V3If V isMODEIs still greater than V3Then the comparator output remains high, flip-flop D1 is in the toggle state, flip-flops D2, D3 are in the hold state, and the fourth clock cycle, Q1、Q2、Q3Becomes 110, i.e. has VO=V4If V isMODEIs still greater than V4Then the comparator output remains high, flip-flops D1, D2, D3 are all in the toggle state, and the fifth clock cycle, Q1、Q2、Q3Become 001, i.e. having VO=V5If V isMODEIs still greater than V5Then the comparator output remains high, flip-flop D1 is in the toggle state, flip-flops D2, D3 are in the hold state, and the sixth clock cycle, Q1、Q2、Q3Becomes 101, i.e. has VO=V6If V isMODEIs still greater than V6Then the comparator output remains high, flip-flops D1, D2 are in the toggle state, flip-flop D3 is in the hold state, and the seventh clock cycle, Q1、Q2、Q3Becomes 011, i.e. has VO=V7If V isMODEIs still greater than V7Then the comparator output remains high, flip-flop D1 is toggle, flip-flops D2, D3 are hold, and the eighth clock cycle, Q1、Q2、Q3Becomes 111, i.e. has VO=V8In the comparison process, if V appearsMODELess than VOThen the comparator output is low, flip-flops D1, D2, D3 enter hold state at the same time, Q1、Q2、Q3The output value no longer varies with the input clock, at which point Q1、Q2、Q3The output value is the control code corresponding to the working mode, and the mode identification voltage V is obtained by the comparator and the logic control circuitMODEAnd Q1、Q2、Q3Output digital code one-to-one correspondence, specific mode state correspondenceIs shown in FIG. 5, Q1、Q2、Q3And finally, converting the output value into eight specific working modes through a three-eight decoder, thereby realizing single-port eight-mode selection.
The single-port mode selection circuit can be integrated into an integrated circuit, so that the single-port mode selection of the integrated circuit with multiple working modes is realized.
The above embodiments show the specific implementation principle of the single-port eight-mode selection circuit in detail, and more embodiments based on the architecture, such as the single-port four-mode selection circuit, the single-port sixteen-mode selection circuit, and the single-port 2nThe mode selection circuit is within the scope of the present invention.