Can a PIC drive an Enable pin?

Discussion in 'Embedded Systems and Microcontrollers' started by jpanhalt, Nov 19, 2008.

  1. jpanhalt

    Thread Starter AAC Fanatic!

    Jan 18, 2008
    5,699
    905
    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:

    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:
    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
     
  2. mik3

    Senior Member

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

    Member

    Nov 11, 2008
    16
    0
    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.
     
  4. jpanhalt

    Thread Starter AAC Fanatic!

    Jan 18, 2008
    5,699
    905
    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
     
  5. mik3

    Senior Member

    Feb 4, 2008
    4,846
    63
    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.
     
  6. jpanhalt

    Thread Starter AAC Fanatic!

    Jan 18, 2008
    5,699
    905
    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
     
  7. mik3

    Senior Member

    Feb 4, 2008
    4,846
    63
    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.
     
  8. jpanhalt

    Thread Starter AAC Fanatic!

    Jan 18, 2008
    5,699
    905
    Great. That is what I will do. Thanks. John
     
  9. mik3

    Senior Member

    Feb 4, 2008
    4,846
    63
    As you see we all learn here! Sometimes we cant see the solution directly.
     
Loading...