In message <9607292038.aa09032@device.data.co.za> Kalle Pihlajasaari writes: > Hi Mike, > > > I am having difficulty getting MPSim in MPLab to detect that tmr0 on > > a C84 has overflowed. I'm not using interrupt, just polling the bit, > > but it never detects the bit change, even though it works in the > > part itself. > > Been playing with exactly the same things the whole weekend. > > I have not used it with the prescaler yet but you must keep an eye > on the interaction between the cwdt command and the prescaler, there > may be some incorect mutual effects there. > > You have used the wrong flag. > > The rtif is used for the port B0 interrupt (selectable edge polarity in > OPTION register) and th T0IF is used for the timer 0 overflow flag. Okay, so I'm using an old equates file. RTIF is bit 2 of INTCON. > > BitLoop > btfss INTCON, T0IF ; spin on bit counter > goto BitLoop > > The above works fine. My problem is more a MPLab problem than a PIC problem. The code works fine in silicon and in the dos MPSIM, but when I run it in the simultaor in MPLab, it never leaves my equivalent of your bitloop. I am using MPLab version 3.09.02. It is annoying, as I have had to go back to the dos simulator to test my code :-( Regards, Mike