Go to Post I don't think [Amanda] will have any trouble with Needel or the Kelsos but... I can understand Grady and we do have visible evidence of the menace that is Jessica Boucher. (just ask Billfred) - Al Skierkiewicz [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 26-01-2006, 20:04
Validius's Avatar
Validius Validius is offline
There is a shadow following me.....
AKA: Mark Ratering
FRC #1549 (Washtenuts)
Team Role: College Student
 
Join Date: Feb 2005
Rookie Year: 2005
Location: South Lyon
Posts: 159
Validius will become famous soon enoughValidius will become famous soon enough
Send a message via AIM to Validius
stupid Array error: Error [1300] stack frame too l

It is choking on this declaration: `int table[255];`

I'm making it a lookup table.
__________________
When a sociaty comes to believe that human life is not inherently worth living, it is a slippery slope to the gas chamber. You wind up on a low road that twists past Columbine and leads toward Auschwitz.

-Peggy Noonan
  #2   Spotlight this post!  
Unread 26-01-2006, 21:45
devicenull devicenull is offline
Robot? We need a robot?
no team
 
Join Date: Sep 2004
Rookie Year: 1234
Location: n/a
Posts: 359
devicenull is just really nicedevicenull is just really nicedevicenull is just really nicedevicenull is just really nicedevicenull is just really nice
Re: stupid Array error: Error [1300] stack frame too l

rom const int table[256];

Use that instead. Also, do you actually need int's? Do you values go above 255? Using unsigned char's would be more memory efficient
  #3   Spotlight this post!  
Unread 26-01-2006, 23:15
Validius's Avatar
Validius Validius is offline
There is a shadow following me.....
AKA: Mark Ratering
FRC #1549 (Washtenuts)
Team Role: College Student
 
Join Date: Feb 2005
Rookie Year: 2005
Location: South Lyon
Posts: 159
Validius will become famous soon enoughValidius will become famous soon enough
Send a message via AIM to Validius
Re: stupid Array error: Error [1300] stack frame too l

Quote:
Originally Posted by devicenull
rom const int table[256];

Use that instead. Also, do you actually need int's? Do you values go above 255? Using unsigned char's would be more memory efficient
Yea, i was thinking about it and an unsigned char would work better. *runs to make a typedef*
__________________
When a sociaty comes to believe that human life is not inherently worth living, it is a slippery slope to the gas chamber. You wind up on a low road that twists past Columbine and leads toward Auschwitz.

-Peggy Noonan
  #4   Spotlight this post!  
Unread 26-01-2006, 23:17
Validius's Avatar
Validius Validius is offline
There is a shadow following me.....
AKA: Mark Ratering
FRC #1549 (Washtenuts)
Team Role: College Student
 
Join Date: Feb 2005
Rookie Year: 2005
Location: South Lyon
Posts: 159
Validius will become famous soon enoughValidius will become famous soon enough
Send a message via AIM to Validius
Re: stupid Array error: Error [1300] stack frame too l

Quote:
Originally Posted by devicenull
rom const int table[256];

Use that instead. Also, do you actually need int's? Do you values go above 255? Using unsigned char's would be more memory efficient

what does the 'rom' part of it mean?
__________________
When a sociaty comes to believe that human life is not inherently worth living, it is a slippery slope to the gas chamber. You wind up on a low road that twists past Columbine and leads toward Auschwitz.

-Peggy Noonan
  #5   Spotlight this post!  
Unread 26-01-2006, 23:29
Eldarion's Avatar
Eldarion Eldarion is offline
Electrical Engineer / Computer Geek
AKA: Eldarion Telcontar
no team (Teamless Orphan)
Team Role: Alumni
 
Join Date: Nov 2005
Rookie Year: 2005
Location: Númenor
Posts: 558
Eldarion has a reputation beyond reputeEldarion has a reputation beyond reputeEldarion has a reputation beyond reputeEldarion has a reputation beyond reputeEldarion has a reputation beyond reputeEldarion has a reputation beyond reputeEldarion has a reputation beyond reputeEldarion has a reputation beyond reputeEldarion has a reputation beyond reputeEldarion has a reputation beyond reputeEldarion has a reputation beyond repute
Send a message via AIM to Eldarion Send a message via Yahoo to Eldarion
Re: stupid Array error: Error [1300] stack frame too l

