I'm using a PIC16F877 to decode IR (among other things) using the CCP2 module (which is tied to a pin on PORTC). The pin is set to be an input early on and never changed. After setting up a bunch of stuff, I in my main code loop all I do is a poor-man's PWM of the display LEDs. I basically load a pattern of lit LEDs on PORTD from a register, write it to PORTD, do a bunch of NOPs, then clrf PORTD, do a bunch more NOPs, then loop and do it all over again. In the same place I also set PORTE the same way. PORTE is used for additional display LEDs. What's odd is that the first 50ms or so that clrf PORTE happens (or movlw 0x00, movwf PORTE), it's toggling the output of the PORTC:1 pin (which should be an input). The rate is sporadic, but does appear to settle on about a 50% duty cycle with a period of under 1ms. Before it's done, that periodicity does change. It only happens for about 50 ms, and then it's done. If I comment out the clrf PORTE, the behavior does not occur at all. Any ideas? TIA, -- Rick -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu