2024-10-16 11:16 PM
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!
Solved! Go to Solution.
2024-10-17 03:14 AM
@sktech wrote:I don't know which pins are 5V tolerant,
It's easy to find out:
https://www.st.com/resource/en/datasheet/stm32h743vi.pdf#page=63
@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 ...
2024-10-16 11:36 PM - edited 2024-10-16 11:39 PM
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
2024-10-16 11:48 PM
@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
2024-10-17 02:47 AM - edited 2024-10-17 02:50 AM
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
2024-10-17 03:02 AM
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).
2024-10-17 03:14 AM
@sktech wrote:I don't know which pins are 5V tolerant,
It's easy to find out:
https://www.st.com/resource/en/datasheet/stm32h743vi.pdf#page=63
@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 ...
2024-10-17 03:20 AM
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
2024-10-17 03:22 AM
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!
2024-10-17 03:27 AM - edited 2024-10-17 03:31 AM
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
2024-10-17 03:28 AM
Whether isolation is required - or even beneficial - is rather a separate issue.
Insufficient information to judge.