On Fri, 1 Feb 2002, Peter Onion wrote: > On 01-Feb-02 Sean Alcorn - Avion Sydney wrote: > > > >> Have you tried running and monitoring it in MPLAB ? (with and > >> without the delay500 enabled) > > > > No. I have never had any success running in MPLAB! It takes far too long!!! > > > > Take a hint Sean :-) Finding this sort of bug is exactly the sort of thing > that simulators were designed for ! > > The reason it "It takes far too long!!!" in MPLAB is probably the same reason > it seems to go around the loop too many times on a real PIC. > > Watch the value of COUNTER and see if it is being changed in unexpected places > in the code. You may wish to investigate gpsim as your debugger. It can handle both of the issues raised here: 1) Execution speed; gpsim runs faster than a real PIC 2) Watching registers for you; You can set break points on register reads or writes (you can even set break points on register bits). http://www.dattalo.com/gnupic/gpsim.html Scott -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads