That's a Car Battery? Do you know what the maximum voltage you can expect on that circuit to be? How about plus and minus 200 volts? They're the expected impulse voltages caused by power windows and windscreen wipers when the switches spark. The collector should then drive the base of a second PNP transistor through a resistor that has its emitter connected to the 12V rail. You want an NPN with the emitter grounded and the base driven from the GPIO through a resistor. You probably need to redesign it with at least two transistors. You have to design for that case as well. The pin is also an input when the CPU is being reset on its power-on. It can drive up to 3.3v, but it can't keep a pin that is trying to go above 3.3V down to that when it is driving high. It doesn't matter that the GPIO pin is an output. The circuit must never under any circumstances be able to put a voltage on any CPU pin that is outside its maximum range. The circuit has to be redesigned so it doesn't destroy the CPU. The mistake of the transistor orientation doesn't matter. If the transistor was an NPN, the voltage divider created by R916 and R240 still put 6V back onto the CPU. That means this CPU can't take any "injection current". The question about "injection current" has been asked before on this forum, and Freescale didn't answer the question: Some microcontrollers have a specification for "injection current" which means you're allowed to inject a few milliamps into the pins like this through a resistor. Your circuit provides way more than that and at quite a high current (10mA or so). The Data Sheet shows the MAXIMUM voltage allowed on any I/O pin is VDD+0.3V. With the PNP, the 12V will go directly through the transistor, emitter to base, through R239 and will likely destroy the CPU. You have a PNP transistor shown, not an NPN. I can't understand how that circuit works. If you don't want that you'll have to add a pulldown resistor to that pin to make it work properly at power-on. That shows that pin defaults to a 100k pullup on reset, and that is enough to turn Q6 on at power-on. Have you considered the power-on reset condition? Read "36.4.314 Pad Control Register The SS9013 has a minimum gain of 64, so that 10k base resistor is fine. You should use a 60V or 80V transistor instead. As well, the SS9013 is only rated to 20V. They will be needed for a "real product". It doesn't have any protection against any faults, and it doesn't have any EMI/EMC circuitry. Is that what you want? If it is, it is better to put a pullup to 3V3 rather than 12V. As well, during reset, that pin will default to ON. Why do you have R116 there anyway? The GPIO pin can turn the transistor on and off without it. So with that circuit the transistor will turn itself on at higher temperatures and voltages. Looking at the Data Sheets for a typical transistor like the following shows the transistor is on (drawing 1mA) with Vbe of 0.35V at 150C: Neither of those voltages will work at high temperatures. If this is in a car, the battery voltage tuns up to 15V or so, so it would be 0.15V + 15*220/10220 = 0.47V. The transistor might switch on and off (I'll work on that in a minute), but as the output CVBS_OUT_EN pin is connected directly to ground through two zero-ohm resistors, it isn't going to give much of a signal!Īre you within specs for the GPIO pin? The rated current into the GPIO is 1mA. With a 2N3904 I would expect the voltage across the top resistor to be something around 4.3 V and the voltage drop across the bottom one to be something like 20 mV (a gain of about 200), placing the base of the transistor at about 700 mV give or take.The first circuit now protects the CPU pin as the voltage is limited by the BE voltage. Perhaps the model he is using is for a power transistor. So the voltage drop across the bottom resistor on the left in his sim is about 150 mV while the voltage drop across the top one is about 4.15 V but this is only a ratio of about 28. In either case the Vbe can be assumed to be roughly 0.7 V (or 0.6 V or anything in that ballpark).
Here's my reasoning: In that circuit the current in the top resistor should be a few hundred times as much as the voltage in the bottom resistor and, thus, has a few hundred times as much voltage drop. I would expect it to be closer to 700 mV. What I have an issue with is that the base voltage in the left sim seems too high. Also, even if they are the same device the particular models in the two libraries might not agree, at least as far as the parameters that are important in reverse operation like this. If he used something other than a 2N3904 that might well explain it. I don't see any indication of what transistor Dordodynov used.