Isolating digital IO of an MCU.

electrophile

Joined Aug 30, 2013
156
I have a design where I'm using Atmega328P's IO to drive a stepper motor driver. However, I'd like to be able to use an external control logic connected to the same motor driver pins to drive the motors. However, I know that when the Atmega is powered down you cannot have a voltage of more than 0.5Vcc on its IO pins. Hence I thought of using a buffer to isolate the pins as shown in the image below. The buffer's datasheet states that it can tolerate upto +6.5V on its IO when its powered down.

Any thoughts on this?

crutschow

Joined Mar 14, 2008
25,983
What does the input of the circuit you are driving look like?
Normally you should not have to isolate it, even if the Atmega is unpowered.

electrophile

Joined Aug 30, 2013
156
Normally you should not have to isolate it, even if the Atmega is unpowered
Really? Cause the datasheet says that the voltage on any pin can be from -0.5V to Vcc+0.5V. In the absence of Vcc this would be -0.5V to +0.5V.

The motor driver is a TB6600 and the datasheet describes this as its input circuitry:

crutschow

Joined Mar 14, 2008
25,983
the datasheet says that the voltage on any pin can be from -0.5V to Vcc+0.5V. In the absence of Vcc this would be -0.5V to +0.5V.

The motor driver is a TB6600 and the datasheet describes this as its input circuitry:
The input is just a resistor to ground with a series resistor to a high impedance gate.
So what do you think will be generating a voltage greater than ±0.5V?

electrophile

Joined Aug 30, 2013
156
The input is just a resistor to ground with a series resistor to a high impedance gate.
So what do you think will be generating a voltage greater than ±0.5V?
The external STEP and DIR signals. Without the buffer, the D2-STEP-X and EXT-STEP-X would be connected to the same Atmega pin. When the Atmega is powered down (i.e. Vcc = 0V) and there is external signal then its IO pins see 5V. Wouldn't that be harmful to the Atmega?

philba

Joined Aug 17, 2017
960
I don't think there is a reason to be concerned about the atmega. But, I think it's a good idea to provide isolation between a microcontroller and stepper driver that's got significantly higher than 5V running around. Many stepper drivers use opto isolators.

Joined Jul 18, 2013
21,964
What is the stepper drive you are using, as already mentioned, most off the shelf drive versions use an opto isolator input for the step/dir.
Max.

crutschow

Joined Mar 14, 2008
25,983
When the Atmega is powered down (i.e. Vcc = 0V) and there is external signal
What external signal?

electrophile

Joined Aug 30, 2013
156
What external signal?
External signal from another MCU or driver control logic.

electrophile

Joined Aug 30, 2013
156
I don't think there is a reason to be concerned about the atmega.
How?

electrophile

Joined Aug 30, 2013
156
What is the stepper drive you are using, as already mentioned, most off the shelf drive versions use an opto isolator input for the step/dir.
Max.
Its a TB6600. I'm not using an off-the shelf one. Trying to design one on my own.

crutschow

Joined Mar 14, 2008
25,983
External signal from another MCU or driver control logic.
How can we answer your question when you don't give us all the information?

If you have more than one input to the driver than you need to add an OR gate.

philba

Joined Aug 17, 2017
960
Have you not read the previous comments? I think you need to explain where the signal(s) you are worried about are coming from.

philba

Joined Aug 17, 2017
960
Its a TB6600. I'm not using an off-the shelf one. Trying to design one on my own.
design the interface using optoislators.

Joined Jul 18, 2013
21,964
Its a TB6600. I'm not using an off-the shelf one. Trying to design one on my own.
What is it, you are using the TB or designing your own?
The TB6600 has opto isolation, why not use the customary method using opto's?
Max.

be80be

Joined Jul 5, 2008
2,049
That thing is not going to power the uno the uno just tells it what to do step or not step if it's powering you hooked it up wrong.