how do i leave this mailing list pls can u tell me as sonn as posible. thanking u nadeem -----Original Message----- From: cwindle@LYCOSMAIL.COM To: PICLIST Date: Wednesday, June 03, 1998 6:43 PM Subject: Re: clocking of TMR0 >...Andy, Clyde > >Thanks for an explanation, I can't say as I fully understand this though! > >>It does. The single-stepping is accomplished by >> inserting opcodes into the >>PIC rather than allowing it to read from the (external) >>program ROM-emulator. > > >The emulator can't use 2 instructions to execute a single step, else TMR0 would increment by 2. > >I tried running the code section below at full speed and did get the correct value of 246 in W, as Mchip say. > >nop ; After Instruction contents are >nop ; EMULATOR SIMULATOR >nop ; T0 W T0 W >movlw 245 ; - 245 - 245 >movwf TMR0 ; 245 245 245 245 >movfw TMR0 ; 246 245 245 245 >movfw TMR0 ; 247 246 245 245 >movfw TMR0 ; 248 247 246 246 >movfw TMR0 ; 249 248 247 247 > >I suppose the rule is just not to trust timer 0 when single stepping with the emulator. I'm suprised that the microchip simulator (I'm using the version integrated with MPLAB 3.31) does not give the correct reg contents. > > >Chris. > >----------------------------------------------------- >Get free personalized email at http://email.lycos.com > >