Thanks to all who replied to my plea for help. No-one seemed to have a convincing answer as to why the code in AN512 configured the timer 0 as a counter and then polled the TMR0 regsister. I decided just to poll RA4 as a normal input, and (this bit of) my code is now working fine. The schmitt trigger is still used so I can't see any reason not to use this method, and it means timer 0 is free for other purposes (as long as you don't want to use external clock) Most of my headaches came from the Read Modify Write instructions on ports that were driving a mosfet H-bridge, I guess the gate capacitance was slowing things down a bit. Nothing that a coupla NOPs didn't sort. My last remaining bug is the PWM (CCP1) output latching up. I can't set the PWM output to maximum as the output is AC coupled to a diode pump so it would stop working. I limit the maximum value I send to the CCPRL1 register, but occaisionally the output gets stuck high. When you do a RMW instruction on port C with the PWM active, does the micro read back the current state of the PWM output? If it happens to be high I guess a 1 could be written back to the output register? I can't believe this is the case as it would make using the port a nightmare. My employers decided that buying an ICEPIC2 emulator (with real time trace) would speed things up on the development front, so I should have a new toy to play with this week! Anything I should watch out for when using this or any problems that anyone knows of? Regards Mike Rigby-jones mrjones@nortel.co.uk