View previous topic :: View next topic |
Author |
Message |
PICoHolic
Joined: 04 Jan 2005 Posts: 224
|
Using program memory as NVR |
Posted: Tue Jun 29, 2010 6:48 am |
|
|
Hi,
I was wondering if anyone has implemented a set of functions to write and read data to/from program memory on byte basis.
The values will be initially set using the #rom directive at a specific address let's say 0x10000 on PIC18F87J11 (erase block = 1024, write block = 64)
I just don't wanna re-invent the wheel.
I tried to search for something similar, I couldn't find any.
Thanks |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19548
|
|
Posted: Tue Jun 29, 2010 8:23 am |
|
|
CCS has basic I/O functions for the program memory (read/write_program_memory).
There are also functions to allow variables to be directly handled from a memory source like this (addressmod).
Remember the write life is very limited (you can 'kill' a typical chip in under a minute, by repeatedly writing...). The EEPROM, has longer write life (typically at least 10*). Still the same problem, but 'better'.
So, provided the data is only changed very rarely, this is a perfectly reasonable thing. otherwsie though 'look elsewhere'. Things like external FRAM, can be implemented with only a couple of pins, and are much faster on write, with almost infinite life...
Best Wishes |
|
|
FvM
Joined: 27 Aug 2008 Posts: 2337 Location: Germany
|
|
Posted: Tue Jun 29, 2010 10:29 am |
|
|
Have a look at Microchip AN1095. I implemented it for PIC24, it's working fine. |
|
|
PICoHolic
Joined: 04 Jan 2005 Posts: 224
|
|
Posted: Wed Jun 30, 2010 2:00 am |
|
|
Hi
I've seen the built-in functions.
I'm aware of the limited write life of the flash.
The PIC18F87J11 does not have EEPROM.
I'll be probably adding an external EEPROM 24FC512 instead.
But it's worth trying the program memory as well.
Thanks |
|
|
|