Understanding MCU pin specification

Discussion in 'Embedded Systems and Microcontrollers' started by Vindhyachal Takniki, Dec 16, 2014.

  1. Vindhyachal Takniki

    Thread Starter Member

    Nov 3, 2014
    1. I am using STM8S003F3 whose datasheet I have attached.
    2. I have question understanding its parameters : Injection current & power on any pin from external source when MCU is powered off.
    3. Typically MCU have two diodes connected on pin so that whenever pin voltage exceed/lower 0.3V from supply they get turn on. Now we can place a resistor in between to limit the injection current.

    Case 1: When MCU is powered
    E.g if I apply Vin = 7V external, then internal diode will turn on , so that internal pin circuit will see that voltage. If diode has .3V drop then voltage will 5.3V.
    Now to limit the current , I can place a resistor like 10K. It will always limit the current within Iinj(max) of pin.
    Now how much value can be Vin i.e what could be its max value
    I guess it can't be 100V & if I limit the current then MCU will work pin by turning on its diode.
    There will be some breakdown voltage. Where it is mentioned in datasheet.

    Case 2: When MCU is unpowered
    e.g I am using uart or adc. Then even if MCU is unpowered. External sensor/uart will keep on giving some voltage on pin.
    E.g external uart keep tx pin high.

    So how to protect the MCU pin in this case when it is unpowered?
    Will limiting the current to Iinj(max) will save the pin?
  2. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    You are correct thet by using a Schottky diode you can limit the pin voltage. The injection current INJ(PIN) can be limited by using a series resistor and ohms law. I have done similar things where my micro was connected to the AC line itself thru several hundred megs of resistance, so the practable limit on voltage is pretty high if you work on it a bit.

    That's simple when the power is on. With power off that diode provides a path to the power rails and can be a source of power to the device. How to control that depends on the rest of the circuit, but a low value resistor across the power rails will act as a resistive divider so the net Vss voltage can be arbitrairly low, as long as you can "waste" that current when on. If you can't waste that power you could switch the resistor on by other means.
  3. MikeML

    AAC Fanatic!

    Oct 2, 2009
  4. MrChips


    Oct 2, 2009
    Exceeding voltage and current limits at the inputs is a serious matter not to be taken lightly. Catastrophic failure from CMOS latchup must be prevented at all cost.

    I would not rely on the input protection diodes if you expect the input voltages to exceed the power supply voltages (going above Vdd or below Vss).

    There are solutions available using level shifters or optocouplers.

    Using two resistors to create a voltage divider AND two Schottky diodes clamp is also a recommended solution.