View previous topic :: View next topic |
Author |
Message |
pic18 Guest
|
one nop on high prior irq vector |
Posted: Sat Mar 11, 2006 12:37 pm |
|
|
CCS 3.236 will jump on RAM-Adr 0x0008 to my IRQ handler
CCS 3.245 have NOP (0x0000) on ROM-Adr 0x0008 and the Jump to IRQ handler is on ROM-Adr 0x000a
=> my problem:
I need the 12 Bytes from ROM-Adr 0x000a to 0x0017 for privat using as VersionID in compatibility to all old systems
All my projects run with this setup and work up to CCS 3.236 ok...
#define BTL_BOOTCODE 0x7b00 // Bootfunctions from 0x7b00
#define BTL_BOOTSTART 0x7f80 // StartBootloader on 0x7f80
#define BTL_MAINRESET 0x0004 // MainResetJump on 0x0004
#define BTL_MAINSTART 0x0007 // 4Byte space => 1x "GOTO" -> "Main"
#define BTL_MAINHIIRQ 0x0008 // Interruptvector HI-Priority[08-17]
#define BTL_MAINLOIRQ 0x0018 // Interruptvector LO-Priority[18...]
#define BTL_MAINSPACE 0x7aff // top of main program space
#define BTL_BOOTRESET 0x0000 // Hardware RESET => 1x "GOTO" -> "BTL_BOOTSTART"->
/**********************************************************************/
#reserve 0x000c:0x17 // 12Byte free space for Version-ID
#fill_rom 0x0000
/*******************************************************************************/
#rom BTL_BOOTRESET={0xefc0,0xf03f} // "goto_address(BTL_BOOTSTART) goto 0x7f80"
/*******************************************************************************/
#build(memory=BTL_MAINRESET:BTL_MAINSPACE) //Assigns memory space
#build(reset=BTL_MAINRESET:BTL_MAINSTART,interrupt=BTL_MAINHIIRQ)
/**********************************************************************/
/*******************************************************************************/
#org BTL_BOOTCODE,BTL_BOOTSTART-1 default
/*******************************************************************************/
....
/*******************************************************************************/
#org BTL_BOOTSTART,0x7fff default
/*******************************************************************************/
void BOOTstart(void)
{
...
goto_address(BTL_MAINRESET); // -> Main
}
/*******************************************************************************/
#org default
/*******************************************************************************/
void main(void)
{
....
} |
|
|
dorinm
Joined: 07 Jan 2006 Posts: 38
|
|
Posted: Sat Mar 11, 2006 1:49 pm |
|
|
#reserve 0x000c:0x17 // 12Byte free space for Version-ID
...now is that 0x000c a typo or your problem itself ? |
|
|
pic18 Guest
|
0x0008..0x000b |
Posted: Sun Mar 12, 2006 2:21 am |
|
|
CCS well generate a double word GOTO for jump to IRQ handler and i need this 4 Bytes of PIC18 goto opcode from rom adr 0x0008..0x000b.
(the microchip pic18 datasheet's say extact this, the hardware vector is 0x0008)
All my old CCS versions 3.229,3.236 can do this, only later versions up to new 3.245 well set a 2Byte NOP on 0x0008/0x0009 an set 4Byte GOTO opcode from 0x000a..0x00d. On 0x000c/0x000d is now the last word of the double word GOTO instruction :(
0x000c..0x0017 i must use for VersionID |
|
|
Ttelmah Guest
|
|
Posted: Mon Mar 13, 2006 4:10 am |
|
|
You don't say what chip?.
The NOP at address 8, is a standard fix for an erratum, on some of the 18 chips. This can be enabled/disabled by device editor. Now whether your chip may have the problem, you will need to verify in the errata sheets, otherwise you should consider relocating your code if you are not going to have problems...
Best Wishes |
|
|
|