Now that I think about it, skimask
The timer0 interrupt is the one not being delt with and not the other way around. If the tmr0 int happens more often then I would expect to see it happen and maybe miss the others.
Would you not agree?
 Now that I think about it
 Now that I think about it
		Now that I think about it, skimask
The timer0 interrupt is the one not being delt with and not the other way around. If the tmr0 int happens more often then I would expect to see it happen and maybe miss the others.
Would you not agree?
 
 
		Isn't that what I said?
"TMR0 interrupts happen a lot more often than TMR1."
The only reason I said TMR0 would happen more often is because it's 8 bit (usually). At any rate, you probably need to re-enter the interrupt routine to check on other interrupt sources in case they happen in the middle of your initial interrupt routine.
 I dont get it
 I dont get it
		Hmmm.....
Sort of. But if what you say is correct then the TMr0 interrupt would be seen and not the tmr1.
I am seeing the Tmr1 and not the Tmr0.
Am I missing something in what your saying?
 
 
		Your original code with a few changes.
DEFINE INTHAND ROLLOVER
wsave var BYTE $020 SYSTEM : wsave1 var BYTE $0a0 SYSTEM : wsave2 var BYTE $120 SYSTEM : wsave3 var BYTE $1a0 SYSTEM : ssave var BYTE BANK0 SYSTEM : psave var BYTE BANK0 SYSTEM
i_hour var BYTE : i_minu var BYTE : i_sec var BYTE : i_tic var BYTE : i_sec0 var BYTE : i_tic0 var BYTE : 'PowerLed var Portd.2
GOTO AFTERINT 'Jump past interrupthandler
asm
rollover
movwf wsave
swapf STATUS, W
clrf STATUS
movwf ssave
movf PCLATH, W
movwf psave
; interrupt code follows here
recheckints
btfsc PIR1,0
goto timer1Interrupt
btfsc INTCON,2
goto timer0Interrupt
goto restoreall
timer1Interrupt
;Timer 1
movlw 0x58
movwf TMR1L
movlw 0x9e ;restart timer from ffff - 9e58 => 5Hz if using 4MHz
movwf TMR1H
decfsz _i_tic,f
goto slutint1
incf _i_sec,f
movlw 5 ;5 = 1Hz if using 4MHz (change to 10 for 8MHz and so on)
movwf _i_tic
movf _i_sec,w
slutint1
bcf PIR1,0 ;zero tmr1 interrupt flag
endasm
if i_sec = 60 then
i_sec = 0
endif
toggle portd.2
goto recheckints
asm
timer0Interrupt
; Timer 0
movlw 00010000
movwf option_reg
decfsz _i_tic0,f
goto slutint2
incf _i_sec0,f
movlw 1 ;5 = 1Hz if using 4MHz (change to 10 for 8MHz and so on)
movwf _i_tic0
movf _i_sec0,w
slutint2
bcf intcon,2
bcf PIE1,0 ;zero tmr0 interrupt flag
endasm
if i_sec0 = 60 then
i_sec0 = 0
endif
toggle portd.3
goto recheckints
asm
;end of interruptcode
; restorecode follows here
restoreall
movf psave,w ;restore
movwf PCLATH
swapf ssave,w
movwf STATUS
swapf wsave,f
swapf wsave,w
retfie
endasm
AFTERINT:
INTCON = %00000000 'all interrupts off
PIR1 = %00000000 'zero tmr1 interrupt flag
PIE1 = %00000001 'enable timer1 interrupt
TMR1L = $58 : TMR1H = $9e : i_sec = 0 : i_sec0 = 0
i_tic = 5 'this value should be the same as the value of line 8 in the ISR
i_tic0 = 5
T1CON = %00110001 'timer1 on, prescaler=1/8
INTCON = %11010000 'interrupt on
MAINLOOP:
pauseus 1 : goto mainloop
END '<- VERY Important to have this part!
Try that. Added new labels to recheck the interrupt flags and a loop for the program to run while it waits for stuff to handle.
 Thanks
 Thanks
		I realy do appreciate your help here.
As you no doubt know, it can get realy frustrating when things Should work but dont.
Ill try this code tonight
Bookmarks