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 support@ccsinfo.com

ICD debugger hangs while stepping past delay_ms?

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







ICD debugger hangs while stepping past delay_ms?
PostPosted: Thu Feb 13, 2003 3:27 pm     Reply with quote

Hi,

I am familiarizing myself with the CCS ICD-U device and have been trying various exercises in the manual that came with it. In exercise #6 (Debugging) it has me enter a program and step through it. The main loop of the program looks like this:

Code:
main()
{
   int count = 0;
   while(TRUE)
   {
      show_binary_using_leds( count );
      delay_ms( 1000 );
      count = count + 1;
   }
}

I have discovered that the debugger has a problem with the "delay_ms(1000);" line if I press the single step button. I can use the "step-over" button without a problem, but the "step" button takes me to the "#use delay(clock=20000000)" line and at that point if I press either the step over or step buttons things stop working. What's going on? Is this a known feature?


Also, is it usual for the 7805 voltage regulator to run quite hot? Mine sure does. Nothing is connected to the PCB except for the ICD-U. The code running (or hanging) is the stuff mentioned above.
___________________________
This message was ported from CCS's old forum
Original Post ID: 11658
Eric Minbiole
Guest







Re: ICD debugger hangs while stepping past delay_ms?
PostPosted: Fri Feb 14, 2003 9:23 am     Reply with quote

:=I have discovered that the debugger has a problem with the "delay_ms(1000);" line if I press the single step button. I can use the "step-over" button without a problem, but the "step" button takes me to the "#use delay(clock=20000000)" line and at that point if I press either the step over or step buttons things stop working. What's going on? Is this a known feature?

CCS puts most of the delay_xx() code at the #use delay line of the .c file. That's why when you step into the delay routine, it appears to jump to the #use line.

Most likely, the ICD isn't actually stuck... instead it's actually running the delay code. The problem is that, at 20MHz, your 1 second delay requires 5 <I>million</I> instructions. Unless you're really patient, you'll never be able to step through the whole thing. (I don't think that the current Microchip debuggers let you "step out" of a routine.)

You do have a couple of choices: One (which you've already figured out) is to step over the delay code. Another option, if you accidentally step into the delay, is to use the "run to cursor" feature to step to the next line <I>after</I> the delay. Another common approach is to put #infdef DEBUG around the the delays. When you're debugging, the delays won't be included at all.


:=Also, is it usual for the 7805 voltage regulator to run quite hot? Mine sure does.

Not sure what your circuit looks like, but one thing to check is what voltage are you using to supply the 7805? The 7805 "burns off" any excess voltage, so a high input voltage will make it run hotter. If you're using 15V, for example, the regulator has to "burn off" 10 volts. Even if your circuit only draws 100mA, you're still dissipating 1W (a fair amount of heat) from the regulator. Of course, you can always add a heat sink to make it run cooler.

Hope this helps.
___________________________
This message was ported from CCS's old forum
Original Post ID: 11684
Warren Massey
Guest







Re: ICD debugger hangs while stepping past delay_ms?
PostPosted: Fri Feb 14, 2003 6:51 pm     Reply with quote

:=CCS puts most of the delay_xx() code at the #use delay line of the .c file. That's why when you step into the delay routine, it appears to jump to the #use line.
:=
:=Most likely, the ICD isn't actually stuck... instead it's actually running the delay code. The problem is that, at 20MHz, your 1 second delay requires 5 <I>million</I> instructions. Unless you're really patient, you'll never be able to step through the whole thing. (I don't think that the current Microchip debuggers let you "step out" of a routine.)

I thought something like this might be happening...

:=You do have a couple of choices: One (which you've already figured out) is to step over the delay code. Another option, if you accidentally step into the delay, is to use the "run to cursor" feature to step to the next line <I>after</I> the delay. Another common approach is to put #infdef DEBUG around the the delays. When you're debugging, the delays won't be included at all.

OK, I'll try that. I also asked CCS this same question and their response (so far) was "This was a problem we thought was fixed." Oh well, I know what not to do at least.


:=Not sure what your circuit looks like, but one thing to check is what voltage are you using to supply the 7805? The 7805 "burns off" any excess voltage, so a high input voltage will make it run hotter. If you're using 15V, for example, the regulator has to "burn off" 10 volts. Even if your circuit only draws 100mA, you're still dissipating 1W (a fair amount of heat) from the regulator. Of course, you can always add a heat sink to make it run cooler.

I'm using the wall-wart supply CCS provided just for this hardware. It says it puts out 12VDC but that must be only when it's fully loaded (300mA) 'cause at the 80mA the ICD & associated PC board draw, it's up around 16.5 volts (it's 19+ volts open-circuit). You are right, 11.5v @ 80mA (.92W) is a lot of heat for the regulator to dump. I have added a heatsink and I'm going to see if I can find a better source of input power.
___________________________
This message was ported from CCS's old forum
Original Post ID: 11720
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