View previous topic :: View next topic |
Author |
Message |
Gabriel
Joined: 03 Aug 2009 Posts: 1067 Location: Panama
|
HEF??? |
Posted: Mon Apr 27, 2015 8:31 am |
|
|
Hi Guys,
What in the world happened to EEPROM?
As i understand it this "HEF" is just plain program memory or is it something else?
i guess i have to separate a block to use it like an EEPROM?
How? how do i not select areas used by my program? how do i know how much is left? can i access single bytes? or do i need to write whole pages?
i have to use the regular predefined CCS program memory write/read instructions?
Examples?
WHY on earth would HEF be a better option than just EEPROM
Thanks
G. _________________ CCS PCM 5.078 & CCS PCH 5.093 |
|
![](templates/subSilver/images/spacer.gif) |
asmboy
Joined: 20 Nov 2007 Posts: 2128 Location: albany ny
|
quoting Microchip |
Posted: Mon Apr 27, 2015 10:43 am |
|
|
Quote: |
FLASH VS. EEPROM
Both the high-endurance Flash and the regular Flash
memory arrays differ from a data EEPROM module in
two important ways:
a) Data must be manually erased before a
write and this can be performed only in
blocks (referred to as rows) of a fixed size
determined by the Flash array inner design.
b) Writing to Flash stalls the MCU for a few
milliseconds (see parameter D123 in
Table 1).
By contrast, true data EEPROMs are designed to allow
byte-by-byte erase and do not stall the MCU execution
during a write cycle, although, for simplicity reasons,
most applications will include a delay loop to ensure a
(byte) write has been completed before the next one
can be initiated. |
the main benefit is faster write of blocks of data.
and you already know the main drawback. ![Very Happy](images/smiles/icon_biggrin.gif) |
|
![](templates/subSilver/images/spacer.gif) |
temtronic
Joined: 01 Jul 2010 Posts: 9174 Location: Greensville,Ontario
|
|
Posted: Mon Apr 27, 2015 10:46 am |
|
|
I just had a quick read of the microchip appnote and do NOT like the 'stall during write' issue. Seem the PIC will 'STOP EVERYTHING' until a write to HEF is completed !
Um, that is NOT a good 'feature', in my opinion !!!
Bound to be other 'issues' though the 8bit bytes organization is nicer than the 14bit for EEPROM ..but.... STALLING !!!!
arrgh....
Maybe someone can post a VALID reason ??
Jay |
|
![](templates/subSilver/images/spacer.gif) |
Ttelmah
Joined: 11 Mar 2010 Posts: 19369
|
|
Posted: Mon Apr 27, 2015 11:40 am |
|
|
I think the key is that for most uses involving storing values, a lot more space is needed than the internal EEPROM offers, so the expectation is that people wanting to store very much, will add an external I2C EEPROM.
Internal EEPROM involves a lot of transistors, using slightly different structures to the rest of the PIC, so it is a lot cheaper to just increase the size of the flash. The HEF sections are implemented using the bulkier and slightly more expensive SLC technology, also with thicker substrate to increase the cycle life. The stall is the killer for many applications. I have posted a simplified 're-use' emulation to reduce the number of cycles used to emulate a small EEPROM area, and for something like calibration factors only updated at a known point in the code, where the stall can be lived with, this works OK.
Generally the key to PIC designs is that they are produced initially for a 'market'/customer, and for the lowest possible price. Unfortunately EEPROM inside the chip is not seen as very markettable. Most units allowing you to change settings are happy to stop for a few moments when the write takes place. |
|
![](templates/subSilver/images/spacer.gif) |
Gabriel
Joined: 03 Aug 2009 Posts: 1067 Location: Panama
|
|
Posted: Mon Apr 27, 2015 12:14 pm |
|
|
Im doing a simple logger function to add to my GSM code...
Basically im recording ONE DS18B20, ONCE an hour as per the application requirements... its "nice to have" feature.
But with this HEF stuff... i think im just gonna go with regular RAM and call it a day... and get battery backup for the system.
just when i started to like PIC18 stuff...i find this.
Thanks for all your input. im glad to see im not the only one not feeling so awesome about this.
G. _________________ CCS PCM 5.078 & CCS PCH 5.093 |
|
![](templates/subSilver/images/spacer.gif) |
Ttelmah
Joined: 11 Mar 2010 Posts: 19369
|
|
Posted: Mon Apr 27, 2015 1:15 pm |
|
|
On the PIC18's, a lot do have EEPROM. Look at chips like the x6K40, and the K22 chips.
The parametric tool at Microchip is your friend. Select all PIC18's, and the 'All parametric chart features', then select the 256EEPROM, or the 256EEPROM/HEF options, and whatever else you want in the chip. There are models where the only option is HEF, but for 99% of applications something similar is available with EEPROM.
Looking at your original post, I see you are using the Ethernet chips. These are about the only ones where an EEPROM version is not available.
On your questions about how to use the flash, search back here. As I said, I posted routines to use a sub page of FLASH, and automatically put multiple ones into a single page of flash memory, only a few weeks ago. These routines also show how you handle the memory (in terms of telling the compiler not to use it etc..).
It's here: <http://www.ccsinfo.com/forum/viewtopic.php?t=53690>
Just select the page that supports HEF to use. Be aware that the high endurance feature is usually only the low byte in the word, and if you are not updating at all often, you may need a larger area than this. |
|
![](templates/subSilver/images/spacer.gif) |
dyeatman
Joined: 06 Sep 2003 Posts: 1924 Location: Norman, OK
|
|
Posted: Mon Apr 27, 2015 3:32 pm |
|
|
Why not FRAM? _________________ Google and Forum Search are some of your best tools!!!! |
|
![](templates/subSilver/images/spacer.gif) |
Ttelmah
Joined: 11 Mar 2010 Posts: 19369
|
|
Posted: Tue Apr 28, 2015 1:08 am |
|
|
I too love FRAM, but it means adding an external chip.
The point being asked, was about the internal options. |
|
![](templates/subSilver/images/spacer.gif) |
|