Searching \ for 'Single step' 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/index.htm?key=single+step
Search entire site for: 'Single step'.

Truncated match.
PICList Thread
'Single step'
1998\05\24@211624 by Dennis Plunkett

flavicon
face
25/5/'98


Hello there everyone,

Quick question for you all (I don't have my data book) on the F84, under
external interrupt control:- Does the PIC complete the current instruction
and increment the PC before entering the interrupt routine? By this i mean:-


INSTRUCTION
DO INTERRUPT
INSTRUCTION
DO INTERRUPT
INSTRUCTION

Or does the PIC use that nasty 6800 interrupt control (Personal opinion),
where the PC is not incremented to the next instruction to perform? (ie, the
processor can remain in the interrupt routine forever) So does the PIC also
then perfrom the current instruction before entering the interrupt?

If this is so, then the PIC can be made to effectively single step. It would
be easier to implement if the PIC also exited the routine before checking
for a re interrupt. If this is so then by holding an interrupt (May need F/F
to the input if it has to be reset) Then the programmer will be able to
single step the PIC trough a routine with just one pin and a small amount of
external hardware. This could be extended to a run until type thing by using
another pin to arm the single step control.
It is just an idea that I have, note that if this is so, then timers and
other interrupts can not run unless they can disarms the single stepper, but
this may cause the code to "Step through" rather than stop at the nominated
point.

Any ideas? Does the PIC work like this?

PS this is the same method used to single step 8051 under software, on other
processors like the Z80 and NSC800 eternal control of the HALT pin is used.

Dennis

1998\05\24@224544 by Mike Keitz

picon face
On Mon, 25 May 1998 11:16:46 +1000 Dennis Plunkett
<spam_OUTdennisTakeThisOuTspamRDD.NECA.NEC.COM.AU> writes:
>25/5/'98
>
>
>Hello there everyone,
>
>Quick question for you all (I don't have my data book) on the F84,
>under
>external interrupt control:- Does the PIC complete the current
>instruction
>and increment the PC before entering the interrupt routine?

The real question you're asking is "Does any of the main program execute
if an interrupt condition exists immediately following the end of the
ISR? (consecutive interrupts)"  The book doesn't say much that would
answer the question.  I suggest trying it.  Simply write a short main
program that toggles a port pin and an ISR that pulses another port pin.
You can force interrupts to occur constantly by merely setting an
interrupt enable bit and the interrupt flag bit, then neglecting to clear
the flag bit in the ISR.  The PIC will re-interrupt immediately after the
RETFIE instruction sets the GIE bit again.

I don't know for sure, but probably no main program instructions will
execute.  An instruction may be fetched but then the interrupt logic will
kick in and skip it.  If this is the case, single-stepping could still be
implemented with some external hardware to cause an interrupt at the
right times to let just one instruction execute.  Connect a counter to
count xtal cycles and toggle the INT pin.  Use another pin to reset the
counter.  Just before leaving the ISR, reset the counter.  The interrupt
would occur shortly after that.  I think a count of 16 xtal cycles (4 PIC
instructions) would be sufficient.

_____________________________________________________________________
You don't need to buy Internet access to use free Internet e-mail.
Get completely free e-mail from Juno at http://www.juno.com
Or call Juno at (800) 654-JUNO [654-5866]


'Single step'
1998\06\09@050538 by Vladimir M. Klochko
flavicon
face
Hi!
24-May-98 22:42 Mike Keitz wrote about "Re: Single step":

>> On Mon, 25 May 1998 11:16:46 +1000 Dennis Plunkett
>> <.....dennisKILLspamspam@spam@RDD.NECA.NEC.COM.AU> writes:
>> >25/5/'98
>> >
>> >Quick question for you all (I don't have my data book) on the F84,
>> >under
>> >external interrupt control:- Does the PIC complete the current
>> >instruction
>> >and increment the PC before entering the interrupt routine?
>>
>> The real question you're asking is "Does any of the main program execute
>> if an interrupt condition exists immediately following the end of the
>> ISR? (consecutive interrupts)"  The book doesn't say much that would
   .....
>> answer the question.  I suggest trying it.  Simply write a short main
>> program that toggles a port pin and an ISR that pulses another port pin.
>> You can force interrupts to occur constantly by merely setting an
>> interrupt enable bit and the interrupt flag bit, then neglecting to clear
>> the flag bit in the ISR.  The PIC will re-interrupt immediately after the
>> RETFIE instruction sets the GIE bit again.
>>
>> I don't know for sure, but probably no main program instructions will

   I am sure. I have "test" this. :(
   "Method": don't clear interrupt flag in ISR.
   Result: no instruction of the main program will be executed
   (...StartISR, retfie, StartISR, retfie...).
   PIC16c84 was used, but it is true for another chips (I think).

>> execute.  An instruction may be fetched but then the interrupt logic will
>> kick in and skip it.

--

                                   Vladimir M. Klochko

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