 |
 |
View previous topic :: View next topic |
Author |
Message |
joseperri
Joined: 24 May 2019 Posts: 6
|
PIC16F15256: Using Storage Area Flash (SAF) Memory for Bootl |
Posted: Thu Aug 07, 2025 12:13 pm |
|
|
Hello everyone,
I hope you're having a great day.
I'm working with the PIC16F15256 microcontroller. I know this device has not Data EEPROM, but I'm also interested in using the Storage Area Flash (SAF) for data storage, especially for a bootloader application.
Does anyone have a code example or a guide that could help me understand how to read from and write to the SAF memory? Any advice on best practices for this type of memory would be greatly appreciated.
Thank you very much in advance!
Greetings from Argentina.
José. |
|
 |
Ttelmah
Joined: 11 Mar 2010 Posts: 19916
|
|
Posted: Fri Aug 08, 2025 1:03 am |
|
|
The problem here is size.
The SAF is only 128 words. You would need a very special small bootloader
to fit into this. You would need to custom modify something like the
Tiny bootloader for this chip, and I'm not sure you will be able to get this
to fit.
They you have to enable the SAF, and set it's address as the bootblack
address.
Ideally you run with the SAF write protected, so the fixed bootloader
is in this location and protected.
You would not want to read/write the SAF. The whole point of this would be
be that you write then bootloader during programming, and it runs, and
it then reads?writes the rest of memory. The SAF itself is never read/written.
For using it instead of EEPROM, search here for using HEF The High
endurance flash is the equivalent area on a lot of other chips used instead
of EEPROM.
For this you would not protect the SAF. Caveat with this is that the
program memory words are not byte sized, so you have to use just the
low 8 bits of each word. The key point about SAF, is it is mapped at the
top of the memory range.
Big thing on use, is that you have to erase an entire block, and rewrite
this to change a single byte. 32 words at a time. |
|
 |
|
|
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
|