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

Please help

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



Joined: 17 Sep 2004
Posts: 133
Location: UK

View user's profile Send private message

Please help
PostPosted: Thu Oct 07, 2004 3:35 am     Reply with quote

I am using CCS version 3.190, PIC16F877
The program does not enter the 'for' loop in the function.
After entering the function, the program counter cursor jumps straight to the row of the loop 'for' and then up to the open bracket of the function with the next step and stuck there.

void DecodeRxPacket(void)
{
BYTE i ;

for (i=1; i<FrameSize; i++)
{

}
}
_________________
Alex
asmallri



Joined: 12 Aug 2004
Posts: 1634
Location: Perth, Australia

View user's profile Send private message Send e-mail Visit poster's website

PostPosted: Thu Oct 07, 2004 4:34 am     Reply with quote

Where and how is FrameSize declared?

Is FrameSize declared as a byte?

What is the value of FrameSize when you call the function?
alexz



Joined: 17 Sep 2004
Posts: 133
Location: UK

View user's profile Send private message

PostPosted: Thu Oct 07, 2004 4:36 am     Reply with quote

BYTE FrameSize ;
FrameSize gets value normaly 7, before calling the function
_________________
Alex
asmallri



Joined: 12 Aug 2004
Posts: 1634
Location: Perth, Australia

View user's profile Send private message Send e-mail Visit poster's website

PostPosted: Thu Oct 07, 2004 4:39 am     Reply with quote

Can you do a printf before the for loop to look at the value?

Do you have only a single FrameSize variable declared in your application?
alexz



Joined: 17 Sep 2004
Posts: 133
Location: UK

View user's profile Send private message

PostPosted: Thu Oct 07, 2004 4:41 am     Reply with quote

yes just a single.
I have also tryed with a constant
_________________
Alex
d00dajo



Joined: 20 Jul 2004
Posts: 34

View user's profile Send private message Send e-mail

PostPosted: Thu Oct 07, 2004 8:39 am     Reply with quote

Can you post the complete code inside the for-loop? I presume you have something there?

Have you redifined the BYTE type? (Normally it is unsigned, did you define it as signed?)

Is it when you run the debugger you experience this, or does your program "hang" when it is running on the PIC? (And if so, are you sure it is really in the for-loop you have a problem and not somewhere else?)
alexz



Joined: 17 Sep 2004
Posts: 133
Location: UK

View user's profile Send private message

PostPosted: Thu Oct 07, 2004 8:42 am     Reply with quote

It is sorted now thank you.
_________________
Alex
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