| View previous topic :: View next topic |
| Author |
Message |
arunb
Joined: 08 Sep 2003 Posts: 492 Location: India
|
| How to determine if a function exceeds a page limit ?? |
Posted: Fri Aug 04, 2006 3:30 am |
|
|
Hi,
How can one determine whether a function exceeds the page limt ??
thanks
arunb |
|
 |
rnielsen
Joined: 23 Sep 2003 Posts: 852 Location: Utah
|
|
Posted: Fri Aug 04, 2006 8:19 am |
|
|
Well, I check it out by clicking on the compile button and if I get an error message that I'm out of memory then I know that something was too big.
Ronald |
|
 |
arunb
Joined: 08 Sep 2003 Posts: 492 Location: India
|
| RE: |
Posted: Fri Aug 04, 2006 9:35 am |
|
|
| Quote: |
Well, I check it out by clicking on the compile button and if I get an error message that I'm out of memory then I know that something was too big
|
I was refering to the size of a function and not the program size (if the program exceeds the ROM size , then 'Out of ROM ' error occurs)
When a function becomes very large , the mcu starts to go haywire, one way to check this out is to run the mcu, but I think there should be another way....
thanks
arunb
[/code] |
|
 |
rnielsen
Joined: 23 Sep 2003 Posts: 852 Location: Utah
|
|
Posted: Fri Aug 04, 2006 10:59 am |
|
|
The PIC should run just fine regardless of the size of the routines you call. If any of the routines are to large to fit into a page then the compiler will tell you, otherwise they should work just fine. I've had routines that barely squeeze into a page. I'm not sure what might be going on. Maybe check your LST file and see what the stats are for Stack. Too many and you'll choke.
Ronald |
|
 |
arunb
Joined: 08 Sep 2003 Posts: 492 Location: India
|
| RE: |
Posted: Fri Aug 04, 2006 11:05 am |
|
|
Hi,
PCM 3.228
MCU:16F877A
Thank you for the reply.
The stack looks OK (less than 7)
Here is an extract of the .LST file, coould you tell me what is wrong with this
| Quote: |
CCS PCM C Compiler, Version 3.228, 16542 02-Aug-06 21:03
Filename: CLG004Main-v2.LST
ROM used: 2121 words (26%)
Largest free fragment is 2048
RAM used: 61 (35%) at main() level
71 (41%) worst case
Stack: 5 worst case (3 in main + 2 for interrupts)
|
I find that whenver then ROM used is more than Largest free fragment, the mcu goes haywire, as in this case.
Kindly advise ...
thanks
arunb |
|
 |
|