Hi Rob,

I checked the Jallib sample files that I created for testing the HEF library 
and it seems you are right but I am not sure if that will be the case for the 
future.

The example below is for a 2k PIC (16F1507) sample file. You you take the ROM 
size and substract 128 bytes.

-- High Endurance Flash (HEF) address declarations.
const HEF_NR_OF_BYTES    = 128
const HEF_ADDRESS_OFFSET = 2048 - HEF_NR_OF_BYTES
include pic_data_hef

In the device file of this PIC you find:
pragma  code             2048

To make life easier you could extend all device files with something like (for 
this PIC as example):
const ROMSIZE = 2048

And then it becomes:
const HEF_ADDRESS_OFFSET = ROMSIZE - HEF_NR_OF_BYTES

Kind regards,

Rob


________________________________
Van: [email protected] <[email protected]> namens Rob Hamerling 
<[email protected]>
Verzonden: zaterdag 22 oktober 2022 20:19
Aan: [email protected] <[email protected]>
Onderwerp: Re: [jallib] HEF usage: One suggestion and one question


Hi David,

On 22/10/2022 00.31, [email protected]<mailto:[email protected]> wrote:
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 ?

Maybe there is a method to determine the HEF offset.
Assuming:
- HEF is always 128 words
- HEF is last part of program memory
HEF-offset = amount of program memory less 128

Regards, Rob.

--
Rob Hamerling, Vianen, NL

--
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]<mailto:[email protected]>.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jallib/eaf6a66d-0ff1-f9a9-1e8d-5d217f3ef37f%40gmail.com<https://groups.google.com/d/msgid/jallib/eaf6a66d-0ff1-f9a9-1e8d-5d217f3ef37f%40gmail.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/GVXP195MB16373C1652EEF7F91AF8C179E62F9%40GVXP195MB1637.EURP195.PROD.OUTLOOK.COM.

Reply via email to