Searching \ for '[PIC]: 16F628 interrupts problem I think' 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: '16F628 interrupts problem I think'.

Exact match. Not showing close matches.
PICList Thread
'[PIC]: 16F628 interrupts problem I think'
2002\05\14@135925 by Mircea Chiriciuc

flavicon
face
I have a problem with a project. When the interrupts events are comming too fast, the programm jump randomlly at different points. Can anyone halp me with configuration tricks or whatever?
Thanks

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2002\05\16@034006 by Carlos Ojea

flavicon
face
> When the interrupts events are comming too fast,
> the programm jump randomlly at different points.


What do you mean "too fast" ?
Could you show us your Interrupt Service Routine?

Regards

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


2002\05\16@044139 by Carlos Ojea

flavicon
face
A friend of mine told me that he has a similar problem using Mplab ICE with
power and clock from target board.
Nothing to do with the "speed" of interrupts, but program seems to jump to
random locations instead of ISR.
Are you using Mplab ICE with power and/or clock from target board?

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


2002\05\16@060815 by Mircea Chiriciuc

flavicon
face
I'm not using Mplab ICE at all.
By too fast I mean:
I have a 485 comunication between a master and more slaves. For the moment
is just a master and slave. If the master sends commands too fast eg. 2ms
interval which is smaller than the transmissin length it seems that program
jumps to random locations instead of IRS.
Here is my Interruprs handler:

interrupts
movwf w_temp        ; save off current W register contents
swapf STATUS,w           ; move status register into W register
movwf status_temp        ; save off contents of STATUS register
clrf status   ; clear status => bank 0 for shure

btfsc intcon,t0if
goto do_tmr0
btfsc intcon,intf
goto do_int
btfsc pir1,tmr1if
goto do_tmr1
goto int_exit

do_tmr1:
bcf pir1,tmr1if   ; clear flag
bsf i1sf    ; set soft flag

decfsz cnt1,f
goto int_exit
bsf i1sf    ; set soft flag
movlw cnt1val   ; reload postscaler
movwf cnt1
goto int_exit

do_int:
bcf intcon,intf    ; clear flag
bsf readerf
bcf intcon,intf
goto int_exit

do_tmr0:
bcf intcon,t0if    ; reset the tmr0 interrupt flag
decfsz tmrh,f
goto int_exit
movlw tmrhval
movwf tmrh      ; reload counter
bsf toutf      ; set flag

int_exit
swapf status_temp,w
movwf STATUS              ; restore pre-isr STATUS register contents
swapf w_temp,f
swapf w_temp,w            ; restore pre-isr W register contents
retfie     ; return from interrupt



{Original Message removed}

2002\05\16@061856 by Alan B. Pearce

face picon face
>If the master sends commands too fast eg. 2ms
>interval which is smaller than the transmissin length it seems that program
>jumps to random locations instead of IRS.
>Here is my Interruprs handler

How do mean "the master sends commands too fast" ?

Is this code for the master chip ?

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


2002\05\16@065228 by Carlos Ojea

flavicon
face
>do_tmr1:
> bcf pir1,tmr1if   ; clear flag
> bsf i1sf    ; set soft flag
>
> decfsz cnt1,f
> goto int_exit
> bsf i1sf    ; set soft flag
> movlw cnt1val   ; reload postscaler
> movwf cnt1
> goto int_exit



I don't understand how your soft flag works.
You set the soft flag and decrement a postscaler.
If postscaler reaches 0 you set AGAIN the soft flag (???)
and reload the postscaler.


It looks like you want the flag to be set after tmr1 has interrupted several
times (controlled by 'cnt1val').
If this is what you want, you may clear first 'i1sf' :
do_tmr1:
bcf pir1, tmr1if
bcf i1sf ; clear soft flag.


Regards.

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


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