I am trying to make a real-time-clock. I am using timer1 on a
PIC18F1320, hooked up to a 32.768KHz watch-type crystal. The code
didn't seem to do anything, so I tryed to step through with the ICD2
stepper. It stepped fine through the initialization, until it got to
the command where it moved b'10111111' into T1CON. Then, it started
saying: unable to complete operation - target not in debug mode in the
output window, and it stopped stepping. Does anyone know why TMR1
would cause the ICD2 to stop working?
Here is my OSCCON setup:
It stops on the second line of this:
BTW, in the config bits, the oscillator is set to C9 - INT RC-CLKOUT
on RA6, Port on RA7.
BTW2, here is my wait till next second function: (Any ideas whether
it will work?)
btfss STATUS,Z ; hold until rollover
btfsc STATUS,Z ; don't let us out until no longer rollover