View previous topic :: View next topic |
Author |
Message |
amate
Joined: 29 Aug 2010 Posts: 14 Location: SPAIN
|
Change the interrupts address |
Posted: Fri Oct 15, 2010 5:16 am |
|
|
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
|
|
Posted: Fri Oct 15, 2010 9:18 am |
|
|
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
|
reason for change the reset an interrupt address |
Posted: Fri Oct 15, 2010 9:46 am |
|
|
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
|
|
|
amate
Joined: 29 Aug 2010 Posts: 14 Location: SPAIN
|
new address for interrupts |
Posted: Fri Oct 15, 2010 10:51 am |
|
|
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
|
|
Posted: Fri Oct 15, 2010 11:17 am |
|
|
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
|
new interrupt addresse |
Posted: Fri Oct 15, 2010 11:24 am |
|
|
Thanks a lot, I need to learn a lot,lot,lot more
antonio mate |
|
|
|