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

PCH #int_global just not doing what it should, why?

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
dlc@frii.com



Joined: 05 Nov 2003
Posts: 23

View user's profile Send private message

PCH #int_global just not doing what it should, why?
PostPosted: Sat Feb 12, 2005 11:13 pm     Reply with quote

Hi all,

Once again I find myself fighting with the interrupts. I wish
to make a fast ISR for an 18F252, so I'm using #int_global.
I've written the code and when it compiles I get this error:
isr
Seg 000008-0006C,0066 left, need 007E
@goto10052
Error 71... Out of ROM, A segment or the program is too large

The 18F series doesn't segment ROM, it is contiguous, so
why am I getting this error? Why isn't the code just
going where it should and the compiler getting on with it?

Does anyone have any suggestions of how to get around
this problem?

thanks,
DLC
_________________
--
------------------------------------
Dennis Clark dlc@frii.com
http://www.techtoystoday.com
------------------------------------
Ttelmah
Guest







PostPosted: Sun Feb 13, 2005 3:00 am     Reply with quote

First comment, is that #int_global, handles the _standard_ interrupt, not the 'fast' interrupt. The normal 'fast' interrupt handler, itself behaves exactly like int_global (it does not check the interrupt source, and does not save the registers). Just declare a 'fast' handler, and add your required testing to this.
If you are declaring 'int_global', and then declaring this as 'fast', you are sending two conflicting messages to the compiler.
The error message is just complaining that the routine does not fit in front of the 'main' code. If you are using the double declaration, this is probably just 'confusing' the compiler...

Best Wishes
Mark



Joined: 07 Sep 2003
Posts: 2838
Location: Atlanta, GA

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

PostPosted: Sun Feb 13, 2005 9:30 am     Reply with quote

Here is an example of rolling your own interrupt handler using both high and low priority interrupts

http://www.ccsinfo.com/forum/viewtopic.php?t=21092&postdays=0&postorder=asc&start=15
Guest








PostPosted: Sun Feb 13, 2005 4:47 pm     Reply with quote

Ttelmah wrote:
First comment, is that #int_global, handles the _standard_ interrupt, not the 'fast' interrupt. The normal 'fast' interrupt handler, itself behaves exactly like int_global (it does not check the interrupt source, and does not save the registers). Just declare a 'fast' handler, and add your required testing to this.
If you are declaring 'int_global', and then declaring this as 'fast', you are sending two conflicting messages to the compiler.
The error message is just complaining that the routine does not fit in front of the 'main' code. If you are using the double declaration, this is probably just 'confusing' the compiler...

Best Wishes


First off, you can't declare #int_global FAST, the compiler
won't let you. It would not be sending any conflicts to
the compiler if the compiler was correct. First off, FAST
ISR handling is the PIC18F default, where the PC, Status
and BSR are saved to the 1-deep call stack. So CCS is
misusing the term "FAST" to declare a high priority IRQ,
all IRQ's will use the "FAST" option by default. Only if
you are mixing high and low priority IRQ's can you NOT
use the "FAST" call stack. So, to use #int_global, one
really needs to re-direct the ISR, which is not gracefully
handled I think.

DLC
Guest








PostPosted: Sun Feb 13, 2005 5:32 pm     Reply with quote

Mark wrote:
Here is an example of rolling your own interrupt handler using both high and low priority interrupts

http://www.ccsinfo.com/forum/viewtopic.php?t=21092&postdays=0&postorder=asc&start=15


Thanks,

That is pretty much what I expected to be doing. Since I'm only using high priority interrupts, I was going to (and confirmed that it works) just do an :
#int_global
void ISR_High_Wrapper(void)
{
ISR_High();
}

But now that I think about it, it is cleaner define both high and low and punch the IRQ bits manually.

thanks,
DLC
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