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

yet another bootloader question for pic 18

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



Joined: 11 Sep 2007
Posts: 18

View user's profile Send private message

yet another bootloader question for pic 18
PostPosted: Fri Dec 05, 2008 2:39 am     Reply with quote

I'm tweaking my bootloader for a new project and I'm have some questions about the two interrupts.

In my boot loader I'm using #int_usb while in my application I'm polling a usb port - without out using interrupts. In the application I have the high priority interruput assigned to a more time critical task.

I use code in the boot loader below to redirect interrupts to the application unless a special button - the program load button - is pressed when things are powered up.

I'm unsure about the 0xA0. The interrupt tables are made by the CCS compiler. Is the "build" below sufficient or do I need two tables. If so, what syntax do I use to specify them?

Anyone who wants to chime in here - feel free.

Robert Ramey


Code:

#build(reset=0, interrupt=0xA0)

/*
#org 0x0008,0x0037
void isr_global(){
    if(!in_app)
        jump_to_isr(0x00A0);
    jump_to_isr(LOADER_END+5*(getenv("BITS_PER_INSTRUCTION")/8));
}
*/

#org 0x0008,0x0017
void isr_global_hp(){
    #asm
    movf    in_app, w
    bz      0xa0
    goto    0x1808
    #endasm
}

#org 0x0018,0x0027
void isr_global_lp(){
    #asm
    movf    in_app, w
    bz      0xa0
    goto    0x1818
    #endasm
}

#org default
...

#inline
void fork(){
    if(input(NOTBOOTLOADER)){
        in_app = TRUE;
        goto_address(LOADER_END + 1);
    }
    else
        in_app = FALSE;
}

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