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

Debug problem....

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



Joined: 08 Sep 2003
Posts: 21

View user's profile Send private message

Debug problem....
PostPosted: Fri Jul 25, 2003 7:58 am     Reply with quote

Using RTCC I created a clock that count the seconds number elapsed since 1-1-2001.
In my software I wrote two functions....
The first receive as arguments the string address where store the date-time string and the seconds number.

void asciiDate(char *d, int32 sec)

The sedcond function execute the inverse function.
It receive 5 arguments (day, month, year, hour, minute) and return the seconds number elapsed since 1-1-2001

int32 numSeconds(int16 d, int16 m, int32 y, int32 hours, int32 minutes)

To try these functions I wrote in main function :

seconds = numSeconds(17, 3, 2002, 12, 20);
while(1) {
...
asciiDate(utilBuff, seconds);

}

The first caledd function terminate wirh :

....
if(modulo==0)
++numdays;
numdays += d-1;
sec += (numdays* 84600) + (hours*3600+minutes*60);
return sec;
}

When I try to debug these function the debugger flow into this function but it stop (without return to main function) on the last line of the following mixed-code function.


106: if(modulo==0)
107: ++numdays;
000224 524D MOVF 0x1, 0,
108: numdays += d-1;
00023C 0E01 MOVLW 0x1
109: sec += (numdays* 84600) + (hours*3600+minutes*60);
000256 C048 MOVFF 0x48, 0x59
110: return sec;
000306 C049 MOVFF asciiDate$hour, 0
111: }
000316 EF7A GOTO 0xaf4
00031C FFFF NOP
00031E 6AEA CLRF FSR0H, 0 <<<<<< HERE ... LOOP

The function don't return ....
I use MPLAB 6.30 with CCS compiler and ICD 2 debugger (connected to PICDEM 2 board).
I am not a PIC expert but this problem rememeber me in Unix/Wn/Dos environment when the stack crash and the software lost the return address....
Is possible this supposition ?
___________________________
This message was ported from CCS's old forum
Original Post ID: 144516352
Sherpa Doug
Guest







Re: Debug problem....
PostPosted: Fri Jul 25, 2003 3:02 pm     Reply with quote

:=The function don't return ....
:=I use MPLAB 6.30 with CCS compiler and ICD 2 debugger (connected to PICDEM 2 board).
:=I am not a PIC expert but this problem rememeber me in Unix/Wn/Dos environment when the stack crash and the software lost the return address....
:=Is possible this supposition ?

If you look at the C/ASM listing near the top is the stack usage. Compare the stack locations used with the amount of stack on your PIC. With the smaller PICs running out of stack space is common.

___________________________
This message was ported from CCS's old forum
Original Post ID: 144516372
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