cancel
Showing results for 
Search instead for 
Did you mean: 

Evaluation of Encoder Signal Level Shifting Approach

sktech
Associate II

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!

1 ACCEPTED SOLUTION

Accepted Solutions

@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 ...

 

 

View solution in original post

10 REPLIES 10
PGump.1
Senior III

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

AI = Artificial Intelligence, NI = No Intelligence, RI = Real Intelligence.
Peter BENSCH
ST Employee

@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

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
sktech
Associate II

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

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).

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

@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 ...

 

 

I suggest using an optocoupler, the diode side is the input from encoder and output is the transistor side. This ensures that you are always safe 

If you feel a post has answered your question, please click "Accept as Solution".
sktech
Associate II

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!

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

 

Whether isolation is required - or even beneficial - is rather a separate issue.

Insufficient information to judge.