I have an IR LED which is switched at a rate of 32.768kHz from an oscillator circuit (relevant portion shown below). I have 10 prototype PCBs. 30% of them work while the others don't. The problem is not the oscillator itself but the output stage.
On the boards that don't work, the waveform at TP7 (base) is a very nice square wave. So, the oscillator is working just fine. Measuring across R5 (TP1 to TP6) I can see that the bad boards conduct but don't switch. In other words, the LED output does not oscillate with the input at the transistor base.
Any thoughts to what the problem might be? I am well under the maximum switching frequency for that particular BJT. Also, my base resistor should put me well into saturation.
One thing you can't tell from the information below is that this is a battery driven circuit (CR2032). Due to its relatively high internal resistance the current through the LED with a fresh battery never exceeds ~ 100mA. So, R5 really isn't necessary. It's simply there so that I can test from a power supply. The battery is also 'switched in' as noted in the second image.
Any thoughts?
EDIT:
Here is a waveform at the base of the transistor Q2:
Here is a waveform across R5 on a good board:
Here is a waveform across R5 on a bad board:
Here is the battery voltage on a good board: