In this example, the prescaler is connected to the oscillator, but I want to use it elsewhere temporarily.
Does anyone know if the picchip prescaler will reset itself back to zero because of this, or can I expect the prescaler to hold it's last value? Reason for asking is for timekeeping, if the prescaler keeps the last value, then this will keep reasonably good time, otherwise if it resets, then I've introduced error/drift into my timekeeping.
clrwdt ;make sure WDT doesn't trigger movf TMR0,w ;hold last TMR0 movwf temp movlw b'11111011' ;need TOCKI, switch prescaler to WDT
...do stuff...
movf 2 ;update TMR0 to new count addwf temp,w movwf TMR0 movlw b'11101011' ;switch prescaler back to OSC