I suspect most of your problems stem from a mistake in your initialisation:
Initialize
;-------CHANGING TO BANK 1 ----------
BSF STATUS, RP0 ; Select Bank 1
;***** SET UP PORTS AS INPUTS OR OUTPUTS *****
CLRF PORTA ; Initialize PORTA by setting output data latches
Incorrect!! You are in bank 1 and cannot access PORTA from here.
MOVLW 0000h ; Value used to initialize data direction
MOVWF TRISA ; ALL 5-pins set as output
This is fine.
CLRF PORTB ; Initialize PORTB by setting output data latches
Again, incorrect. PORTB is in bank 0.
MOVLW 0001h ; Value used to initialize data direction
MOVWF TRISB ; ALL 8-pins set as input
All 8 pins are not set as inputs. You have only set pin 0 as input, the rest as outputs.
;***** ASSIGN TO TMR0 ****
bcf OPTION_REG,PSA ; PSA = 0
;Set Prescaler to 16 [011=PS2|PS1|PS0]
bsf OPTION_REG, PS0
bsf OPTION_REG, PS1
bcf OPTION_REG, PS2
;-------CHANGING TO BANK 0 (default) ----------
BCF STATUS, RP0 ; Select Bank 0
As you are using a 16F84 you might like to consider using the TRIS instruction to save having to set banks.
e.g.
movlw 00h
tris PORTA ; set all PORTA as all outputs
movlw FFh
tris PORTB ; set all PORTB as all inputs
clrf PORTA
clrf PORTB
Hope this helps
Mike Rigby-Jones
-----Original Message-----
From: Saurabh Sinha [SMTP:ssinha@IEEE.ORG]
Sent: Friday, March 31, 2000 9:44 AM
To: PICLIST@MITVMA.MIT.EDU
Subject: ISR is never called
Hi,
Another problem, with my filter program, the ISR never gets called! Its
supposed to be called every 1/300 s, at which PORTB is to be read.
[I have used a intial TMR0 value of 47 and a prescaler of 16 to get the
1/300 s delay.]
Any ideas??
Thanks for your replies. [past & future]
Regards,
Saurabh << File: latest.asm >>