Help! I need help with the firmware to make an LED dimmer with a 12C509 PIC running off the internal oscillator. I have been able to read a pot and dim the LED with PWM, but my source code does not run fast enough to keep the LEDs from flickering(They are multiplexed 7 segment displays run off another PIC). I would like to do the PWM at about 1KHz. That doesn't leave a lot of time to read the pot, etc. The code also needs to check an input pin and output a pulse on another pin if a switch is closed for more than 2 seconds. The resolution doesn't have to be real high and the duty cycle doesn't have to be a full 0 to 100%, but the closer I can get the better. I appreciate any help anyone can give me. I am not good with real time programming.