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?