Quote:
Originally Posted by Validius
what does the 'rom' part of it mean?
I believe it places the array into the FLASH memory, not RAM.
__________________
CMUCam not working? Tracks sporadically? Try this instead: http://www.falconir.com!
PM me for more information if you are interested (it's open source!).

Want the FIRST Email blasts? See here: http://www.chiefdelphi.com/forums/sh...ad.php?t=50809

"The harder the conflict, the more glorious the triumph. What we obtain too cheaply, we esteem too lightly; it is dearness only that gives everything its value."
-- Thomas Paine

If it's falling apart it's a mechanical problem. If it's spewing smoke it's a electrical problem.
If it's rampaging around destroying things it's a programming problem.

"All technology is run on 'Magic Smoke' contained within the device. As everyone knows, whenever the magic smoke is released, the device ceases to function."
-- Anonymous

I currently speak: English, some German, Verilog, x86 and 8051 Assembler, C, C++, VB, VB.NET, ASP, PHP, HTML, UNIX and SQL
  #6   Spotlight this post!  
Unread 27-01-2006, 10:21
Mark McLeod's Avatar
Mark McLeod Mark McLeod is offline
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,817
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
Re: stupid Array error: Error [1300] stack frame too l

The linker will only allow you to define a total of 256 bytes of global (or static) variables within any single project file. Variables are located in Data space where the values can be changed whenever you like.

If you want to create "char table[255]", it'll need to be defined in a file off by itself that doesn't have any other global or static declarations and referenced as an extern. "int table[255]" is too large to be defined anywhere but within the much larger Program space.

Using the keyword "rom" forces the array to be defined in (Read Only Memory) Program space rather than the Data memory, then you can be as large as you have program space for, but the values are fixed like your code statements and cannot be assigned or changed while your program is running. You have to pre-define the array values, e.g.,
Code:
rom const int table[255]={1,2,3,4,...255};
See pdf page 22 (document page 14) of the MPLAB C18 C Compiler User's Guide for a description of rom vs ram.
Also discussed in this thread.
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle

Last edited by Mark McLeod : 27-01-2006 at 15:56.
  #7   Spotlight this post!  
Unread 27-01-2006, 10:44
dcbrown dcbrown is offline
Registered User
AKA: Bud
no team
Team Role: Mentor
 
Join Date: Jan 2005
Rookie Year: 2005
Location: Hollis,NH
Posts: 236
dcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud of
Re: stupid Array error: Error [1300] stack frame too l

See the appropriate sections in C18 Users Guide (see pointer in reply #45):

2.3 Storage Classes
2.4 Storage Qualifiers


Quote:
2.4.3 ram/rom Qualifiers

Because the PICmicro microcontrollers use separate program memory and data
memory address busses in their design, MPLAB C18 requires extensions to distinguish between data located in program memory and data located in data memory. The ANSI/ISO C standard allows for code and data to be in separate address spaces, but this is not sufficient to locate data in the code space as well. To this purpose, MPLAB C18 introduces the rom and ram qualifiers. The rom qualifier denotes that the object is located in program memory, whereas the ram qualifier denotes that the object is located in data memory.
Pointers can point to either data memory (ram pointers) or program memory (rom pointers). Pointers are assumed to be ram pointers unless declared as rom. The size of a pointer is dependent on the type of the pointer and is documented in Table 2-4. ...
Reading both sections of the user guide should provide a better understanding of storage declaration options available.

I'm assuming this is in MPLab. The same thing can be done in EasyC either using the "User Code" option. See EasyC discussion in EasyC Wish List thread.

Regards,
DCBrown

Last edited by dcbrown : 27-01-2006 at 11:18.
  #8   Spotlight this post!  
Unread 27-01-2006, 10:53
Mark McLeod's Avatar
Mark McLeod Mark McLeod is offline
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,817
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
Re: stupid Array error: Error [1300] stack frame too l

Quote:
Originally Posted by dcbrown
See the appropriate sections in C18 Users Guide (see pointer in reply #17):
Post #45 is the up-to-date 2006 version.
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to Stack Tetras in Inventor petek Inventor 0 13-01-2005 11:47
Initial stack height JJG13 Rules/Strategy 1 29-01-2003 21:04


All times are GMT -5. The time now is 13:27.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi