Mark Rages wrote: > go for random failure: > > #define if(x) if ((x) & PORTA) Or for even more fun, drive it off of TMR0: #define if(x) T0CON ^= 0x80; if ((x) & TMR0L) Or even: #define if(x) T0CON ^= 0x80; if ((x) & (TMR0L == TMR0H)) Which toggles the timer on-state every time an 'if' statement rolls around. I'd file this under "absolutely evil" -- if the code makes use of TMR0 it's going to completely screw up the timing, if it doesn't... well... good luck figuring out what's going on, especially if TMR0L wasn't initialised to a defined value on boot (most 18Fs clear TMR0H to zero on any reset, but it's undefined on wakeup from SLEEP; TMR0L is undefined at any reset or wakeup). -- Phil. piclist@philpem.me.uk http://www.philpem.me.uk/ -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist