View previous topic :: View next topic |
Author |
Message |
Christophe
Joined: 10 May 2005 Posts: 323 Location: Belgium
|
Bootloader + fuses |
Posted: Mon Jan 19, 2009 3:47 am |
|
|
Hi,
So you have the bootloader program that has fuses in the program itself that also has fuses. What fuses will your program use?
- Bootloader: NOBROWNOUT
- Program: (BROWNOUT RESET)
What will happen with my program when voltage drops? What fuses are determining? |
|
|
Ttelmah Guest
|
|
Posted: Mon Jan 19, 2009 5:04 am |
|
|
Depends whether your bootloader loads fuse data.
Many simpler bootloaders, only program the main memory area. Also, in some (old) chips, the 'fuses' are only programmable using an actual programmer. In these cases the fuses originally set, when the bootloader was loaded, will apply. However if the chip (and bootloader) support setting the fuses, then the fuses will chage to the new versions, for the change shown. However also some fuses (like those covering code protection for example), can only ever be 'set' by a bootloader. Clearing these, requires a full device 'erase', which will also erase the bootloader. Done so that once protected, code can't be 'unprotected', and read.
Best Wishes |
|
|
Christophe
Joined: 10 May 2005 Posts: 323 Location: Belgium
|
|
Posted: Mon Jan 19, 2009 5:09 am |
|
|
The bootloader reads the HEX files and writes the bytes to the program memory; so I don't guess it will also write the fuses.. Are the fuses written to a special location? |
|
|
asmallri
Joined: 12 Aug 2004 Posts: 1634 Location: Perth, Australia
|
|
Posted: Mon Jan 19, 2009 6:44 pm |
|
|
Christophe wrote: | The bootloader reads the HEX files and writes the bytes to the program memory; so I don't guess it will also write the fuses.. Are the fuses written to a special location? |
Yes #fuses are written to a specific location depending on the specific PIC. Legacy PICs do not allow fuses to be set or cleared without an external programmer. New generation PIC allow an application, such as a bootloader to set but not clear a subset of fuses. Once set, it cannot be reset by the PIC - instead the PIC must be erased by an external programmer.
Most bootloaders do not allow fuses to be set by the bootloader. The theory being that if you changed a fuse and as a result you introduced a problem, there is no way for the bootloader to recover from the problem. You could have you application program set fuses but you run into the same problem.
Fuses are typically set to match a PIC to a particular hardware environment and therefore should not normally require changing. If your application requires different fuses then you will most likely need to change the bootloader to set the fuses accordingly _________________ 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 Jan 20, 2009 1:59 am |
|
|
Quote: |
Yes #fuses are written to a specific location depending on the specific PIC. Legacy PICs do not allow fuses to be set or cleared without an external programmer. New generation PIC allow an application, such as a bootloader to set but not clear a subset of fuses. Once set, it cannot be reset by the PIC - instead the PIC must be erased by an external programmer.
|
How can I derive that from the datasheet? I'm using a PIC16LF877A. |
|
|
asmallri
Joined: 12 Aug 2004 Posts: 1634 Location: Perth, Australia
|
|
Posted: Tue Jan 20, 2009 3:50 am |
|
|
Christophe wrote: | Quote: |
Yes #fuses are written to a specific location depending on the specific PIC. Legacy PICs do not allow fuses to be set or cleared without an external programmer. New generation PIC allow an application, such as a bootloader to set but not clear a subset of fuses. Once set, it cannot be reset by the PIC - instead the PIC must be erased by an external programmer.
|
How can I derive that from the datasheet? I'm using a PIC16LF877A. |
This is a legacy PIC.
In general to find out what can and cannot be done with fuses looking in the "special features" section of the data sheet. _________________ 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 Jan 20, 2009 4:18 am |
|
|
Okay thanks; I'll keep in mind that the fuses from the bootloader program are determining for my application. |
|
|
Guest
|
|
Posted: Tue Jan 20, 2009 3:31 pm |
|
|
Hi
Will that say: If the fuses is programmed in bootloader it is not possible to change them in the program loaded from the bootloader?
Or: Can the real program set new values for the fuses?
Little confused... |
|
|
asmallri
Joined: 12 Aug 2004 Posts: 1634 Location: Perth, Australia
|
|
Posted: Tue Jan 20, 2009 3:50 pm |
|
|
Anonymous wrote: | Hi
Will that say: If the fuses is programmed in bootloader it is not possible to change them in the program loaded from the bootloader?
Or: Can the real program set new values for the fuses?
Little confused... |
As discussed already, for a legacy PIC whatever fuses were initially set when programming the bootloader into the PIC are the fuses inherited by the bootloader.
You can set you applications fuses to whatever you like, they are ignored by most (virtually all) bootloaders for the reasons already stated. _________________ Regards, Andrew
http://www.brushelectronics.com/software
Home of Ethernet, SD card and Encrypted Serial Bootloaders for PICs!! |
|
|
Guest
|
|
Posted: Wed Jan 21, 2009 4:14 pm |
|
|
Hi
I played a little with the data sheet of a 18LF2455. In section 25 all the special reg. is described. I can not find anything there can disable a loaded program loaded with a boot loader(if you not make the chip protected). |
|
|
|