Input port configuration for interfacing to 5.0V logic devic

I am using some industrial motor controllers that provided digital outputs at 5.0V logic levels. The outputs on the motor controllers come from a 26C31 differential line driver. There are three outputs I am concerned with – A, B, and I am going to use the quadrature counting capabilities of the built-in timers. I know that the STM32 has 5.0V tolerant pins, but I am not sure what input mode I should put them.

Should they be configured as

  1. Input floating

  2. Input pull-up

  3. Input pull-down

From what I can tell, the differential line driver output is floating when low, and sourcing 5.0V when high. So it seems like I would want to configure the input pins on my STM32 as Input pull-down. Is this correct?

~Luke

On STM32, not all pins are 5V tolerant. The pins which could be used as analog input are only 3.3V tolerant. Choose the right pins.

Angelo

Thanks for the reply. I am aware that not all pins are 5.0V tolerant; this is specified in the datasheet.

My question is really mostly about the pin mode when I want to connect a 5.0V line driver to a 5.0V tolerant input pin on the STM32. I think it should be configured as input pull down, but I wanted to make sure.

Thanks,

~Luke

Luke,

To answer your immediate question up front - It is unlikely to matter in a simple situation. The 26C31 will be driving (sourcing) high and actively sinking low, and the voltage levels that it produces on its OUT and /OUT pins will in all probability be acceptable to the STM32. Refer to the 26C31 datasheet for Vout_hi(min) and Vout_lo(max), and compare those numbers to the Vin_hi(min) and Vin_lo(max) of the STM32 pin that you will be using.

As a general rule, if you have the situation where input signals to your uP board could be unplugged, you should arrange (either by discrete resistors, or, in the STM32 case, by selecting ‘pulled high’ or ‘pulled lo’) for the pin to take on a defined logic level when input cables are unplugged. It is then necessary to decide (when you’re writing the code) which level (hi or lo) is going to be considered the ‘idle’ or inactive case, and arrange your pullups/pulldowns to create that case when a cable is unplugged (or a wire breaks, or…).

HOWEVER, differential drivers are used for good reason in industrial/power situations (e.g. noise rejection, ground-difference tolerance, long cable driving, etc), and they should be received by an appropriate differential receiver, The output of that receiver is the signal that should be feeding the uP pin.

With reference to my words about pull-ups and pull-downs, it should be noted that not all differential line receivers will produce a stable, predictable, output when their inputs are floating. Most good modern chips will do so (and their data sheet will make a point about it), but many earlier chips will need you, the designer, to ensure that there is always a minimum differential voltage at the input when a cable is unplugged. The required differential is generally small, of the order of a few to a few tens of millivolts, but it must exist, otherwise the output could oscillate or randomly take on either a high or a lo state.

Your use of the expression “industrial motor controllers” conjures up thoughts of high-voltage high-current switching circuits, and such a controller will very likely have significant common-mode noise transients on the differential driver outputs. Such transients will be rejected by a differential receiver, but could totally corrupt operation if you use only one of the outputs in a single-ended manner.

As a general statement, it would be foolish to not use a differential receiver.

Roger