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

Change the interrupts address

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



Joined: 29 Aug 2010
Posts: 14
Location: SPAIN

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

Change the interrupts address
PostPosted: Fri Oct 15, 2010 5:16 am     Reply with quote

Dear all, I need to change the Reset and Interrupts address to other places, but I don't know how put this in CCS for be possible that interrupts routines function well.
Somebody knows how to do?
I am working with PIC18F2680
Thanks a lot
Antonio Mate
Humberto



Joined: 08 Sep 2003
Posts: 1215
Location: Buenos Aires, La Reina del Plata

View user's profile Send private message

PostPosted: Fri Oct 15, 2010 9:18 am     Reply with quote

With the #BUILD directive you can assign a new location of Reset and Interrupts vector. What's the reasons to do this?

Regards
amate



Joined: 29 Aug 2010
Posts: 14
Location: SPAIN

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

reason for change the reset an interrupt address
PostPosted: Fri Oct 15, 2010 9:46 am     Reply with quote

I try to use one CAN bootloader made in assembler, this program branch reset and the two interrupts to other addresses, then like I want make the rest of my program in CCS C it is needed to say to the compiler the new addresses.
Just I have seen the #built directive, according with it, it is possible to define the new address for reset, and there are only one address for interrupts. Which interrupt is hold in this address ? High or Low? or the same for the two?
Many thanks for your quick answer, as you see I am a beginner and of course my questions are elemental questions.
Humberto



Joined: 08 Sep 2003
Posts: 1215
Location: Buenos Aires, La Reina del Plata

View user's profile Send private message

PostPosted: Fri Oct 15, 2010 10:25 am     Reply with quote

The microcontroller reset vector always make a call to address 0x0004. The #BUILD directive only relocate
where the compiler puts the code to handle this.
The same is applicable to Interrupts, if you have the code in assembler, we assume that you will put 'real'
code in such address.
Quote:

Which interrupt is hold in this address ? High or Low? or the same for the two?

Sorry but I do not fully understand what do you mean.

Please read these threads:
http://www.ccsinfo.com/forum/viewtopic.php?t=32154&highlight=vector
http://www.ccsinfo.com/forum/viewtopic.php?t=32558&highlight=vector

Regards
amate



Joined: 29 Aug 2010
Posts: 14
Location: SPAIN

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

new address for interrupts
PostPosted: Fri Oct 15, 2010 10:51 am     Reply with quote

Thanks for the answer
I explain:
in the assembler program is writed
in 0x0000: goto NewResetAddress
in 0x0008: goto NewIntHighAddress
in 0x0018: goto NewIntLowAddress
Then I understand it is needed to put:
#build(reset=NewresetAddress,interrupt=NewIntHighaddress), for notify the new addresses of reset and interrupt rutine

what happen with the low interrupt in the PIC18?
are the two rutines, High and Low answered like if were the same type?
Thanks for your time
Antonio Mate
Humberto



Joined: 08 Sep 2003
Posts: 1215
Location: Buenos Aires, La Reina del Plata

View user's profile Send private message

PostPosted: Fri Oct 15, 2010 11:17 am     Reply with quote

Those refer to the interrupt locations, in the PIC18F2680 the High Priority interrupt vectors starts at 0x0008 and the Low at 0x0018

Quote:

what happen with the low interrupt in the PIC18?
are the two rutines, High and Low answered like if were the same type?

Yes, but you need to add:
#device HIGH_INTS=TRUE
in order to tell the compiler to handle both interrupts priorities.

The best way to analyze the compiler behaviour is compiling your "mixed code" and reading its output file. (xxx.lst)

Regards
amate



Joined: 29 Aug 2010
Posts: 14
Location: SPAIN

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

new interrupt addresse
PostPosted: Fri Oct 15, 2010 11:24 am     Reply with quote

Thanks a lot, I need to learn a lot,lot,lot more
antonio mate
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