Using the 16F628 and its Timer0, I have designed a simple dimmer circuit that works satisfactorily. Timer0 is assigned a prescaler of 1:64. The brightness is varied by loading the appropriate value into TMR0 register after the zero crossing. Instead of using the interrupt, the T0IF (INTCON.2) bit is polled. When TMR0 overflows, the triac is fired. I find the circuit working nicely with smooth dimming. Settings used: OPTION_REG = %00000101 'Weak Pull-ups enabled; 1:64 Prescaler assigned to TMR0 Timer2 is also an 8-bit timer and is basically similar to Timer0. With a 1:16 prescaler and 1:4 postscaler, I think it is equal to 1:64 prescaler of Timer0. PR2 register value is 255 (value on reset). The TMR2IF bit (PIR1.1) is polled to check whether Timer2 has overflowed. But, when I try to use Timer2 with these settings, the lamp burns with medium brightness and there is visible flicker. Later, the uC freezes. Settings used: T2CON = %00011111 'Timer2 is enabled with a prescaler of 1:16 and postscaler of 1:4. My plan is to add another lamp with independent brightness control for the two lamps The second lamp will use Timer2. Why am I not able to use the Timer2? Is there any special setting that I am overlooking? After going through the data sheet several times, I thought I would seek the help of PIC gurus. I would much appreciate any help/suggestions. Regards, Bala -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads