Hello, I've been playing with PIC for a while now and have created a number of units based on the 16F84 range. Just lately I've migrated to the PIC16F877 and using the ICD have developed a graphical display unit with LCD etc etc. This all works 100% O.K. I'm using HiTECH C. The problem is this..... I've been trying to get the TMR0 timer0 to increment once per instruction cycle on my PIC16F877. This would at first appear very very simple. I have done this before without any problem on the PIC16F84. It also works perfectly under simulation but....... The hardware PIC16F877 appears to randomly increment the TMR0 register as soon as I set TOCS=0 and I cannot see any reason for this. Even single assembler instructions to set the TMR0 register to a value do not work. With TOCS=1 I can set TMR0 to any value I like but of course it doesn't do anything as I don't have any clock source on T0CKI. I have included (In the next email!!!) a sample program below (written for HITECH C). This code functions perfectly under simulation but neither my hardware (20MHz) or the ICD demo board (4Mhz) function properly. I also compiled it for the PIC16F84 and that ran perfectly as well so it only the PIC16F877 that seems to get upset? I would not suspect my hardware as it also does this on the "Advanced Transdata" demo board that came with my ICD. I have also tried to do this under MPLAB movlw 0xA movwf 0x1 but it does not work!!! Unless I have T0CS=1 which is pretty stupid. TMR0 just goes on blindly changing at random. I've checked the register bank select bits are being set to bank0 where TMR0 is located at address 0x1. I am at a complete loss and cannot work out why the same program works fine for the 16F84 but not the 16F877 ???? I hope you can help as this has now crippled my product and I'm going nowhere fast. Thanks Pete peter@trlperformance.com -- http://www.piclist.com hint: The list server can filter out subtopics (like ads or off topics) for you. See http://www.piclist.com/#topics