N-channel transistors and the LED that wouldn't blink

I've been designing a major circuit board for work over the last few months and we finally fabbed the first turn of boards last week. They showed up on Friday afternoon and I started populating and testing yesterday. In testing a new board, we tend to populate small functional blocks one at a time and test them. The first thing to go on-board was the power supply. The only problem with this was that the inductors we had in stock for the switching supplies were through-hole, while my layout called for SMT. Not a major issue; they just float above the board a bit and it looks bad—but the output voltages are rock solid.

Next up was the microcontroller, with which all of the other functional blocks communicate. This is the most complicated part on the board and the most challenging part to test. I put a minimum of support components on board—just enough to program the CPU and test that I had control of it. This ended up meaning populating the JTAG programming port and the heartbeat LED. A 100-pin CPU with one bit output. Sweet.

The good news is that the microcontroller (an SiLabs C8051F120) came up on the first try and all of the JTAG stuff worked without a hitch. It accepted my skeleton firmware and drew a very cool 5mA at 12V. All of my attempts to make the light blink, however, were fruitless. The LED anode is tied to 5V through a current limiting resistor, the cathode goes into the drain of an N-channel transistor. The transistor source is tied to ground, and the gate is tied to an output from the microcontroller.

Those of you with EE degrees probably already understand why this will never work. I, however, am but a lowly nuclear engineer and was unfortuantely approaching this piece of circuit with an over-simplified view of how transistors work. The concept I had going in went something like this: A P-channel transistor conducts between the source and drain when the gate is high, whereas an N-channel transistor conducts when the gate is low. This would be the case if transistors were actually switches, but they aren't; they're semiconductors.

The thing about transistors is... they work on charge. You need some excess charge to overcome the potential barrier introduced by the P-N semiconductor junctions inside. In my case, where I had the source connected to ground and a low-active gate.... there was no charge to perpetrate the "switching" and the drain floated, hence I was unable to control the LED.

When I switched to a P-type transistor with the same footprint, and swapped the polarity of the output from the microcontroller, the LED submitted to my control and ye, there was das blinkenlight. This is because now I was providing charge at the gate to overcome the NPN barrier and cause the transistor to conduct. Fascinating. So the P-type transistors work as I expected they would. But the N-type only work that way if the source is high.

So the audience-participation question is: When I had the N-type transistor in place and sent a series of 3.3V pulses into the gate, what was the state of the LED and what did the scope trace look like on the drain?

"N-channel transistors and the LED that wouldn't blink" Comments

Looks like everyone is afraid to jump in for fear of making themselves look non-geeky. Since I know I am not a geek, I will say the light was on and the trace was a series of spikes.


Post a comment
Name Required
Email Required

URL
Remember info
Yes No

Comment Required


Type the characters you see in the picture above.