laitimes

How to use MOS transistors for unidirectional and bidirectional level translation?

author:Micro Semiconductor

What is Level Shifting?

Now there are two chips, one is 5V and the other is 3.3V, and in order to communicate between the two and establish a connection relationship, you need to do level translation.

How to use MOS transistors for unidirectional and bidirectional level translation?

Why do you need level shifting?

When the supply voltage of the two CPUs is inconsistent, the signal transmission error is easy to occur when the level does not match. If the voltage difference between the two is too large, the chip will be damaged in serious cases.

Level conversion is mainly for communication conversion between two or more CPUs, which can be divided into one-way conversion and two-way conversion.

So, how to utilize a single MOS tube for one-way and two-way conversion?

Below VBsemi editor to share two circuits seen on the Internet.

One-way level-shifting circuitry

How to use MOS transistors for unidirectional and bidirectional level translation?

1. Data transmission direction: TXD-2 to RXD-1

When the output of TXD-2 is low, diode D1 is turned on and RXD-1 is pulled low.

When the output of TXD-2 is high at 5V, the diode D1 is cut off, and RXD-1 is pulled up to 3.3V high.

2. Data transmission direction: TXD-1 to RXD-2

When TXD-1 is low, MOS transistor Q1 is turned on and RXD-2 is pulled low.

When TXD-1 is high at 3.3V, MOS transistor Q1 is cut off and RXD-2 is pulled up to 5V high.

Bidirectional level-shifting circuitry

How to use MOS transistors for unidirectional and bidirectional level translation?
  1. When the output of SDA1 is high, the Vgs of MOS transistor Q1 = 0, the MOS transistor is turned off, and SDA2 is pulled up to 5V by resistor R3.
  2. When SDA1 outputs low: Vgs = 3.3V of MOS transistor Q1, which is greater than the on-voltage, Q1 transistor is turned on, and SDA2 is pulled low through Q1

3. When the output of SDA2 is high, the Vgs of MOS transistor Q1 remains unchanged, Q1 remains off, and SDA1 is pulled up to 3.3V by resistor R2.

  1. When the output of SDA2 is low, the MOS transistor Q1 is not on, but due to the body diode of the MOS transistor Q1, the SDA1 is pulled down to a low level, and the Vgs ≈ 3.3V, and the MOS transistor Q1 is turned on, which further pulls down the voltage of SDA1.

Caution:

We use 3.3V and 5V as examples, and when switching to other voltage values, we need to take into account the Vgs turn-on voltage of the MOS transistor.

In addition, the high level here is close to or equal to the supply voltage, so the high level of a 3.3V device will be close to or equal to the high level, and the 5V voltage will be close to or equal to 5V.

The specific limitation depends on how the IC manual defines this scope.

Pull-up resistor: Pull-up voltage to the IO port for use, and at the same time play the role of current limiting.

That's all for today, click on the homepage to learn more about hardware!

How to use MOS transistors for unidirectional and bidirectional level translation?
How to use MOS transistors for unidirectional and bidirectional level translation?
How to use MOS transistors for unidirectional and bidirectional level translation?

Some of the above content and pictures are from the Internet