CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

Code enter ISR prologue while stepping over a C function

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
aboutin33



Joined: 12 Nov 2009
Posts: 3

View user's profile Send private message

Code enter ISR prologue while stepping over a C function
PostPosted: Thu Nov 12, 2009 9:08 am     Reply with quote

PIC18F97J60 with ethernet MAC
PCWH V 4.098
ICD-U40

When single stepping over a C function, the debugger instead service the next interrupt pending starting addr 0x0008. This is annoying because once this ISR is serviced, there is another pending interrupt that cause the debugger to go again at addr 0x0008. I never get to single step over my code.

Is there a way to disable interrupts during single stepping or tell the debugger not to step in interrupts ?

I tried to disable the interrupts manually by writing directly in INTCON in the SFR debug window when single stepping, but the debugger won't allow me to overwrite this register.

Alain Boutin
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Thu Nov 12, 2009 2:45 pm     Reply with quote

Just comment the line in your program for
Code:
enable_interrupts(GLOBAL);

and re-compile. Then debug it without interrupts active.
aboutin33



Joined: 12 Nov 2009
Posts: 3

View user's profile Send private message

PostPosted: Thu Nov 12, 2009 6:57 pm     Reply with quote

I did disable global interrupts like you said, but the TCP stack want the timer interrupt to function, the UART is also serviced by an ISR and must function also.

Most of the ICD for other microcontroller have a feature to disable interrupts servicing during singlestepping.

Where is this functionnality in the PCWH ?

And how do we change INTCON under debugger control ?

Thanks in advance...
Alain B
Wayne_



Joined: 10 Oct 2007
Posts: 681

View user's profile Send private message

PostPosted: Fri Nov 13, 2009 2:49 am     Reply with quote

I would set a break point at the next instruction and then use run.
FvM



Joined: 27 Aug 2008
Posts: 2337
Location: Germany

View user's profile Send private message

PostPosted: Fri Nov 13, 2009 3:47 am     Reply with quote

With PIC24 and MPLAB, I disabled global or specific (depends on the debugging purpose) interrupts manually in SFR. I don't know, if it works with PIC18. Curiously, one interrupt was still performed after disabling it globally, most likely because the old interrupt status was popped from the stack by the ICD stub.

You're right, that this functionalilty should be offered by MPLAB or CCS debugger as an automatic feature.
aboutin33



Joined: 12 Nov 2009
Posts: 3

View user's profile Send private message

PostPosted: Fri Nov 13, 2009 10:14 pm     Reply with quote

Yes Wayne, moving a breakpoint down, line by line works, but tedious.

CCS should implement interrupts disable during single stepping.

AB
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group