OK, an interesting one. Well in my view anyway
Ordinarily, if I was going to control a LED’s intensity I would use PWM.
I have an LCD, and the backlight will not operate on 3v3, so I have to use 5v to illuminate it. That also means can’t directly control it with the Fez’s PWM line.
So it’s pretty simple, if all I want to do is turn it on and off - use a transistor.
But that’s not what I’d like to do. I’d like to be able to dim it as I turn it on and off, so that it ramps up/down the light intensity.
I have done some tests using a BC548 NPN transistor and when I use PWM in a test moving between 0% and 100% with 10% steps, I get flicker at 90% or lower. I’ve tried different PWM frequencies but that didn’t make any difference (and I’m not sure why). I don’t have an oscope to watch the waveform, but I’ve tracked voltage with a DMM and see it changes as expected. I wondered whether the frequency was too much for the transistor, but can’t see anything in the datasheet that talks specifically about switching frequencies - there is mention of mhz, so my paltry 10khz signal should be no problem, it has to be something to do with the LCD’s LED
So does anyone have any suggestions on how to achieve that?
edit: I also just put the signal through a level shifting buffer, a 74LS245, and the same flickering is evident - that’s the other reason I reckon it might be something to do with the LCD