I am trying to use timer2 on a 16F877 to create an interrupt= roughly every 50mS. To this end I have enabled the software interrupt in CCP2CON to software trigger (0x0A), loaded CCPR2L with 'd' 30. T2CON I have= postscale *16, PIE2 is enabled as is PIE in INTCON (I'm using= TMR1 elsewhere). The value for CCPR2L comes from CLOCK 10MHz /4=3D 1/(2.5MHz/256/16/30)=3D49.15mS My problem is that at 51mS the test for CCPI2 in PIR2 is set - no= problem, however it will not clear until approx 58mS have passed= and then does not set itself again. I am writing this program in 'C' but have changed the test from= the torturous movlw 254 andwf H'0D' produced by the compiler to= inline assembler BCF PIR2, CCP2IF but it makes no difference. I have tried prescaling instead of postscaling but my= understanding is that the S/W interrupt is generated after the postscalar for timer2. I have read the 16F8xx and 877 and AN594b pdf's but they all seem= to leave me hanging, as they only describe in detail the PWM= attributes of timer2. I have seen this technique used by Peter Anderson using the CCS compiler, so I assume it should work. Note my compiler is not= CCS. My Timer0 and Timer1 routines work fine. Am I trying to use= timer2 in a way it's not designed to be used? Thanks for any help Colin -- cdb, cdb@barnard.name on 31/03/2002 -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu