HEF is essentially a specific type of memory at specific locations.  The 
HEF is only one byte of each work ( a common mistake is to assume HEF is 
the word within the HEF range).

So, the size of the HEF range.  This can be extracted from other sources 
like the PICkitPlus database ( we have collated the data required ).  

>From a pre-loading the HEF range you can treated the HEF memory as 
self-write progmem or you could .ORG you data into the correct location.

>From a programming point of view.  PICKitPlus protects HEF (and SAF) in 
terms of caching prior to programming the chip and restoring the 
appropriate memory range.

 Hope this helps.





On Saturday, 22 October 2022 at 09:53:34 UTC+1 [email protected] wrote:

> Hi David,
>
> Device files are generated from the XML files that Microchip provides. As 
> far as I can see this offset value is not present in these xml files so it 
> cannot be automatically generated.
>
> About your second question. I am not aware that a PIC programmer can 
> program the HEF locations. By default (after erase) the data is always 0xFF.
>
> So what I do I check if the value of a certain address is 0xFF and if that 
> should be something else then I know the HEF is not initialzed. I then 
> write a valid value other than 0xFF to that location and also store other 
> values in the HEF that I need. The next time I power up the device I see 
> this is a valid value and know that the other values in the HEF are valid 
> so I do not touch them. So you need to define some HEF location that you 
> use as an 'I am initialized' location.
>
> I have used this in my project where I built a power supply with preset 
> buttons of which the values where stored in HEF. This project btw lead to 
> the HEF library 🙂.
>
> Kind regards,
>
> Rob
>
> ------------------------------
> *Van:* [email protected] <[email protected]> namens 
> [email protected] <[email protected]>
> *Verzonden:* zaterdag 22 oktober 2022 00:31
> *Aan:* jallib <[email protected]>
> *Onderwerp:* [jallib] HEF usage: One suggestion and one question 
>  
> Hi all,
>
> I am starting a new project using a PIC16F1705.
> I willl use the "pic_data_hef" library.
> This libray requires the definition of a constant containing the start 
> address of the HEF, and named *HEF_ADDRESS_OFFSET.*
> For the 16F1705, that value is 0x1F80
>
> My suggestion: *Couldn't that constant be defined in the device include 
> file, so that, if I decide to port my code to another PIC, the value of the 
> constant would be automatically updated, and thus, avoiding possible errors 
> ?*
>
> In my application, the user will be able to select a "mode".    I would 
> like that the selected mode be written in the HEF, so that at the next 
> boot, the last selected mode is automatically picked up.    
> At the very first usage, there will also be a default mode defined
> (I am simplifying here, because in fact there is not only one byte to save 
> in HEF but several data, but let's keep the question simple)
>
> My question is: *How can I define those default values in HEF for the 
> very first start of the application ?    *For example, how can I force 
> the value "0x15" in location 0x1F80 which is the adress of the first HEF 
> location during *programming *time ?
>
> Thanks all for your help
>
> David
>
> -- 
> You received this message because you are subscribed to the Google Groups 
> "jallib" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected].
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/jallib/4de5fe02-087b-4db1-9d4c-2d4e8b44dab8n%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/jallib/4de5fe02-087b-4db1-9d4c-2d4e8b44dab8n%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"jallib" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jallib/88b6b0d8-91d7-46c6-a617-f2bd330657ean%40googlegroups.com.

Reply via email to