> "When my program blows up randomly, the first thing I look for is..." >=20 An emulator with TRACE possibilities :-) Stack overflow. Bank and page switching. Interrupt routine messing with noninterrupt variables or=20 routines. One thing that has bitten me a couple of times: Interrupt=20 routine that directly sets an IO pin of a port that is also=20 managed by the main program while it is temporarily holding the=20 port value in a register.=20 Code for main program: 1: mov w,#BITMASK 2: and w,PORT 3: do something to the port value here 4: mov PORT,w If you get an interrupt that also sets an output in this port=20 register at step 3, it is lost as soon as the interrupt is=20 returning and step 4 is executed. Ruben=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D Ruben J=F6nsson AB Liros Electronic Box 9124, 200 39 Malm=F6, Sweden TEL INT +46 40142078 FAX INT +46 40947388 ruben@pp.sbbs.se =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads