A CAN driver circuit with calibration function
By introducing a calibration function into the CAN driver circuit and adjusting the current mirror driving voltage and the on-resistance of the output stage module, the problem of poor symmetry of the traditional CAN transceiver is solved, electromagnetic interference and common mode level differences are reduced, and the circuit efficiency is improved. stability and efficiency.
Patent Information
- Application Number
- CN202410460446.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-17
- Publication Date
- 2024-09-13
- Estimated Expiration
- 2044-04-17
AI Technical Summary
Due to the lack of feedback mechanism of the driver in the traditional CAN transceiver, the symmetrical performance of CANH and CANL is greatly affected by the process, causing electromagnetic emission and interference, resulting in common mode level differences in the dominant and recessive states.
A CAN driver circuit with calibration function is designed, including current mirror drive voltage generation circuit, CAN output stage module, common mode voltage generation module, calibration channel selection module, error peak and valley value sampling circuit and calibration control code generation circuit , through static and dynamic calibration, the current mirror driving voltage and the on-resistance of the output stage module are adjusted to reduce the common mode level error.
It effectively reduces the asymmetry between the visible and hidden transitions of the CAN driver, improves the EMI characteristics of the CAN transceiver, reduces the difference in common mode levels, and saves circuit power consumption and area.
Smart Images

Figure CN118192376B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of analog circuit design, and in particular to a CAN driver circuit with a calibration function. Background Art
[0002] At present, there are many kinds of field buses in industrial electronic systems and automotive electronic systems to solve the problem of data communication between the control core and field equipment in modern industrial scenarios. The Controller Area Network (CAN) is one of the most widely used and mature field buses, especially in the automotive field. In automotive applications, the electromagnetic interference (EMI) and electromagnetic emissions (EME) of CAN transceiver communication are very high, so as to avoid the data transmission on the CAN transceiver interfering with the surrounding system; and the driver in the traditional CAN transceiver adopts an open-loop structure to generate the voltage on the bus CANH and CANL, lacking a feedback mechanism, which causes the symmetry performance of CANH and CANL to be greatly affected by the process.
[0003] Specifically, if Figure 1 As shown, in the driver structure of the traditional CAN transceiver, a current mirror is used to generate a bias voltage of the output stage power tube, thereby generating a current through an external load to generate a differential voltage. When the bus of the CAN transceiver jumps from recessive to dominant, the switches S1 and S2 connected between the current mirror and the output stage power tubes PM2 and NM3 are closed, so that the bias voltage is transmitted to the output stage power tubes PM2 and NM3. Figure 2 A in the figure shows the changes of VPbias and VNbias generated by the driver circuit during the process of explicit and implicit changes. Due to the on-resistance of switches S1 and S2, there are differences between the sum of the first capacitor CPM1 and the second capacitor CPM2, and the sum of the fourth capacitor CNM1+2 and the third capacitor CNM3. This will cause the gate terminal voltage of the output stage power tubes PM2 and NM3 to rise at different speeds, causing asymmetry in the process of the CAN transceiver jumping from implicit to explicit. Due to the difference in the on-resistance of the output stage power tube NM3 and the on-resistance of the output stage power tube PM2, the common mode level in the stable explicit state and the stable implicit state will be different. Both of these conditions will cause electromagnetic emission and interfere with the operation of devices around the CAN transceiver. The common mode voltage fluctuation of the traditional CAN transceiver during the implicit and explicit jump process is as follows: Figure 2As shown, it is divided into four types. Among them, when in the dominant state, the on-resistance of the output stage power tube NM3 is lower than the on-resistance of the output stage power tube PM2, the waveform diagram of the CANH output terminal voltage and the CANL output terminal voltage of the CAN transceiver is as follows Figure 2 As shown in (a); when in the dominant state, the on-resistance of the output stage power tube PM2 is less than the on-resistance of the output stage power tube NM3, the waveform diagram of the CANH output terminal voltage and the CANL output terminal voltage of the CAN transceiver is as shown in Figure 2 As shown in (b); during the process of display-hidden jump, the gate terminal voltage of the output stage power tube NM3 is charged faster, and the waveform diagram of the CANH output terminal voltage and the CANL output terminal voltage of the CAN transceiver is as follows: Figure 2 As shown in (c) in the figure; when the gate voltage of the output stage power tube PM2 is charged faster during the transition, the waveform diagram of the CANH output terminal voltage and the CANL output terminal voltage of the CAN transceiver is as follows: Figure 2 As shown in (d) in . Summary of the invention
[0004] In view of the problems existing in the prior art, the present invention provides a CAN driver circuit with a calibration function, which reduces the asymmetry caused by the CAN driver between explicit and implicit transitions, thereby reducing the difference between the common mode levels of the CANH output terminal and the CANL output terminal of the CAN transceiver in the explicit state and the implicit state.
[0005] To achieve the above technical objectives, the present invention adopts the following technical solutions: a CAN driver circuit with calibration function, comprising: a current mirror type drive voltage generating circuit, a CAN output stage module, a common mode voltage generating module, a calibration channel selection module, an error peak and valley value sampling circuit and a calibration control code generating circuit;
[0006] The current mirror type driving voltage generating module is used to generate an output stage driving voltage to be transmitted to the output stage module, the CAN output stage module generates a CAN transceiver current, the common mode voltage generating module is used to detect the common mode level of the CANH output terminal and the CANL output terminal of the CAN output stage module, the calibration channel selection module selects a channel with a suitable rate to perform common mode level error detection based on the different frequencies of the detected common mode level, the error peak and valley value sampling circuit obtains the maximum value and minimum value of the common mode level, the calibration control code generating circuit generates static error coding and dynamic error coding according to the maximum value and minimum value of the common mode level obtained by the error peak and valley value sampling circuit, the static error coding controls the switch closing and disconnection of the calibration current source in the current mirror type driving voltage generating circuit, and the error deviation signal of the static calibration common mode level, the dynamic error coding controls the switch closing and disconnection of the calibration resistor in the CAN output stage module, and the error deviation signal of the dynamic calibration common mode level.
[0007] Further, the current mirror type driving voltage generating circuit includes: a first main constant current source Iref1, a second main constant current source Iref2, a first group of calibration current sources Intr1~Intrn, a second group of calibration current sources Iptr1~Iptrm, switches Sintr1~Sintrn for controlling the first group of calibration current sources Intr1~Intrn, switches Siptr1~Siptrm for controlling the second group of calibration current sources Iptr1~Iptrm, a first NMOS transistor NM1 and a first PMOS transistor PM1 for generating an output stage driving voltage, the input end of the first main constant current source Iref1, the input end of the first group of calibration current sources Intr1~Intrn, and the source of the first PMOS transistor PM1 are all connected to a power supply, and the output end of the first group of calibration current sources Intr1~Intrn is correspondingly connected to one end of the switches Sintr1~Sintrn for controlling the first group of calibration current sources Intr1~Intrn, The output end of the first main constant current source Iref1 and the other end of the switches Sintr1~Sintrn for controlling the first group of calibration current sources Intr1~Intrn are connected to the drain of the first NMOS tube NM1, the gate of the first NMOS tube NM1, and the CAN output stage module; the gate of the first PMOS tube PM1, the drain of the first PMOS tube PM1, the input end of the second main constant current source Iref2, and the input end of the second group of calibration current sources Iptr1~Iptrm are connected to the CAN output stage module, the output end of the second group of calibration current sources Iptr1~Iptrm is correspondingly connected to one end of the switches Siptr1~Siptrm for controlling the second group of calibration current sources Iptr1~Iptrm, the output end of the second main constant current source Iref2, the other end of the switches Siptr1~Siptrm for controlling the second group of calibration current sources Iptr1~Iptrm, and the source of the first NMOS tube NM1 are all grounded.
[0008] Furthermore, the CAN output stage module includes: a first bias voltage transmission channel control switch Spv, a second bias voltage transmission channel control switch Snv, a first group of calibration resistors Rntr1~Rntrn, a second group of calibration resistors Rptr1~Rptrm, switches Srntr1~Srntrn for controlling the first group of calibration resistors Rntr1~Rntrn, switches Srptr1~Srptrm for controlling the second group of calibration resistors Rptr1~Rptrm, a NOMS current mirror NM2 for generating a CAN transceiver output current, a PMOS current mirror PM2 for generating a CAN transceiver output current, a first diode D1, a second diode D2 and an external load RL, one end of the first bias voltage transmission channel control switch Spv and one end of the second bias voltage transmission channel control switch Snv are both connected to the output end of the current mirror type drive voltage generating circuit, the other end of the first bias voltage transmission channel control switch Spv is connected in series with the second group of calibration resistors Rptr1~Rptrm and then connected to the gate of the PMOS current mirror PM2, and the second group of calibration resistors Rptr1~Rptrm is connected to the gate of the PMOS current mirror PM2. Each resistor among the resistors Rptr1 to Rptrm corresponds to a switch in the switches Srptr1 to Srptrm for controlling the second group of calibration resistors Rptr1 to Rptrm; the other end of the second bias voltage transmission channel control switch Snv is connected in series with the first group of calibration resistors Rntr1 to Rntrn and then connected to the gate of the NMOS current mirror NM2, and each resistor among the first group of calibration resistors Rntr1 to Rntrn corresponds to a switch in the switches Srntr1 to Srntrn for controlling the first group of calibration resistors Rntr1 to Rntrn; the source of the PMOS current mirror PM2 is connected to the power supply, the drain of the PMOS current mirror PM2, the first diode D1, the external load RL, the second diode D2, and the drain of the NMOS current mirror NM2 are connected in series in sequence, and the source of the NMOS tube current mirror NM2 is grounded; the end of the external load RL connected to the cathode of the first diode D1 is the CANH output end of the CAN transceiver, and the end of the external load RL connected to the anode of the second diode D2 is the CANL output end of the CAN transceiver.
[0009] Further, one end of the first bias voltage transmission channel control switch Spv is respectively connected to the gate of the first PMOS tube PM1, the drain of the first PMOS tube PM1, the input end of the second main constant current source Iref2, and the input end of the second group of calibration current sources Iptr1~Iptrm; one end of the second bias voltage transmission channel control switch Snv is respectively connected to the gate of the first NMOS tube NM1, the drain of the first NMOS tube NM1, the output end of the first main constant current source Iref1, and the other end of the switches Sintr1~Sintrn for controlling the first group of calibration current sources Intr1~Intrn.
[0010] Furthermore, the common-mode voltage generating module is composed of a first resistor RCM1 and a second resistor RCM2, one end of the first resistor RCM1 is connected to the CANL output end of the CAN transceiver, the other end of the first resistor RCM1 is connected to one end of the second resistor RCM2, and the other end of the second resistor RCM2 is connected to the CANH output end of the CAN transceiver.
[0011] Further, the calibration channel selection module is composed of a high-speed channel and a low-speed channel, the high-speed channel includes: a first switch S1 and a second switch S2, one end of the first switch S1 is connected to one end of the first resistor RCM1 and the second resistor RCM2, the other end of the first switch S1 is connected to one end of the second switch S2, and the other end of the second switch S2 is respectively connected to the output end of the low-speed channel and the input end of the error peak-valley value sampling circuit; the low-speed channel includes: a third switch S3, a fourth switch S4, a filter resistor Rf, and a filter capacitor Cf, one end of the third switch S3 is connected to one end of the first resistor RCM1 and the second resistor RCM2, the other end of the third switch S3 is respectively connected to one end of the filter resistor Rf and one end of the filter capacitor Cf, the other end of the filter resistor Rf is connected to one end of the fourth switch S4, the other end of the fourth switch S4 is respectively connected to the input end of the error peak-valley value sampling circuit and the other end of the second switch S2, and the other end of the filter capacitor Cf is grounded.
[0012] Further, the first switch S1 and the second switch S2 are both controlled by EN, and the third switch S3 and the fourth switch S4 are both controlled by ENB, and EN and ENB are enable signals with opposite logics in the CAN transceiver.
[0013] Furthermore, the error peak-to-valley sampling circuit is composed of a valley detection circuit and a peak detection circuit, the input end of the valley detection circuit and the input end of the peak detection circuit are both connected to the output end of the calibration channel selection module, and the output end of the valley detection circuit and the output end of the peak detection circuit are both connected to the calibration control code generation circuit.
[0014] Further, the calibration control code generating circuit includes: an m-bit analog-to-digital converter, an n-bit analog-to-digital converter, a first m-bit Latch1, a second m-bit Latch2, a first n-bit Latch1, and a second n-bit Latch2, the input end of the m-bit analog-to-digital converter is connected to the output end of the valley detection circuit, the output end of the m-bit analog-to-digital converter is respectively connected to the input end of the first m-bit Latch1 and the input end of the second m-bit Latch2, the output end of the second m-bit Latch2 is used to control the closing and disconnection of switches Siptr1~Siptrm of the second group of calibration current sources Iptr1~Iptrm, and the output end of the first m-bit Latch1 is used to control The switches Srptr1~Srptrm of the second group of calibration resistors Rptr1~Rptrm are turned on and off; the input end of the n-bit analog-to-digital converter is connected to the output end of the peak detection circuit, and the output end of the n-bit analog-to-digital converter is respectively connected to the input end of the first n-bit Latch1 and the input end of the second n-bit Latch2, and the output end of the second n-bit Latch2 is used to control the turning on and off of the switches Sintr1~Sintrn of the first group of calibration current sources Intr1~Intrn, and the output end of the first n-bit Latch1 is used to control the turning on and off of the switches Srntr1~Srntrn of the first group of calibration resistors Rntr1~Rntrn.
[0015] Further, the second m-bit Latch2 and the second n-bit Latch2 are both controlled by ENB, and the first n-bit Latch1 and the first m-bit Latch1 are both controlled by EN, and the EN and ENB are enable signals with opposite logics in the CAN transceiver.
[0016] Compared with the prior art, the present invention has the following beneficial effects: the CAN driver circuit with calibration function of the present invention processes the error generated by the common mode level of the CANH output terminal and the CANL output terminal of the CAN transceiver in the dominant state and the recessive state by configuring the logically opposite enable signals EN and ENB in the CAN transceiver system to determine the high-speed channel or the low-speed channel in the calibration channel selection module, obtains the maximum value and the minimum value of the common mode level of the CANH output terminal and the CANL output terminal through the error peak-valley value sampling circuit, encodes the error through the calibration control code generating circuit, controls the switch closing and disconnection of the calibration current source in the current mirror type driving voltage generating circuit with static error encoding, and calibrates the error deviation signal of the common mode level statically, and controls the switch closing and disconnection of the calibration resistor in the output stage module with dynamic error encoding, and calibrates the error deviation signal of the common mode level dynamically. The present invention can take into account both high-frequency errors and low-frequency errors, reuses error peak-to-valley value sampling circuits and calibration control code generation circuits for high-frequency asymmetry and low-frequency asymmetry, and can save circuit power consumption and circuit area; at the same time, the present invention can compensate for various CAN transceiver symmetry deteriorations caused by process offsets through static calibration and dynamic calibration, improve the EMI characteristics of the CAN transceiver, reduce the asymmetry caused by the CAN driver between explicit and implicit transitions, and thus reduce the difference between the common mode levels in the explicit state and the implicit state. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Figure 1 It is a traditional CAN driver circuit;
[0018] Figure 2 Schematic diagram of the fluctuation of the common mode voltage of the CAN transceiver during the transition process of the traditional CAN driver, where: Figure 2 A in the figure is a schematic diagram showing the changes of VPbias and VNbias generated by the driver circuit during the transition between visibility and hiding. Figure 2 (a) is a waveform diagram of the voltage at the CANH output terminal and the voltage at the CANL output terminal of the CAN transceiver when the on-resistance of the output stage power tube NM3 is lower than the on-resistance of the output stage power tube PM2. Figure 2 (b) is a waveform diagram of the voltage at the CANH output terminal and the voltage at the CANL output terminal of the CAN transceiver when the on-resistance of the output stage power tube PM2 is less than the on-resistance of the output stage power tube NM3. Figure 2 (c) is a waveform diagram of the CANH output terminal voltage and the CANL output terminal voltage of the CAN transceiver when the gate terminal voltage of the output stage power tube NM3 is charged faster. Figure 2 (d) is a waveform diagram of the CANH output terminal voltage and the CANL output terminal voltage of the CAN transceiver when the gate terminal voltage of the output stage power tube PM2 is charged faster;
[0019] Figure 3 This is a schematic diagram of the circuit structure of a CAN driver with a calibration function according to the present invention;
[0020] Figure 4 The CAN driver circuit with calibration function of the present invention is aimed at Figure 2 (a) Schematic diagram of a circuit for calibration of asymmetric waveform of type;
[0021] Figure 5 The CAN driver circuit with calibration function of the present invention is aimed at Figure 2 (b) Schematic diagram of a circuit for calibration using an asymmetric waveform of type;
[0022] Figure 6 The CAN driver circuit with calibration function of the present invention is aimed at Figure 2 (c) Schematic diagram of a circuit for calibration using an asymmetric waveform of type;
[0023] Figure 7 The CAN driver circuit with calibration function of the present invention is aimed at Figure 2 (d) Schematic diagram of a circuit for calibration using an asymmetric waveform of type;
[0024] Figure 8 It is a schematic diagram of the common mode level waveforms of CANH and CANL after calibration by the CAN driver circuit with calibration function of the present invention. DETAILED DESCRIPTION
[0025] The technical solution of the present invention is further explained below in conjunction with the accompanying drawings.
[0026] like Figure 3The present invention is a schematic diagram of the structure of a CAN driver circuit with a calibration function. The CAN driver circuit with a calibration function comprises: a current mirror type driving voltage generating circuit, a CAN output stage module, a common mode voltage generating module, a calibration channel selection module, an error peak-valley value sampling circuit and a calibration control code generating circuit; the current mirror type driving voltage generating module is used to generate an output stage driving voltage and transmit it to the output stage module, the CAN output stage module generates a CAN transceiver current, the common mode voltage generating module is used to detect the common mode level of the CANH output terminal and the CANL output terminal of the CAN output stage module, the calibration channel selection module selects a channel with a suitable rate to perform common mode level error detection based on the different frequencies of the detected common mode level, the error peak-valley value sampling circuit obtains the maximum value and the minimum value of the common mode level, the calibration control code generating circuit generates a static error code and a dynamic error code according to the maximum value and the minimum value of the common mode level obtained by the error peak-valley value sampling circuit, the static error code controls the switch closing and disconnection of the calibration current source in the current mirror type driving voltage generating circuit, and the error deviation signal of the static calibration common mode level is generated, and the dynamic error code controls the switch closing and disconnection of the calibration resistor in the CAN output stage module, and the error deviation signal of the dynamic calibration common mode level is generated. The present invention can take into account both high-frequency errors and low-frequency errors, reuses error peak-to-valley value sampling circuits and calibration control code generation circuits for high-frequency asymmetry and low-frequency asymmetry, and can save circuit power consumption and circuit area; at the same time, the present invention can compensate for various CAN transceiver symmetry deteriorations caused by process offsets through static calibration and dynamic calibration, improve the EMI characteristics of the CAN transceiver, reduce the asymmetry caused by the CAN driver between explicit and implicit transitions, and thus reduce the difference between the common mode levels in the explicit state and the implicit state.
[0027] The current mirror type driving voltage generating circuit of the present invention comprises: a first main constant current source Iref1, a second main constant current source Iref2, a first group of calibration current sources Intr1-Intrn, a second group of calibration current sources Iptr1-Iptrm, switches Sintr1-Sintrn for controlling the first group of calibration current sources Intr1-Intrn, switches Siptr1-Siptrm for controlling the second group of calibration current sources Iptr1-Iptrm, a first NMOS transistor NM1 and a first PMOS transistor PM1 for generating an output stage driving voltage, an input end of the first main constant current source Iref1, an input end of the first group of calibration current sources Intr1-Intrn, and a source electrode of the first PMOS transistor PM1 are all connected to a power supply, an output end of the first group of calibration current sources Intr1-Intrn is correspondingly connected to one end of the switches Sintr1-Sintrn for controlling the first group of calibration current sources Intr1-Intrn, The output end of the first main constant current source Iref1 and the other end of the switches Sintr1~Sintrn for controlling the first group of calibration current sources Intr1~Intrn are connected to the drain of the first NMOS tube NM1, the gate of the first NMOS tube NM1, and the CAN output stage module; the gate of the first PMOS tube PM1, the drain of the first PMOS tube PM1, the input end of the second main constant current source Iref2, and the input end of the second group of calibration current sources Iptr1~Iptrm are connected to the CAN output stage module, the output end of the second group of calibration current sources Iptr1~Iptrm is correspondingly connected to one end of the switches Siptr1~Siptrm for controlling the second group of calibration current sources Iptr1~Iptrm, the output end of the second main constant current source Iref2, the other end of the switches Siptr1~Siptrm for controlling the second group of calibration current sources Iptr1~Iptrm, and the source of the first NMOS tube NM1 are all grounded.The current mirror type driving voltage generating circuit of the present invention adjusts the on-resistance of the NMOS current mirror NM2 and the PMOS current mirror PM2 in the output stage module through static calibration and feedback. When the on-resistance of the NMOS current mirror NM2 is lower than the on-resistance of the PMOS current mirror PM2, more switches Siptr1-Siptrm for controlling the second group of calibration current sources Iptr1-Iptrm are closed to increase the current source for generating the gate terminal voltage of the PMOS current mirror PM2, thereby reducing the on-resistance of the PMOS current mirror PM2, so that the NMOS current The on-resistance values of the current mirror NM2 and the PMOS current mirror PM2 are close, thereby achieving calibration; when the on-resistance of the PMOS current mirror PM2 is lower than the on-resistance of the NMOS current mirror NM2, by closing more switches Sintr1~Sintrn used to control the first group of calibration current sources Intr1~Intrn, the current source that generates the gate terminal voltage of the NMOS current mirror NM2 is increased, thereby reducing the on-resistance of the NMOS current mirror NM2, so that the on-resistance values of the NMOS current mirror NM2 and the PMOS current mirror PM2 are close, thereby achieving calibration.
[0028] The output stage module of the present invention includes: a first bias voltage transmission channel control switch Spv, a second bias voltage transmission channel control switch Snv, a first group of calibration resistors Rntr1~Rntrn, a second group of calibration resistors Rptr1~Rptrm, switches Srntr1~Srntrn for controlling the first group of calibration resistors Rntr1~Rntrn, switches Srptr1~Srptrm for controlling the second group of calibration resistors Rptr1~Rptrm, an NMOS current mirror NM2 for generating a CAN transceiver output current, a PMOS current mirror PM2 for generating a CAN transceiver output current, a first diode D1, a second diode D2 and an external load RL, the first bias voltage transmission channel control switch Sp v and one end of the second bias voltage transmission channel control switch Snv are both connected to the output end of the current mirror type driving voltage generating circuit. Specifically, one end of the first bias voltage transmission channel control switch Spv is respectively connected to the gate of the first PMOS tube PM1, the drain of the first PMOS tube PM1, the input end of the second main constant current source Iref2, and the input end of the second group of calibration current sources Iptr1~Iptrm; one end of the second bias voltage transmission channel control switch Snv is respectively connected to the gate of the first NMOS tube NM1, the drain of the first NMOS tube NM1, the output end of the first main constant current source Iref2, and the other end of the switches Sintr1~Sintrn for controlling the first group of calibration current sources Intr1~Intrn. The other end of the first bias voltage transmission channel control switch Spv is connected in series with the second group of calibration resistors Rptr1~Rptrm and then connected to the gate of the PMOS current mirror PM2. Each resistor in the second group of calibration resistors Rptr1~Rptrm is connected in parallel with a switch in the switches Srptr1~Srptrm for controlling the second group of calibration resistors Rptr1~Rptrm; the other end of the second bias voltage transmission channel control switch Snv is connected in series with the first group of calibration resistors Rntr1~Rntrn and then connected to the gate of the NMOS current mirror NM2. Each resistor in the group of calibration resistors Rntr1~Rntrn is connected in parallel to control the switches in the switches Srntr1~Srntrn of the first group of calibration resistors Rntr1~Rntrn; the source of the PMOS current mirror PM2 is connected to the power supply, the drain of the PMOS current mirror PM2, the first diode D1, the external load RL, the second diode D2, and the drain of the NMOS current mirror NM2 are connected in series in sequence, the first diode D1 and the second diode D2 are used to prevent the CAN transceiver from having a negative voltage, and the source of the NMOS current mirror NM2 is grounded. The end of the external load RL connected to the cathode of the first diode D1 is the CANH output end of the CAN transceiver, and the end of the external load RL connected to the anode of the second diode D2 is the CANL output end of the CAN transceiver.The output stage module of the present invention adjusts the charging speed of the NMOS current mirror NM2 and the PMOS current mirror PM2 through dynamic calibration and feedback. When the gate end charging speed of the NMOS current mirror NM2 is faster, more switches in the switches Srptr1~Srptrm that control the second group of calibration resistors Rptr1~Rptrm are closed through feedback, the RC time constant of the gate end of the PMOS current mirror PM2 is reduced, and the charging speed is increased, so that the charging speeds of the PNMOS current mirror NM2 and the PMOS current mirror PM2 are nearly consistent; when the gate end charging speed of the PMOS current mirror PM2 is faster, more switches in the switches Srntr1~Srntrn that control the first group of calibration resistors Rntr1~Rntrn are closed through feedback, the RC time constant of the gate end of the NMOS current mirror NM2 is reduced, and the charging speed is increased, so that the charging speeds of the PNMOS current mirror NM2 and the PMOS current mirror PM2 are nearly consistent.
[0029] The common mode voltage generating module of the present invention is composed of a first resistor RCM1 and a second resistor RCM2, one end of the first resistor RCM1 is connected to the CANL output end of the CAN transceiver, the other end of the first resistor RCM1 and one end of the second resistor RCM2 are connected to point X, and the other end of the second resistor RCM2 is connected to the CANH output end of the CAN transceiver. The common mode voltage generating module uses the first resistor RCM1 and the second resistor RCM2 to generate real-time common mode levels on the CANH output end and the CANL output end at point X.
[0030] The calibration channel selection module in the present invention is composed of a high-speed channel and a low-speed channel. The high-speed channel includes: a first switch S1 and a second switch S2. One end of the first switch S1 is connected to one end of the first resistor RCM1 and the second resistor RCM2, the other end of the first switch S1 is connected to one end of the second switch S2, and the other end of the second switch S2 is respectively connected to the output end of the low-speed channel and the input end of the error peak-valley value sampling circuit; the low-speed channel includes: a third switch S3, a fourth switch S4, a filter resistor Rf, and a filter capacitor Cf. One end of the third switch S3 is connected to one end of the first resistor RCM1 and the second resistor RCM2, the other end of the third switch S3 is respectively connected to one end of the filter resistor Rf and one end of the filter capacitor Cf, the other end of the filter resistor Rf is connected to one end of the fourth switch S4, the other end of the fourth switch S4 is respectively connected to the input end of the error peak-valley value sampling circuit and the other end of the second switch S2, and the other end of the filter capacitor Cf is grounded. The first switch S1 and the second switch S2 are both controlled by EN, and the third switch S3 and the fourth switch S4 are both controlled by ENB. EN and ENB are enable signals with opposite logics in the CAN transceiver. The high-speed channel and the low-speed channel are used to ensure that the static calibration process is not disturbed by the dynamic error. If the same channel is used, the current mirror may be calibrated according to the error in the dynamic process during the static calibration, resulting in excessive correction and failure to achieve the calibration effect.
[0031] The error peak-to-valley value sampling circuit in the present invention is composed of a valley value detection circuit and a peak value detection circuit. Referring to the design of a peak value and valley value detection circuit in publication number CN107505498A, the input end of the valley value detection circuit and the input end of the peak value detection circuit are both connected to the output end of the calibration channel selection module, and the output end of the valley value detection circuit and the output end of the peak value detection circuit are both connected to the calibration control code generation circuit.
[0032] The calibration control code generating circuit of the present invention comprises: an m-bit analog-to-digital converter, an n-bit analog-to-digital converter, a first m-bit Latch1, a second m-bit Latch2, a first n-bit Latch1, and a second n-bit Latch2, wherein the input end of the m-bit analog-to-digital converter is connected to the output end of the valley detection circuit, the output end of the m-bit analog-to-digital converter is respectively connected to the input end of the first m-bit Latch1 and the input end of the second m-bit Latch2, the output end of the second m-bit Latch2 is used to control the closing and disconnection of switches Siptr1~Siptrm of the second group of calibration current sources Iptr1~Iptrm, the output end of the first m-bit Latch1 is used to control the second The switches Srptr1~Srptrm of the first group of calibration resistors Rptr1~Rptrm are closed and disconnected; the input end of the n-bit analog-to-digital converter is connected to the output end of the peak detection circuit, and the output end of the n-bit analog-to-digital converter is respectively connected to the input end of the first n-bit Latch1 and the input end of the second n-bit Latch2, and the output end of the second n-bit Latch2 is used to control the closing and disconnection of the switches Sintr1~Sintrn of the first group of calibration current sources Intr1~Intrn, and the output end of the first n-bit Latch1 is used to control the closing and disconnection of the switches Srntr1~Srntrn of the first group of calibration resistors Rntr1~Rntrn. The second m-bit Latch2 and the second n-bit Latch2 are both controlled by ENB to ensure simultaneous operation; the first n-bit Latch1 and the first m-bit Latch1 are both controlled by EN to ensure simultaneous operation. The control code can be saved in the Latch to avoid the control code being modified when the Latch is not enabled, and to avoid the control code being modified after the loop calibration.
[0033] During the bus transmission process, if the CAN driver circuit with calibration function of the present invention occurs Figure 2 In the waveform state of (a), it means that the common mode voltage of the CAN transceiver is low in the dominant state, which means that the driving voltage of the NOMS current mirror NM2 used to generate the output current of the CAN transceiver is too large, and the driving voltage of the PMOS current mirror PM2 used to generate the output current of the CAN transceiver is too small. Figure 4, select the slow channel from the calibration channel selection module through the ENB enable signal to filter the common mode level on the CAN transceiver, so as to prevent the common mode voltage value caused by the asymmetry between the explicit and implicit transitions from entering the input end of the error peak and valley value sampling circuit. At this time, the value detected by the peak voltage of the peak detection circuit does not deviate from VCC / 2, so the output code stream of the n-bit analog-to-digital converter after the peak detection does not change; the value detected by the valley voltage of the valley detection circuit deviates from VCC / 2, and the detected deviation value generates a digital code stream through the m-bit analog-to-digital converter, and the second m-bit Latch2 is used to control the closing and disconnection of the switches Siptr1~Siptrm for controlling the second group of calibration current sources Iptr1~Iptrm, and the second group of calibration current sources of the corresponding channel are injected into the first PMOS tube PM1, thereby increasing the gate-source voltage difference of the first PMOS tube PM1, so that the on-resistance of the PMOS current mirror PM2 used to generate the output current of the CAN transceiver is reduced, thereby improving the common mode level in the dominant state.
[0034] During the bus transmission process, if the CAN driver circuit with calibration function of the present invention occurs Figure 2 In the waveform state (b), the CAN transceiver is in the dominant state and the common mode voltage is high, which means that the driving voltage of the PMOS current mirror PM2 used to generate the output current of the CAN transceiver is too large, and the driving voltage of the NOMS current mirror NM2 used to generate the output current of the CAN transceiver is too small, as shown in Figure 1. Figure 5 , select the slow channel from the calibration channel selection module through the ENB enable signal to filter the common mode level on the CAN transceiver, so as to prevent the common mode voltage value caused by the asymmetry between the explicit and implicit transitions from entering the input end of the error peak and valley sampling circuit. At this time, the value detected by the valley voltage of the valley detection circuit does not deviate from VCC / 2, so the output code stream of the m-bit analog-to-digital converter after the valley detection does not change; the value detected by the peak voltage of the peak detection circuit deviates from VCC / 2, and the detected deviation value generates a digital code stream through the n-bit analog-to-digital converter, and the second n-bit Latch2 controls the closing and disconnection of the switches Sintr1~Sintrn used to control the first group of calibration current sources Intr1~Intrn, and the first group of calibration current sources Intr1~Intrn of the corresponding channel are poured into the first NMOS tube NM1, thereby increasing the gate-source voltage difference of the first NMOS tube NM1, so that the on-resistance of the NOMS current mirror NM2 used to generate the output current of the CAN transceiver is reduced, thereby improving the common mode level in the dominant state.
[0035] During the bus transmission process, if the CAN driver circuit with calibration function of the present invention occurs Figure 2In the waveform state (c) in the figure, the common-mode voltage of the CAN transceiver is low during the transition from hidden to visible, which means that during the transition from hidden to visible, the gate voltage of the NOMS current mirror NM2 used to generate the output current of the CAN transceiver changes faster than the gate voltage of the PMOS current mirror PM2 used to generate the output current of the CAN transceiver. The common-mode voltage will go down during the transition from hidden to visible, as shown in Figure 1. Figure 6 , select the fast channel from the calibration channel selection module through the EN enable signal to detect the common-mode voltage on the CAN transceiver, detect the lowest value of the common-mode voltage at this time through the valley detection circuit, convert the value into a digital code stream through the m-bit analog-to-digital converter, and control the closing and opening of the switches Srptr1~Srptrm used to control the second group of calibration resistors Rptr1~Rptrm through the first m-bit Latch1, and select the corresponding switch to be closed according to the digital code to reduce the time constant of the gate terminal voltage of the first PMOS tube PM1 to the gate terminal of the PMOS current mirror PM2 used to generate the output current of the CAN transceiver, thereby increasing the speed of charging the gate terminal voltage of the PMOS current mirror PM2 used to generate the output current of the CAN transceiver, so as to improve the common-mode level of the CAN transceiver during the hidden and visible jump process.
[0036] During the bus transmission process, if the CAN driver circuit with calibration function of the present invention occurs Figure 2 In the waveform state (d) in the figure, the common-mode voltage of the CAN transceiver is high during the transition from hidden to visible, which means that during the transition from hidden to visible, the gate voltage of the PMOS current mirror PM2 used to generate the output current of the CAN transceiver changes faster than the gate voltage of the NOMS current mirror NM2 used to generate the output current of the CAN transceiver. Therefore, the common-mode voltage will go down during the transition from hidden to visible, as shown in Figure 1. Figure 7 , select the fast channel from the calibration channel selection module through the EN enable signal to detect the common-mode voltage on the CAN transceiver, the peak detection circuit detects the highest value of the common-mode voltage at this time, and converts the value into a digital code stream through the n-bit analog-to-digital converter, and then controls the closing and opening of the switches Srntr1~Srntrn used to control the first group of calibration resistors Rntr1~Rntrn through the first n-bit Latch1, and selects to close the corresponding switch according to the digital code to reduce the time constant of the gate terminal voltage of the first NMOS tube NM1 to the gate terminal of the NOMS current mirror NM2 used to generate the output current of the CAN transceiver, thereby increasing the charging speed of the gate terminal voltage of the NOMS current mirror NM2 used to generate the output current of the CAN transceiver, so as to reduce the common-mode level of the CAN transceiver during the hidden and visible jump process.
[0037] By calibrating the common mode voltage through the CAN driver circuit with calibration function of the present invention, the following can be obtained: Figure 8 From the waveform, it can be seen that the CANH output terminal level and the CANL output terminal level of the CNA transceiver driven by the CAN driver circuit have good symmetry. The present invention can take into account both high-frequency errors and low-frequency errors, and reuses the error peak-to-valley value sampling circuit and the calibration control code generation circuit for high-frequency asymmetry and low-frequency asymmetry, which can save circuit power consumption and circuit area; at the same time, the present invention can compensate for the symmetry deterioration of various CAN transceivers caused by process offsets through static calibration and dynamic calibration, improve the EMI characteristics of the CAN transceiver, reduce the asymmetry caused by the CAN driver between explicit and implicit transitions, and thus reduce the difference between the common mode levels in the explicit state and the implicit state.
[0038] The above are only preferred embodiments of the present invention, and the protection scope of the present invention is not limited to the above embodiments. All technical solutions under the concept of the present invention belong to the protection scope of the present invention. It should be pointed out that for ordinary technicians in this technical field, some improvements and modifications without departing from the principle of the present invention should be regarded as the protection scope of the present invention.
Claims
1. A CAN driver circuit with calibration function, characterized in that: include: Current mirror type driving voltage generating circuit, CAN output stage module, common mode voltage generating module, calibration channel selecting module, error peak and valley value sampling circuit and calibration control code generating circuit; The current mirror type driving voltage generating module is used to generate an output stage driving voltage to be transmitted to the output stage module, the CAN output stage module generates a CAN transceiver current, the common mode voltage generating module is used to detect the common mode level of the CANH output terminal and the CANL output terminal of the CAN output stage module, the calibration channel selecting module selects a channel with a suitable rate to perform common mode level error detection according to the different frequencies of the detected common mode level, the error peak and valley value sampling circuit obtains the maximum value and minimum value of the common mode level, the calibration control code generating circuit generates static error coding and dynamic error coding according to the maximum value and minimum value of the common mode level obtained by the error peak and valley value sampling circuit, the static error coding controls the switch closing and disconnection of the calibration current source in the current mirror type driving voltage generating circuit, and the error deviation signal of the static calibration common mode level, the dynamic error coding controls the switch closing and disconnection of the calibration resistor in the CAN output stage module, and the error deviation signal of the dynamic calibration common mode level; The error peak-to-valley sampling circuit is composed of a valley detection circuit and a peak detection circuit, the input end of the valley detection circuit and the input end of the peak detection circuit are both connected to the output end of the calibration channel selection module, and the output end of the valley detection circuit and the output end of the peak detection circuit are both connected to the calibration control code generation circuit; The calibration control code generating circuit includes: an m-bit analog-to-digital converter, an n-bit analog-to-digital converter, a first m-bit Latch1, a second m-bit Latch2, a first n-bit Latch1, and a second n-bit Latch2. The input end of the m-bit analog-to-digital converter is connected to the output end of the valley detection circuit. The output end of the m-bit analog-to-digital converter is respectively connected to the input end of the first m-bit Latch1 and the input end of the second m-bit Latch2. The output end of the second m-bit Latch2 is used to control the closing and disconnection of switches Siptr1~Siptrm of the second group of calibration current sources Iptr1~Iptrm. The output end of the first m-bit Latch1 is used to control the closing and disconnection of switches Siptr1~Siptrm of the second group The switches Srptr1~Srptrm of the calibration resistors Rptr1~Rptrm are turned off and off; the input end of the n-bit analog-to-digital converter is connected to the output end of the peak detection circuit, and the output end of the n-bit analog-to-digital converter is respectively connected to the input end of the first n-bit Latch1 and the input end of the second n-bit Latch2, and the output end of the second n-bit Latch2 is used to control the closing and disconnection of the switches Sintr1~Sintrn of the first group of calibration current sources Intr1~Intrn, and the output end of the first n-bit Latch1 is used to control the closing and disconnection of the switches Srntr1~Srntrn of the first group of calibration resistors Rntr1~Rntrn; The second m-bit Latch2 and the second n-bit Latch2 are both controlled by ENB, and the first n-bit Latch1 and the first m-bit Latch1 are both controlled by EN. The EN and ENB are enable signals with opposite logics in the CAN transceiver.
2. A CAN driver circuit with calibration function according to claim 1, characterized in that: The current mirror type driving voltage generating circuit comprises: a first main constant current source Iref1, a second main constant current source Iref2, a first group of calibration current sources Intr1~Intrn, a second group of calibration current sources Iptr1~Iptrm, switches Sintr1~Sintrn for controlling the first group of calibration current sources Intr1~Intrn, switches Siptr1~Siptrm for controlling the second group of calibration current sources Iptr1~Iptrm, a first NMOS transistor NM1 and a first PMOS transistor PM1 for generating an output stage driving voltage, the input end of the first main constant current source Iref1, the input end of the first group of calibration current sources Intr1~Intrn, and the source of the first PMOS transistor PM1 are all connected to a power supply, the output end of the first group of calibration current sources Intr1~Intrn is correspondingly connected to one end of the switches Sintr1~Sintrn for controlling the first group of calibration current sources Intr1~Intrn, and the first PMOS transistor PM1 is connected to the power supply. The output end of a main constant current source Iref1 and the other end of switches Sintr1~Sintrn for controlling the first group of calibration current sources Intr1~Intrn are connected to the drain of the first NMOS tube NM1, the gate of the first NMOS tube NM1, and the CAN output stage module; the gate of the first PMOS tube PM1, the drain of the first PMOS tube PM1, the input end of the second main constant current source Iref2, and the input end of the second group of calibration current sources Iptr1~Iptrm are connected to the CAN output stage module, the output end of the second group of calibration current sources Iptr1~Iptrm is correspondingly connected to one end of switches Siptr1~Siptrm for controlling the second group of calibration current sources Iptr1~Iptrm, the output end of the second main constant current source Iref2, the other end of switches Siptr1~Siptrm for controlling the second group of calibration current sources Iptr1~Iptrm, and the source of the first NMOS tube NM1 are all grounded.
3. The CAN driver circuit with calibration function according to claim 1, characterized in that: The CAN output stage module includes: a first bias voltage transmission channel control switch Spv, a second bias voltage transmission channel control switch Snv, a first group of calibration resistors Rntr1~Rntrn, a second group of calibration resistors Rptr1~Rptrm, switches Srntr1~Srntrn for controlling the first group of calibration resistors Rntr1~Rntrn, switches Srptr1~Srptrm for controlling the second group of calibration resistors Rptr1~Rptrm, an NMOS current mirror NM2 for generating a CAN transceiver output current, a PMOS current mirror PM2 for generating a CAN transceiver output current, a first diode D1, a second diode D2 and an external load RL, one end of the first bias voltage transmission channel control switch Spv and one end of the second bias voltage transmission channel control switch Snv are both connected to the output end of the current mirror type driving voltage generating circuit, the other end of the first bias voltage transmission channel control switch Spv is connected in series with the second group of calibration resistors Rptr1~Rptrm and then connected to the gate of the PMOS current mirror PM2, the second group of calibration resistors Each resistor in Rptr1~Rptrm corresponds to a switch in the switches Srptr1~Srptrm for controlling the second group of calibration resistors Rptr1~Rptrm in parallel; the other end of the second bias voltage transmission channel control switch Snv is connected in series with the first group of calibration resistors Rntr1~Rntrn and then connected to the gate of the NMOS current mirror NM2, and each resistor in the first group of calibration resistors Rntr1~Rntrn corresponds to a switch in the switches Srntr1~Srntrn for controlling the first group of calibration resistors Rntr1~Rntrn in parallel; the source of the PMOS current mirror PM2 is connected to the power supply, the drain of the PMOS current mirror PM2, the first diode D1, the external load RL, the second diode D2, and the drain of the NMOS current mirror NM2 are connected in series in sequence, and the source of the NMOS tube current mirror NM2 is grounded; the end of the external load RL connected to the cathode of the first diode D1 is the CANH output end of the CAN transceiver, and the end of the external load RL connected to the anode of the second diode D2 is the CANL output end of the CAN transceiver.
4. The CAN driver circuit with calibration function according to claim 3, characterized in that: One end of the first bias voltage transmission channel control switch Spv is respectively connected to the gate of the first PMOS tube PM1, the drain of the first PMOS tube PM1, the input end of the second main constant current source Iref2, and the input end of the second group of calibration current sources Iptr1~Iptrm; one end of the second bias voltage transmission channel control switch Snv is respectively connected to the gate of the first NMOS tube NM1, the drain of the first NMOS tube NM1, the output end of the first main constant current source Iref1, and the other end of the switch Sintr1~Sintrn used to control the first group of calibration current sources Intr1~Intrn.
5. The CAN driver circuit with calibration function according to claim 3, characterized in that: The common-mode voltage generating module is composed of a first resistor RCM1 and a second resistor RCM2, one end of the first resistor RCM1 is connected to the CANL output end of the CAN transceiver, the other end of the first resistor RCM1 is connected to one end of the second resistor RCM2, and the other end of the second resistor RCM2 is connected to the CANH output end of the CAN transceiver.
6. The CAN driver circuit with calibration function according to claim 5, characterized in that: The calibration channel selection module is composed of a high-speed channel and a low-speed channel. The high-speed channel includes: a first switch S1 and a second switch S2. One end of the first switch S1 is connected to one end of the first resistor RCM1 and the second resistor RCM2, the other end of the first switch S1 is connected to one end of the second switch S2, and the other end of the second switch S2 is respectively connected to the output end of the low-speed channel and the input end of the error peak-valley value sampling circuit; the low-speed channel includes: a third switch S3, a fourth switch S4, a filter resistor Rf, and a filter capacitor Cf. One end of the third switch S3 is connected to one end of the first resistor RCM1 and the second resistor RCM2, the other end of the third switch S3 is respectively connected to one end of the filter resistor Rf and one end of the filter capacitor Cf, the other end of the filter resistor Rf is connected to one end of the fourth switch S4, the other end of the fourth switch S4 is respectively connected to the input end of the error peak-valley value sampling circuit and the other end of the second switch S2, and the other end of the filter capacitor Cf is grounded.
7. The CAN driver circuit with calibration function according to claim 6, characterized in that: The first switch S1 and the second switch S2 are both controlled by EN, and the third switch S3 and the fourth switch S4 are both controlled by ENB. EN and ENB are enable signals with opposite logics in the CAN transceiver.
