View previous topic :: View next topic |
Author |
Message |
Christophe
Joined: 10 May 2005 Posts: 323 Location: Belgium
|
bootloader and fuses |
Posted: Mon Feb 01, 2010 9:24 am |
|
|
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
|
|
Posted: Mon Feb 01, 2010 9:41 am |
|
|
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
|
|
Posted: Mon Feb 01, 2010 10:34 am |
|
|
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
|
|
Posted: Mon Feb 01, 2010 8:49 pm |
|
|
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
|
|
Posted: Tue Feb 02, 2010 2:29 am |
|
|
Okay, thanks everybody. I need to change the bootloader fuses then. |
|
|
|