|
Something's wrong
Okay, thanks for your help so far - I've gotten it to work more or less. Some things, however, are still bugging me.
To drive my LED's, I'm using a BS107P FET. The LED lights up and 'dims' as according to the potentiometer position, but its bugging me that I can still detect the flicker. I don't think I should be detecting any flicker - I set timer2 up with a 1:1 prescaler, so each tick is 100ns (10Mhz). The period register is set at 0x40 (64), so one period of my PWM signal should be 64 * 100ns, or .0064 seconds. This means the period repeats itself 156.25 times in a second... if you think of the period as one "frame", that would be 156.25 frames per second - about 5 times faster than television's 30fps. If television seems smooth at 30fps, how come 156 flashes per second results in a flicker?
If my reasoning is wrong and 156Hz does in fact produce a noticible flicker, is there anyway I can do to reduce this flicker? For example, would adding a capacitor to smoothen the square wave work?
|