Re: Help with configuring
Re: Help with configuring
if you enable interrupts and provide no code to service the interrupt and worse still provide no code to reset the interrupt flag what do you expect to happen ?
Re: Help with configuring
Here you are:
Code:
ISR:
asm
movwf wsave ; Save WREG
swapf STATUS, W
clrf STATUS ; Point to bank 0
movwf ssave ; Save STATUS
movf FSR,w
movwf fsave ; save FSR
movf PCLATH, W ; Save PCLATH
movwf psave
; get ready to jump within the ISR page
movlw ((INTHAND) >> 8) ; Set PCLATH for jump
movwf PCLATH
btfsc INTCON, INTF
goto ZeroCrossingInt
T0Overflow
bcf INTCON, T0IF ; clear the timer overflow flag
goto EndInt
ZeroCrossingInt
bcf INTCON, INTF ; clear the interrupt
EndInt ; restore the machine state and return from interrupts
movf fsave,w
movwf FSR ; restore FSR
movf psave,w
movwf PCLATH ; restore PCH
swapf ssave,w
movwf STATUS ; restore Status
swapf wsave,f
swapf wsave,w ; restore WREG
retfie
endasm
Re: Help with configuring
I cant see that you have declared wsave ,ssave and psave vars ?
Re: Help with configuring
I missed that.
Code:
wsave var byte $70 SYSTEM ' safe for W in all banks
ssave var byte BANK0 SYSTEM ' save STATUS
psave var byte BANK0 SYSTEM ' save PCLATH
fsave var byte BANK0 SYSTEM ' save FSR
Re: Help with configuring
Re: Help with configuring
I know that. But latency causes problem.
Re: Help with configuring
Quote:
Originally Posted by
financecatalyst
I know that. But latency causes problem.
What latency? I have never noticed any with DT's INTS.
Re: Help with configuring
Suggestion: Simplify your job by switching to a 16F1823. Same pinout as your present PIC but with automatic context saving.