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

Got the "Out of ROM.." while writing interrupt

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



Joined: 26 Mar 2005
Posts: 10

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

Got the "Out of ROM.." while writing interrupt
PostPosted: Thu May 26, 2005 3:31 am     Reply with quote

Hi.
My problem is when I write smt into INT_RB interrupt, I get "Out of ROM" message. When I try to write Scan_Keys() function, I get the error, when I try to write anything else (like printf("bla bla") for example) everything works fine. I defined Scan_Keys() with a #separate, but no results? Any ideas?
Ttelmah
Guest







PostPosted: Thu May 26, 2005 7:07 am     Reply with quote

Without knowing what is 'in' the Scan_Keys function, it is not possible to answer.
The normal reason is that the function is too large to fit in a page bank, and needs to be split up. If this is the case, you need to seriously be considering doing the solution a different way, since a function this large, implies a significant time involved, and as such the code should not be in an interrupt. Normally a simple matrix keyscanner, should only be a few lines of code, so post it, and somebody may be able to see what is making it so large.

Best Wishes
valemike
Guest







PostPosted: Thu May 26, 2005 7:20 am     Reply with quote

i don't have this problem while working with 18Fs, but encountered this a lot with 16F devices. Like Ttelmah said, you have to break up your functions into smaller functions.

And when doing so, i'd then have to use the #separate directive a lot, as well as declare 16-bit pointers.

e.g.

//prototype
#separate
void my_fxn(void);

...
#separate
void my_fxn(void)
{
...
}

Doing so will help alleviate your out-of-rom errors. It becomes a pain after a while.
Guest








PostPosted: Sat May 28, 2005 10:35 am     Reply with quote

I've never had this problem with 18Fs too... My KeyScan() code is extremely small...
Code:

void Scan_Keys()
{If (!(KEYL&KEYR&KEYOK&KEYC))
  {keyholdcnt = 0;
    keyhold = 0;
    keyup = 0;
    Enable_Interrupts(INT_Timer2);
        while ((!(KEYL&KEYR&KEYOK&KEYC))&(~keyhold));
    Disable_Interrupts(INT_Timer2);
     If (keyhold) RLED = 1;
     if (keyup) GLED = 1;
     delay_ms(1000);
     GLED = 0;
     GLED = 0;
     RLED = 0;
     RLED = 0;
  }
}


There is no way this could not fit into a hardware page... it's smaller than 100 bytes Exclamation
Predator_MF



Joined: 26 Mar 2005
Posts: 10

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

PostPosted: Sat May 28, 2005 10:42 am     Reply with quote

I forgot to login, this post above is mine Wink
Darren Rook



Joined: 06 Sep 2003
Posts: 287
Location: Milwaukee, WI

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

PostPosted: Sat May 28, 2005 11:52 am     Reply with quote

Anonymous wrote:
There is no way this could not fit into a hardware page... it's smaller than 100 bytes Exclamation


Unless all of your pages are allready filled, no space for 100 more bytes.

Also, check your stack space. If you run out of stack the compiler will start inlining some functions.

Also, if this scan_keys() is inside of an interrupt it will not work.
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