PDA

View Full Version : HEF EE OK with WRITE ?



dsicon
- 5th February 2021, 18:04
Can I use the PBP3 EE commands READ and WRITE on chips with HEF? I.e. are there any compatibility issues or DEFINEs needed ?

HenrikOlsson
- 5th February 2021, 22:36
Disclaimer: Have never actually used HEF so this is not based on experience but rather on how I believe/think it works.

Since HEF is part of FLASH I'd say the command(s) to use is ERASECODE/WRITECODE/READCODE. And since FLASH memory is sectioned into blocks or rows you need to take that into account if/when you're trying to overwrite/change something you've already written to HEF. In that situation you need to read out everything within that block/row, save it to a buffer (ie RAM), change the value in question, erase the block in HEF and then finally write the content of the buffer back to HEF. For the 16F15376 that you mention in the other thread each row is 32 words.

See section 13 of the 16F15376 datasheet for more details.

richard
- 5th February 2021, 23:44
see here

http://support.melabs.com/forum/picbasic-pro-compiler-3-0-and-later/asm-assembly-language-in-picbasic-pro/6753-accessing-hef#post6758

dsicon
- 6th February 2021, 00:13
Hi Henrik
so I am aware of WRITECODE (have never used it) but the endurance on the original part 16F15376 will not suffice

on the 16F1937 which has DataEE HEF and will drop on the same footprint my question is whether PBP WRITE will just work with the same as with standard endurance

16F19176 has DataEE but is not HEF and interestingly on the Microchip selector for the 1937 they say "Consider 16F19176" I guess because it is newer and more capable.

HenrikOlsson
- 6th February 2021, 07:41
The datasheet for the 16F19176 seems to indicate that the device has actual EEPROM on board and does not mention HEF (High Endurance Flash) so I would expect DATA/READ/WRITE to work with that device.

The 16F1937 looks to be the same, ie having actual EEPROM as opposed to the data memory being a dedicated/special/optimized part of program flash (HEF) so, with that device, I would also expect DATA/READ/WRITE to work.

The 16F15376 however does not have EEPROM so I would not expect DATA/READ/WRITE to work.

Do note that I have not verified this, it's simply based on my interpretation of the datasheets.

/Henrik.