THVD1400: Do We require Level shifter in RS485 IC which is connected with 5V supply and Interfacting with ESP32 3.3v logic level.

Part Number: THVD1400

Tool/software:

Hi there,

I hope you are doing well!

There is doubt on interfacig MCU ie ESP32 withTHVD1400 operated with different voltage levels. Altough there is no issue incurred for being tested a month now. But for the long term should be thing of level shifting logic ?

Looking forward your view on this. i have also attached the schematic for same.

Thanks.

Regards,

Shivam

  • Hi Shivam,

    Thanks for reaching out about this question!

    If you supply THVD1400 with 5V, then yes level shifting should be used. The primary issue here is that the receiver output (R pin) will output a little under 5V to the MCU which might cause problems if it is above the MCU's absolute max rating. 

    However there are two other solutions that would be ideal in the long run:

    • Change THVD1400 VCC to 3.3V. THVD1400 supports either 3.3V or 5V and using 3.3V would solve this problem. The R pin would then output around 3.3V to the MCU. 
    • Swap to THVD1400V. This is a more robust THVD1400 device that supports 1.65V - 5.5V logic voltage reference. If you want to keep VCC at 5V, then you could use this VIO pin to set the logic voltage output to 3.3V for example. 

    Also a comment for your schematic: Consider removing the 100 Ohm resistors (R3, R5) from the A/B lines as these will decrease your driver strength. 

    Let me know if this helps or if you have any other questions,

    -Ethan

  • Thanks a lot Ethan for the reply.
    Please find the comments below.
     
    If you supply THVD1400 with 5V, then yes level shifting should be used. The primary issue here is that the receiver output (R pin) will output a little under 5V to the MCU which might cause problems if it is above the MCU's absolute max rating. 
    That means we would require level shifter at R (Receiver output) pin only? and D, RE/DE Can be left as it is? without level shifters.
     
    However, there are two other solutions that would be ideal in the long run:
    • Change THVD1400 VCC to 3.3V. THVD1400 supports either 3.3V or 5V and using 3.3V would solve this problem. The R pin would then output around 3.3V to the MCU.
    We can't change the supply to 3.3v since its receiver device and Transmitter A & B lines are enable with 5v, Means Transmitter RS485 chip itself is operated with 5V supply.
    • Swap to THVD1400V. This is a more robust THVD1400 device that supports 1.65V - 5.5V logic voltage reference. If you want to keep VCC at 5V, then you could use this VIO pin to set the logic voltage output to 3.3V for example. 
    The suggested IC is bit costly compared to THVD1400 and going out of budget. hence need to go with same.
    Also a comment for your schematic: Consider removing the 100 Ohm resistors (R3, R5) from the A/B lines as these will decrease your driver strength.
    Noted.
    Looking forward your valuable reply to the comments.
    Thanks.
  • Hi Shivam,

    Yes, only a level shifter on the receiver output is necessary. For the D, RE, and DE digital inputs, 2V is the minimum for a logic high so 3.3V from the MCU works fine. 

    Additionally this part of the datasheet below shows that the receiver output follows the VCC voltage level for the logic high state. This is why the level shifter is needed here:

     

    It is very understandable that you may not be able to change the VCC level. Just note that for future revisions, if you can swap to 3.3V, then you can leave off the level shifter. 

    If you have any other questions, feel free to reach out. 

    Best,

    Ethan

  • Thansk Ethan for reply.

    For now i have implemented and tested the level shifter at Receiver output pin, Also i have noted your suggestions for the future revisions.

    Again Thanks for your time.

    Have a nice day!

    Regards,

    Shivam