View previous topic :: View next topic |
Author |
Message |
alexz
Joined: 17 Sep 2004 Posts: 133 Location: UK
|
Please help |
Posted: Thu Oct 07, 2004 3:35 am |
|
|
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: 1635 Location: Perth, Australia
|
|
Posted: Thu Oct 07, 2004 4:34 am |
|
|
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
|
|
Posted: Thu Oct 07, 2004 4:36 am |
|
|
BYTE FrameSize ;
FrameSize gets value normaly 7, before calling the function _________________ Alex |
|
|
asmallri
Joined: 12 Aug 2004 Posts: 1635 Location: Perth, Australia
|
|
Posted: Thu Oct 07, 2004 4:39 am |
|
|
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
|
|
Posted: Thu Oct 07, 2004 4:41 am |
|
|
yes just a single.
I have also tryed with a constant _________________ Alex |
|
|
d00dajo
Joined: 20 Jul 2004 Posts: 34
|
|
Posted: Thu Oct 07, 2004 8:39 am |
|
|
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
|
|
Posted: Thu Oct 07, 2004 8:42 am |
|
|
It is sorted now thank you. _________________ Alex |
|
|
|