Searching \ for ' [PIC] PIC16F877- interrupt' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/microchip/ints.htm?key=interrupt
Search entire site for: 'PIC16F877- interrupt'.

No exact or substring matches. trying for part
PICList Thread
'[PICLIST] [PIC] PIC16F877- interrupt'
2001\10\08@150359 by Michael Noel

flavicon
face
Hi all!

Where PIC16F877 returns from an interrupt, if in ISR I worked with
PCLATH in
different pages? If the program  loop in page 2 and appear an  interrupt
the PCLATH
and PCL  registers have 00 and 04? The program jump to 0004 without
'programer
intervention' , I mean clrf PCLATH instruction? And to  a 'retfie'
instruction where will
jump the program?
How can I simulate an RB0 INT in Mplab 5.20? With Asynchronous Stimulus
don't work!
Thanks in advance!
Regards
Mike

--
http://www.piclist.com hint: To leave the PICList
spam_OUTpiclist-unsubscribe-requestTakeThisOuTspammitvma.mit.edu


2001\10\08@192759 by Byron A Jeff

face picon face
On Mon, Oct 08, 2001 at 10:01:41PM +0300, Michael Noel wrote:
> Hi all!
>
> Where PIC16F877 returns from an interrupt, if in ISR I worked with
> PCLATH in
> different pages?

Back to where it started. PCLATCH is not used for the return from interrupt.
The entire address is stored on the stack.

> If the program  loop in page 2 and appear an  interrupt
> the PCLATH
> and PCL  registers have 00 and 04?

Nope. The PCLATCH register is unchanged during an interrupt. If the ISR needs
to change it, it should save the original and restore it before leaving. Of
course this applies to the W and STATUS registers also.

> The program jump to 0004 without
> 'programer
> intervention' ,

Correct. An interrupt when enabled will goto address 0004.

> I mean clrf PCLATH instruction?

No the PCLATCH will be unaffected. So you'd have to save the PCLATCH, change it
and restore it before the retfie.

> And to  a 'retfie'
> instruction where will
> jump the program?

Back to the instruction where the interrupt occured.

> How can I simulate an RB0 INT in Mplab 5.20? With Asynchronous Stimulus
> don't work!

No clue. I use gpsim on my Linux box.

Hope this helps,

BAJ

--
http://www.piclist.com hint: To leave the PICList
.....piclist-unsubscribe-requestKILLspamspam@spam@mitvma.mit.edu


2001\10\08@195513 by Tony Nixon

flavicon
picon face
Byron A Jeff wrote:

> > How can I simulate an RB0 INT in Mplab 5.20? With Asynchronous Stimulus
> > don't work!
>
> No clue. I use gpsim on my Linux box.
>

Click on [debug] -> stimulator stimulus -> Asynchronous stimulus

Right click on the first button.

Click - [Assign Pin] and double click RB0

Right click on the first button again.

Select - Toggle

Leave the box open and start the simulation.


If the RB0 interrupt is enabled, it will trigger when the correct edge
is detected when the RB0 button is pressed in the async stimulus box.

Use this code to test the above procedure if you like.


       list p=16F84A

       #include "P16F84A.inc"

       org 0h              ; startup vector = 0000

       goto start

       org 4h

       bcf INTCON,INTF
       retfie

start   clrf PORTA
       clrf PORTB
       bsf STATUS,RP0
       clrf TRISA
       movlw 1h        ; RB0 = input
       movwf TRISB
       bcf STATUS,RP0

       clrf INTCON
       bsf INTCON,INTE
       bsf INTCON,GIE

here    nop
       goto here



--
Best regards

Tony

mICros
http://www.bubblesoftonline.com
salesspamKILLspambubblesoftonline.com

--
http://www.piclist.com hint: To leave the PICList
.....piclist-unsubscribe-requestKILLspamspam.....mitvma.mit.edu


2001\10\09@150451 by Michael Noel

flavicon
face
Thanks a lot Tony! I tried to simulate an interrupt with Mplab, but I don't try
an Asynchronous stimulus on Toggle! It works with RB0 INT.I debug very simple
the rest of the code.Thanks again!
Regards
Miki


Tony Nixon wrote:

{Quote hidden}

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2001\10\09@150454 by Michael Noel

flavicon
face
Thanks BAJ! I fixed it.
Regards
Miki


Byron A Jeff wrote:

{Quote hidden}

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


More... (looser matching)
- Last day of these posts
- In 2001 , 2002 only
- Today
- New search...