Quote Originally Posted by Bill Legge View Post
I'm using: PIC16F877A @ 20 MHz, an I2C RTC with PBP.
The story so far:
1. All works well - set the clock, read it and display the time.
2. I have a loop counter (VAR BYTE) in my software to do a job not connected with the RTC.
3. As long as the variable is a BYTE it works properly.
4. But if I make the loop counter a WORD - it will not increment (Variable = Variable + 1) fails to work. If I by-pass the RTC - it starts working!
5. The name of the loop counter is unique and not used in the RTC code.
6. I do need the variable to be word-sized.
Any ideas anyone?
Regards Bill Legge
Use 2 nested byte size LOOP counter variables:
For temp1 = 1 to 10
for temp2 = 1 to 10
work work work work work
next temp2
next temp1

Individually, they count to 10, together they count to 100. Same thing if you've got 2 byte counters nested. Individually, they count to 256, together they count to 65536. Do the multiplication/shifting inside the routine as required to get the actual word variable.

Or, just post the code so we can all help you figure out why the WORD is failing...