How about starting the ISR with two NOPs Clumsy I know but should cover the worst case. An interesting side effect is you effectively have a 'skip the next two instructions' instruction, Might have some creative uses, I ended up with four bit tests in a row once. Tricky to unroll though. Oliver. ----- Original Message ----- From: Olin Lathrop To: Sent: Wednesday, October 11, 2000 1:49 PM Subject: Re: [PIC]: Reading program memory in 16F87X (was F series) > > > You could do an experiment with a timer interrupt and a tight foreground > > > loop doing a program memory read, keeping track of the min/max timer > value > > > found at the same point in the interrupt routine. If you do this, I'd > like > > > to see the results. > > > > If you run this code in MPLAB, the IRQ code (after it's third entry), is > > executed during the suggested 2 NOP's following the read. The STATUS reg > > does not get cleared, so the "xorwf PORTB" become xorwf "TRISB" and the > > "movwf TMR0" becomes "movwf OPTION_REG" > > > > I haven't tried this on a real chip - no time. > > So you are saying that interrupts do occur during the NOPs, and that > instructions in the interrupt routine then get ignored!!!? This sounds hard > to believe because it means that all program memory reads *must* be done > with interrupts off. There is no mention of this at all in the Microchip > literature. > > I'll have to try an experiment on a real chip. Since we are exploring the > edges of the architecture here, I'm not going to take MPLAB's word for it. > Perhaps I can do this later today, but I've got to give a cookie to a paying > customer first. > > > ***************************************************************** > Olin Lathrop, embedded systems consultant in Devens Massachusetts > (978) 772-3129, olin@cognivis.com, http://www.cognivis.com > > -- > 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.