Mark, You've understood my problem. My code is all in bank 0 and I don't need = to save pclath, W reg, Status etc. Thanks for the encouragement that the = code seems to be ok. I'll have to keep trying. David, I will take a look at those links you suggest to see if something jumps = out at me......... ----- Original Message -----=20 From: Mark Newland=20 To: PICLIST@MITVMA.MIT.EDU=20 Sent: Monday, June 18, 2001 9:31 PM Subject: Re: [PIC]: 16F876 Interrupts David, This is not always needed. You only have to "save all kinds of = stuff" if it is needed to be saved. I have MANY times had a simple little program = where my code went something like: Main btfss TMR_F goto Main bcf TMR_F ...... goto Main All my interupt routine does is set TMR_F. I then waste time in the = first two lines of my code waiting for the timer to overflow. I don't care about = saving anything cause I start everything over again after the interrupt. I will state AGAIN what his request was. His request was not how does = he handle the internals of the interupt routine. His request was how does he get = the interupt routine to execute. Or to put it in his own words, "...the timer 1 = overflow flag gets set, but never calls the interrupt vector." David, On the other side of the arguement, you are correct that he = should at least be aware that certain values MAY need to be saved. I know that when I = first started, this gave me headaches also. Malcolm, Assuming that your problem is not saving certain registers but is = indeed as you stated, "...the timer 1 overflow flag gets set, but never calls the = interrupt vector" all I can say is that I can't find anything wrong with it. = Then again, I can't see the nose on my face sometimes either. David Cary wrote: > Dear Malcolm Peill, > > Malcolm Peill on 2001-06-18 11:04:51 AM = admitted a lack > of knowledge when he said: > >I have to admit to never having used interrupts before, so it may = be obvious > >to those who have..... > > > >My code includes the following: > > > > ORG 0x000 ; processor reset vector > > goto main ; go to beginning of program > > ORG 0x004 ; interrupt vector location > > > > bank_low > > CLRWDT > > btfss PIR1,TMR1IF ;return if it wasn't a timer1 interrupt > > Yes, it's obvious. Interrupt routines need to save all kinds of = stuff at the > beginning of the interrupt routine, then restore them at the end of = the routine. > It's a little tricky, so everyone starts with the code in the > _PIC16F87X data sheet_ by Microchip Technology Inc. > http://www.microchip.com/0/lit/pline/picmicro/ > p. 132: Example 12-1: Saving Status, W, and PCLatH Registers > . > Also be sure to use > http://piclist.org/techref/microchip/isrregs.htm > for a few improvements. > > -- > David Cary > > -- > http://www.piclist.com hint: The PICList is archived three different > ways. See http://www.piclist.com/#archives for details. -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details. -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body