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

Hooking into reset vector

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



Joined: 10 Dec 2003
Posts: 67
Location: West Sussex, UK

View user's profile Send private message

Hooking into reset vector
PostPosted: Mon Feb 04, 2008 7:26 am     Reply with quote

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







PostPosted: Mon Feb 04, 2008 11:15 am     Reply with quote

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: 67
Location: West Sussex, UK

View user's profile Send private message

PostPosted: Tue Feb 05, 2008 3:11 am     Reply with quote

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
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