0
\$\begingroup\$

I have Fibocom G510 modem. It has 2.85V logic level and datasheets says, that 3.3V is absolute maximum for logic pins. Maximum baud rate is 115200.

Due to the limited space in the housing / on PCB I do not have space for a proper level shifter.

Can I connect it to STM32F7 microcontroller with 3.3V logic level using resistors in series, like this?

enter image description here

I have tried this already, but I'm worried about long term consequences and 3.3V voltage that sometimes can be 3.4V due to power supply components tolerance.

Maybe I should use higher value resistors, like 1k to make it safer?

\$\endgroup\$
18
  • \$\begingroup\$ This question has been asked many times in various forms. Have you searched from already-answered questions? You should find many answers. \$\endgroup\$
    – TonyM
    Jun 29, 2022 at 12:24
  • \$\begingroup\$ I couldn't find anything about this particular modem. I only found information about SIM8xx modems, that have max pin voltage at 3.0V and level shifter there is necessary. \$\endgroup\$
    – Kamil
    Jun 29, 2022 at 12:28
  • \$\begingroup\$ The modem's irrelevant, though, it's just a logic I/O device. Your question's just about interfacing 3.3 V logic to logic gates at different voltages. \$\endgroup\$
    – TonyM
    Jun 29, 2022 at 12:37
  • 1
    \$\begingroup\$ I'm afraid I can only repeat the same point: search for questions about interfacing 3.3 V logic to logic gates at different voltages. The modem and its gates are irrelevant to the answer. You can avoid people having to write those same answers again. \$\endgroup\$
    – TonyM
    Jun 29, 2022 at 13:08
  • 1
    \$\begingroup\$ @MissMulan I never said anything about using no more than 2 pins. It seems like you are picking a fight for no good reason. \$\endgroup\$
    – user253751
    Jun 30, 2022 at 10:15

1 Answer 1

1
\$\begingroup\$

Typically, an input pin on a non-trivial chip has diode clamps. The randomly selected picture below shows a typical setup.

Adapted from Figure 71. Basic structure of an I/O port bit - ST Microelectronics STM32 RM0468

Adapted from image source: ST Microelectronics - STM32 reference manual RM0468

I highlighted the protection diode. If you apply an excessive voltage to the I/O pin, this diode is going to try to conduct current to its own power supply (Vdd). Uncontrolled amperage can blow parts up here if not controlled.

Therefore, on your signal from the 3.3V-supplied TX to the 2.85V-supplied RX, you want a resistor that is going to keep the amperage under control. Assuming some worst-case conditions and rounding numbers, a 1k resistor would keep things under a milliamp, so my casual suggestion would be that a 1k resistor should be your minimum on your "upper" resistor, and you could use larger if you like. This is a common practice.

For your "lower" resistor, I would not recommend a resistor in-line for the purpose of interfacing (although an inline resistor could appear there for other unrelated reasons, like smoothing edges that ruin your EMC emissions).

The concern I have there is if a worst-case voltage coming out of the modem is high enough to be recognized as a valid input by the microcontroller. For example, if that pin puts out 2.4 V as a minimum valid high output and your microcontroller accepts a minimum high input at 2.5 V, then you have a problem. Therefore, a pull-up resistor to 3.3 V would not be a bad idea. You could try to see if it works reliably without the pull-up populated, but if this was a PCB design I'd put one in just in case.

Note that this answer depends on some very typical assumptions about the devices you are using. Your results may vary.

\$\endgroup\$
4
  • \$\begingroup\$ Thank you for breaking down the problem and the information that the 1k resistor is typical practice. This is what I needed. I calculated maximum current for 100Ohm and 3.3-2.85V and it was almost 5mA. Modem survived this, and looks like clamping diode works. With 1k current will be under 1mA, so probably any built-in clamping diode should survive this. Regarding the other way - it works fine in 99.999% cases. Sometimes (near 0.001% cases) STM32 loose one character at the beginning of transmission, but I'm not sure if this is the reason, or I have something messed up in ISR. \$\endgroup\$
    – Kamil
    Jun 29, 2022 at 23:06
  • \$\begingroup\$ Just for clarification - by "my upper resistor" you mean the resistor between 3.3V TX and 2.85V RX, right? \$\endgroup\$
    – Kamil
    Jun 29, 2022 at 23:06
  • \$\begingroup\$ Yes, the top one in your schematic. \$\endgroup\$
    – Smith
    Jun 30, 2022 at 15:15
  • \$\begingroup\$ To be honest, if I was doing your design above, I'd make the top resistor 10k, remove the bottom resistor, and put in a 10k pull-up on that lower signal and see how it goes. \$\endgroup\$
    – Smith
    Jun 30, 2022 at 15:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.