View previous topic :: View next topic |
Author |
Message |
prwatCCS
Joined: 10 Dec 2003 Posts: 70 Location: West Sussex, UK
|
Hooking into reset vector |
Posted: Mon Feb 04, 2008 7:26 am |
|
|
Is there a simple way of getting my own code to run immediately (ie placing at at the point pointed to by the reset vector) and thus before the CCS generated initialisation code?
I am using PIC18F1330, but question is really generic. I have some hardware that I want to initialise as soon as possible after reset, and want to avoid the delay created by CCS startup before entering main().
Note - I do still want to use the CCS startup code, rather than code that myself. In essence I want to insert code between the reset vector jump location and the CCS code that appears before main();
Ideas please ? _________________ Peter Willis
Development Director
Howard Eaton Lighting Ltd UK |
|
|
Ttelmah Guest
|
|
Posted: Mon Feb 04, 2008 11:15 am |
|
|
Use the same approach used for bootloaders. Just use the 'build' instruction, to locate the CCS bootvector at a higher point in memory, than the real boot, and then add your own code at the base of memory, which jumps to this address.
Best Wishes |
|
|
prwatCCS
Joined: 10 Dec 2003 Posts: 70 Location: West Sussex, UK
|
|
Posted: Tue Feb 05, 2008 3:11 am |
|
|
Thanks
as they say, I knew there must be a way .... I just could not for the life of me remember, and my searches in the help file under "reset" and "reset vector" had revealed nothing.
Now my only challenge, no - one of my remaining challenges, is to squeeze the code into the 18F1330. Sadly no space for a bootloader !! _________________ Peter Willis
Development Director
Howard Eaton Lighting Ltd UK |
|
|
|