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 CCS Technical Support

bootloader 18f8722

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



Joined: 09 Dec 2009
Posts: 37

View user's profile Send private message

bootloader 18f8722
PostPosted: Fri Jan 21, 2011 1:06 pm     Reply with quote

Hi all
I have written a code for 18f8722, 70% of the total memory; I looking now for a free bootloader. I tried the bootloader down:
Code:

///////////////////////////////////////////////////////////////////////////
////                      EX_BOOTLOADER.C                              ////

#elif defined(__PCH__)
#include <18F8722.h>
#fuses NOWDT,H4, NOPUT, PROTECT, BROWNOUT, NOLVP, NOCPD, NOWRT, DEBUG,MCU
#use delay(clock=40000000)
#use rs232(baud=9600, xmit=PIN_C6, rcv=PIN_C7)  // Jumpers: 8 to 11, 7 to 12
#endif

#define _bootloader


#include <bootloader.h>
#include <loader.c>
.
.
.
void main(void) {
   
if(!input(pin_j6))
   {
      load_program();
   }

   application();
}


my problem is how do i load the hex file of the original code? is hyperterminal ok ?
do i need to change the start address of the main program ?

Thank you in advanced


+++++++++++++++++++++++
Most code removed.

Reason: Forum Rule #10
10. Don't post the CCS example code or drivers

Forum Rules:
http://www.ccsinfo.com/forum/viewtopic.php?t=26245

- Forum Moderator
+++++++++++++++++++++++
assaad



Joined: 09 Dec 2009
Posts: 37

View user's profile Send private message

PostPosted: Tue Jan 25, 2011 10:40 am     Reply with quote

any suggestion ?
bkamen



Joined: 07 Jan 2004
Posts: 1615
Location: Central Illinois, USA

View user's profile Send private message

PostPosted: Tue Jan 25, 2011 11:40 am     Reply with quote

you need to look at the bootloader examples carefully.

Obviously you'd need to change the start address of your main program. Just as two pieces of matter cannot exist in the same space at the same time,

2 pieces of code cannot overlap the same sections of memory.

So the bootloader will need to reside somewhere (protected space hopefully or written to protect self) and the application will live someplace ELSE.

You also need to worry about re-mapping interrupts if your bootloader uses any or protects that area of memory (always a good idea)

As for CCS's bootloader, I think it will use the SIOW.exe program nicely... if you're using the commandline compiler I don't think you'll have that.. so hyperterminal is your next bet. (although try teraterm or realterm. They're a bunch nicer.)

-Ben
_________________
Dazed and confused? I don't think so. Just "plain lost" will do. :D
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