Skip to main content
Explorer
October 17, 2024
Solved

Evaluation of Encoder Signal Level Shifting Approach

  • October 17, 2024
  • 5 replies
  • 2191 views

I’m working with an encoder that has a specification of 1024 pulses per revolution (p/r), and it will operate at a maximum speed of 1500 RPM. At this speed, the signal frequency produced by the encoder is approximately 25.6 kHz.

The encoder outputs a 5V signal, while my MCU (the STM32H743VIT6) can only handle a maximum  input voltage of 3.3V. To address this, I plan to use a TXS0108E level shifter to convert the signal from 5V to 3.3V. Currently, I’m using a Blue Pill for testing until my main MCU arrives (the STM32H743VIT6).

I’d like to know if this is a good approach. Is the TXS0108E suitable for this application at the given frequency? Are there any better alternatives or recommendations for interfacing a 5V encoder output with a 3.3V MCU?

Thank you for your insights!

    This topic has been closed for replies.
    Best answer by Andrew Neil

    @sktech wrote:

     I don't know which pins are 5V tolerant,


    It's easy to find out:

    AndrewNeil_1-1729159831240.png

    https://www.st.com/resource/en/datasheet/stm32h743vi.pdf#page=63

    AndrewNeil_2-1729159928997.png

     


    @sktech wrote:

    but let's say that I need to use a logic level converter. 


    Why say it when it's not true?

    As this is just an input to the microcontroller, you could just use a simple resistive divider ...

     

     

    5 replies

    Graduate II
    October 17, 2024

    Hi,

    Does the encoder have single or differential outputs?

    I don't give out recommendations of that kind, however, the TXS0108E would not be my first choice. The inputs aren't tough enough for me...

    Have you got the list of 5V tolerant pins for the STM32H743VIT6? I don't recommend connecting directly to the MCU.

    Kind regards
    Pedro

    Technical Moderator
    October 17, 2024

    @sktech You do not need a level shifter if you connect the encoder to 5V tolerant GPIO (labelled FT). See also this thread, for example or RM0433, section 11.3, fig. 71.

    Regards
    /Peter

    sktechAuthor
    Explorer
    October 17, 2024

    Thank you for your responses. I don't know which pins are 5V tolerant, but let's say that I need to use a logic level converter. Would you recommend this approach? If so, why? How would you suggest I implement it? Btw i have single signal not differential

    Technical Moderator
    October 17, 2024

    It is easy to find out which pins are 5V tolerant: find out the pins to which you want to connect the encoder, then find the corresponding connection structure in the data sheet, table 9 in column I/O structure (possible suffixes are explained in table 8).

    sktechAuthor
    Explorer
    October 17, 2024

    I know that using a resistor divider for high-frequency signals may not be ideal, which is why I appreciate the use of logic level converters. I was curious if anyone here has experience working with these ICs. It would be very helpful to have some insights, especially for setting timers on channels that are not 5V tolerant and require 3.3V signals. Thank you for your responses!

    Super User
    October 17, 2024

    25kHz is hardly "high frequency" !

     

    PS:

    The TXS0108E is bidirectional - there's no need for that at all here.

    https://www.ti.com/product/TXS0108E

     

    Graduate II
    October 17, 2024

    I basically just wanted to answer the same as Andrew did...

    25.6 kHz should not be a problem for a resistive divider, unless you make the Rs crazy high.

     

    What's your final solution used for?

    Just playing around at home? 

    Consumer product?

    Something used in an industrial environment?

    Could GND loops become a problem?

    ESD protection?

     

    No matter what, always use at least some serial resistors!