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

bootloader and fuses

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



Joined: 10 May 2005
Posts: 323
Location: Belgium

View user's profile Send private message

bootloader and fuses
PostPosted: Mon Feb 01, 2010 9:24 am     Reply with quote

Hello,

a simple question.

You have a bootloader program which has as fuse:

Code:
#fuses INTRC_IO  //use internal OSC


You have a main program which has not that fuse.

=> Will my program use the internal OSC or not?

Using a PIC16F886.

best regards;


Last edited by Christophe on Tue Feb 02, 2010 2:11 am; edited 1 time in total
Rohit de Sa



Joined: 09 Nov 2007
Posts: 282
Location: India

View user's profile Send private message Visit poster's website

PostPosted: Mon Feb 01, 2010 9:41 am     Reply with quote

A bootloader is a program that resides in the microcontroller's memory. It is called upon only when there is need to reprogram or modify the user code on the microcontroller. As far as my experience goes, I have never seen configuration fuses being modified by user code; ie once the bootloader is burnt, you can't touch config fuses - and this sort of makes sense - suppose the bootloader changes the oscillator type while reprogramming it may not be possible to continue programming!

So a short answer - yes, your main program will use the internal oscillator. , And for that matter, it can ONLY use the internal oscillator and nothing else.

Rohit
ckielstra



Joined: 18 Mar 2004
Posts: 3680
Location: The Netherlands

View user's profile Send private message

PostPosted: Mon Feb 01, 2010 10:34 am     Reply with quote

It depends on the bootloader. As Rohit already mentioned, most bootloaders don't support changing the fuses. There are however a few exceptions where it is desired to change the fuses, for example to activate the read protection fuse. Most PIC processors allow the user program (or bootloader) to activate this fuse, but it works only in one direction. Once activated (the bit is set or reset, I don't remember) you can only reverse the setting by doing an 'erase-all'.

In short: uploading a user program without fuse settings will use the original bootloader settings.
If the user program does contain fuses, the result will depend on the capabilities of the bootloader and the fuses.
asmallri



Joined: 12 Aug 2004
Posts: 1634
Location: Perth, Australia

View user's profile Send private message Send e-mail Visit poster's website

PostPosted: Mon Feb 01, 2010 8:49 pm     Reply with quote

Rohit de Sa wrote:


So a short answer - yes, your main program will use the internal oscillator. , And for that matter, it can ONLY use the internal oscillator and nothing else.

Rohit


Almost, it depends on the PIC Family. The high end PICs such as the PIC24, dsPIC33 and PIC32MX allow software control of some of the fuse settings to allow the application at run time to change the PICs defaults that were defined by the fuses until the PIC is reset.
_________________
Regards, Andrew

http://www.brushelectronics.com/software
Home of Ethernet, SD card and Encrypted Serial Bootloaders for PICs!!
Christophe



Joined: 10 May 2005
Posts: 323
Location: Belgium

View user's profile Send private message

PostPosted: Tue Feb 02, 2010 2:29 am     Reply with quote

Okay, thanks everybody. I need to change the bootloader fuses then.
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