Truncated match.
PICList
Thread
'ISR is never called'
2000\03\31@034944
by
Saurabh Sinha
part 0 520 bytes content-type:application/octet-stream;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
Content-Type: application/octet-stream;
name="latest.asm"
Content-Disposition: attachment;
filename="latest.asm"
Attachment converted: growth:latest.asm (????/----) (00008E12)
2000\03\31@043814
by
Michael Rigby-Jones
|
part 0 9705 bytes
<P><FONT COLOR="#0000FF" SIZE=2 FACE="Arial">I suspect most of your problems stem from a mistake in your initialisation:</FONT>
<BR><FONT COLOR="#0000FF" SIZE=2 FACE="Arial">Initialize</FONT>
<BR><FONT COLOR="#0000FF" SIZE=2 FACE="Arial"> ;-------CHANGING TO BANK 1 ----------</FONT>
<BR><FONT COLOR="#0000FF" SIZE=2 FACE="Arial"> BSF STATUS, RP0 ; Select Bank 1</FONT>
</P>
<P><FONT COLOR="#0000FF" SIZE=2 FACE="Arial"> ;***** SET UP PORTS AS INPUTS OR OUTPUTS *****</FONT>
<BR><FONT COLOR="#0000FF" SIZE=2 FACE="Arial"> CLRF PORTA ; Initialize PORTA by setting output data latches</FONT>
</P>
<P><FONT COLOR="#0000FF" SIZE=2 FACE="Arial">Incorrect!! You are in bank 1 and cannot access PORTA from here.</FONT>
</P>
<P><FONT COLOR="#0000FF" SIZE=2 FACE="Arial"> MOVLW 0000h ; Value used to initialize data direction</FONT>
<BR><FONT COLOR="#0000FF" SIZE=2 FACE="Arial"> MOVWF TRISA ; ALL 5-pins set as output</FONT>
</P>
<P><FONT COLOR="#0000FF" SIZE=2 FACE="Arial">This is fine.</FONT>
</P>
<P><FONT COLOR="#0000FF" SIZE=2 FACE="Arial"> CLRF PORTB ; Initialize PORTB by setting output data latches</FONT>
</P>
<P><FONT COLOR="#0000FF" SIZE=2 FACE="Arial">Again, incorrect. PORTB is in bank 0.</FONT>
</P>
<P><FONT COLOR="#0000FF" SIZE=2 FACE="Arial"> MOVLW 0001h ; Value used to initialize data direction</FONT>
<BR><FONT COLOR="#0000FF" SIZE=2 FACE="Arial"> MOVWF TRISB ; ALL 8-pins set as input</FONT>
</P>
<P><FONT COLOR="#0000FF" SIZE=2 FACE="Arial">All 8 pins are not set as inputs. You have only set pin 0 as input, the rest as outputs.</FONT>
</P>
<P><FONT COLOR="#0000FF" SIZE=2 FACE="Arial"> ;***** ASSIGN TO TMR0 ****</FONT>
<BR><FONT COLOR="#0000FF" SIZE=2 FACE="Arial"> bcf OPTION_REG,PSA ; PSA = 0</FONT>
<BR><FONT COLOR="#0000FF" SIZE=2 FACE="Arial"> ;Set Prescaler to 16 [011=PS2|PS1|PS0]</FONT>
<BR><FONT COLOR="#0000FF" SIZE=2 FACE="Arial"> bsf OPTION_REG, PS0 </FONT>
<BR><FONT COLOR="#0000FF" SIZE=2 FACE="Arial"> bsf OPTION_REG, PS1</FONT>
<BR><FONT COLOR="#0000FF" SIZE=2 FACE="Arial"> bcf OPTION_REG, PS2</FONT>
</P>
<P><FONT COLOR="#0000FF" SIZE=2 FACE="Arial"> ;-------CHANGING TO BANK 0 (default) ----------</FONT>
<BR><FONT COLOR="#0000FF" SIZE=2 FACE="Arial"> BCF STATUS, RP0 ; Select Bank 0</FONT>
</P>
<BR>
<P><FONT COLOR="#0000FF" SIZE=2 FACE="Arial">As you are using a 16F84 you might like to consider using the TRIS instruction to save having to set banks.</FONT>
</P>
<P><FONT COLOR="#0000FF" SIZE=2 FACE="Arial">e.g.</FONT>
</P>
<P> <FONT COLOR="#0000FF" SIZE=2 FACE="Arial">movlw 00h</FONT>
<BR> <FONT COLOR="#0000FF" SIZE=2 FACE="Arial">tris PORTA ; set all PORTA as all outputs</FONT>
<BR> <FONT COLOR="#0000FF" SIZE=2 FACE="Arial">movlw FFh</FONT>
<BR> <FONT COLOR="#0000FF" SIZE=2 FACE="Arial">tris PORTB ; set all PORTB as all inputs</FONT>
<BR> <FONT COLOR="#0000FF" SIZE=2 FACE="Arial">clrf PORTA</FONT>
<BR> <FONT COLOR="#0000FF" SIZE=2 FACE="Arial">clrf PORTB</FONT>
</P>
<P><FONT COLOR="#0000FF" SIZE=2 FACE="Arial">Hope this helps</FONT>
</P>
<P><FONT COLOR="#0000FF" SIZE=2 FACE="Arial">Mike Rigby-Jones</FONT>
</P>
<P><FONT COLOR="#0000FF" SIZE=2 FACE="Arial"> </FONT>
</P>
<UL>
<P><FONT SIZE=1 FACE="Arial">{Original Message removed}
2000\03\31@143901
by
Robert Boardman
Just a guess but i can't see clrwdt instruction anywhere and you've got the
wdt switched on
----- Original Message -----
From: Saurabh Sinha <spam_OUTssinhaTakeThisOuT
IEEE.ORG>
To: <.....PICLISTKILLspam
@spam@MITVMA.MIT.EDU>
Sent: Friday, March 31, 2000 09:44
Subject: ISR is never called
{Quote hidden}> 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
>
More... (looser matching)
- Last day of these posts
- In 2000
, 2001 only
- Today
- New search...