Can a PIC drive an Enable pin?

Thread Starter

jpanhalt

Joined Jan 18, 2008
11,087
I am using an LM3489 buck controller in a power supply. It has an enable/shutdown pin. When the EN pin is low, the device is deactivated. The datasheet describes a typical control scheme using an open collector transistor. That could be easily done with a PIC pin driving a small transistor.

The following statement from the LM3489 datasheet caught my attention:

For normal operation this pin should be left open. In case an external voltage control source is applied to this pin for enable control, the applied voltage should not exceed the maximum operating voltage level..., i.e., 5.5V
Elsewhere, it is stated that the EN pin is internally pulled high with the voltage clamped at 8V typical.

I am using a PIC12F509 to control the enable pin with GP2 (pin5) and had intended to use a direct connection or resistor, say 1K, to prevent excessive current. (Total supply current in shutdown is 7 uA, so I assume the most the EN pin can source is = < 7uA.)

Microchip, however, gives the following warning:
A pin actively outputting a high or low should not be driven from external devices at the same time in order to change the level on this pin. The resulting high output currents may damage the chip.
I am assuming that with the low currents involved, the PIC output pin will not be driven high or low. Therefore, I can use a direct connection.

1) Is that assumption correct?
2) Should I still use a resistor?
3) Or, should I take the most conservative approach and use a transistor driven by the PIC?

Thanks in advance.

John
 

mik3

Joined Feb 4, 2008
4,843
I am not sure about the internal circuit (they dont show details) so its better to use a transistor to drive the pin.
 

markm

Joined Nov 11, 2008
16
A 1K or higher series resistor will protect the PIC sufficiently. However, at 1K I wouldn't count on the output pin reading back correctly, without doing some calculations or experiments. This is important if you use bit set or clear or other read-modify-write instructions to change other output pins in the same port, whether or not there's a transistor.

I was using a 2n3904 NPN transistor to control a relay, with a 470 ohm resistor between the PIC and the base. When the PIC output was set high to turn the transistor and relay on, the current draw through that resistor and the transistor base to emitter (grounded) dragged the voltage at the output pin low enough that it read back as a logic low (zero) all the time, so when I set one of the other bits the relay output would be set low. I had to keep an image of the desired outputs in RAM, change that, and then write it to the port every time.

Also, can the LM3849 input power ever be lower than the PIC's? It's not good for either chip to to have the PIC trying to feed a high into any control input of a non-powered chip.
 

Thread Starter

jpanhalt

Joined Jan 18, 2008
11,087
Thanks for the comments. The 12F509 only has the single GP port.

The LM3849 will be powered by a 24 to 26V supply. The PIC is running off the CT with a 5V voltage regulator.

John
 

mik3

Joined Feb 4, 2008
4,843
In the datasheet it says that the enable pin of the LM3849 is internally pulled up and clamped at 8 volts. Thus if you power the chip with 24V and you measure the voltage between the enable pin and ground it will be 8V. This is higher than the PIC power supply and its not good to connect it to the PIC output even with a resistor because it may cause latch up problems and destroy the PIC. Its better to use a small transistor to make your job.
 

Thread Starter

jpanhalt

Joined Jan 18, 2008
11,087
That is the whole question in a nutshell. It apparently is a weak pull up, and National further says it can be driven by up to 5.5 volts. So, if the PIC can sink 20 mA or so, then a resistor should do it?

I understand what you mean about latch up. I was just wondering about others' experiences.

It is really a small detail. There is plenty of room for a 2N3904. This is mostly learning for me, so I wanted to test the limits a little.

John
 

mik3

Joined Feb 4, 2008
4,843
I read the datasheet more carefully and it says that you can apply a maximum voltage of 5.5V at the enable pin. Also, it says that if increase the voltage above 8V it will be clamped internally at 8V which is something not very important to you. Thus its safe to connect the output of the PIC directly to the EN input even without a resistor because digital inputs have high impedance but for safety connect a 1K resistor between the PIC output and the EN input.
 
Top