Hi Peter. I just did an MPLAB sim on your asm version. It works as you would expect. I also ran it as a 16C73 on my trusty old PICmaster emulator (won't do 877s) and it works the same as the sim. TMR0 increments by ones and twos as advertised depending on the instruction type. BTW, your equates need to be moved up to 0x20 or higher. Right now, they are in the middle of the SFRs. Now for the real question -- is your program really working and your emulator just isn't showing you or is there really something wrong? What you should do is calculate your TMR0 interrupt rate and toggle an output pin. Monitor the pin with a scope to see if it happens at the right rate. If it does, at least you can keep developing with some degree of confidence until we can sort out why TMR0 doesn't look like it works. If not, might be time to call your emulator manufacturer and talk to him. Bill At 08:08 AM 06/10/2002 +0100, you wrote: > http://www.piclist.com/postbot.asp?id=piclist\2002\06\07\153942a > >Thanks for the reply and yes I hadn't assigned the Prescaler in that example,BUT this is not the real problem. > >I have written other code to select the prescaler for the TMR0 but is not that the PIC isn't counting/timing at the correct rate it's more drastic.... > >*** the TMR0 register is just RANDOMLY changing **** >I can see no sequence in the numbers at all. They appear to just change at will on every instruction. > >When I run this in the simulator all is well and I get the TMR0 register changing as expected. >So why NOT on the real hardware??? > >I have now written it in assembler and still I must be missing something obvious... > >; Use PIC16F84 and set radix system to decimal > LIST P=16F877, R=DEC > code snipped... -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu