320F2811/2812 use part of the program flash as a data flash

Can the a section of the program flash be written to, by the embedded code, for storing things like calibration data that would are loaded serially once the device is in service?

I need these to be loaded via the SCI or SPI and written to internal non-volatile memory. These valued may change over the life of the device so the OTP is not a clean option. It can be done of that is the only option but not a clean as I'd like.

Trying to avoid adding a serial eprom for those purposes.

Reply to
mook johnson
Loading thread data ...

Mook, Yes, I believe it can. It is device dependent, and I am not as familiar with the parts you are using. I believe they are PICs, aren't they? I have a small library from Microchip that does exactly this.

If not PICs, the basics are this:

Your system can usually only erase one whole page at a time, but can only write one line at a time. Your program establishes a buffer one page in size, and reads in the existing content of that page from program memory. You then make the changes you need in this buffer, erase the old page, and write the new page.

This can get tricky, as you don't want any code you are actually executing to be in that page! You also need to align your data with the page boundaries. Depending on your system, there may be other gotchas waiting in the wings for Murphy to find for you!

Charlie

Reply to
Charlie E.

Thanks for the quick response Charlie but this is a TI C2000 DSP not a PIC.

Reply to
mook johnson

Check the datasheets then. Also, contact TI support on this. The basics are usually the same...

Charlie

Reply to
Charlie E.

Yes. However you have to run the program from SRAM; at least the part which does flash programming. When I did that several years ago, I had to sign NDA with TI to get low level flash programming docs.

FLASH memory of 2812 is PITA, especially the erasing procedure. They also changed flash procedures in the incompatible way at least once. I'd better use external EEPROM.

Vladimir Vassilevsky DSP and Mixed Signal Design Consultant

formatting link

Reply to
Vladimir Vassilevsky

P.S. IIRC the TI code composer includes so-called "flash API". This is SRAM loadable module that you can use from your program. It is rather inconvenient and dumb, however it can do the job.

Vladimir Vassilevsky DSP and Mixed Signal Design Consultant

formatting link

Reply to
Vladimir Vassilevsky

Thanks!

Reply to
mook johnson

e,

nce

so

on

How often do the numbers need to change, what is the expected life of the device and how much OTP space do you have free?

If you can write bits but not erase them, you can use one bit to say that this number is no longer the one to use.

Reply to
MooseFET

How often do the numbers need to change, what is the expected life of the device and how much OTP space do you have free?

If you can write bits but not erase them, you can use one bit to say that this number is no longer the one to use.

These will change infrequently. Maybe 10 times over the life of the device. Most of the time it will never change. The data that goes in there will only be 20 words long so one thought was the put a preamble code on the table and everytime a new update is sent it appends the OTP space with the new set of parameters.

The application code reads linearly down the OTP address space and finds the last table and loads that as the latest set of parameters.

It shoud be fine, I jsut have having a finite number of times write to the address space. I guess I still have that limitation with flash dou to the maximum number of writes limited to 1000.

I think I'll do the OTP for now.

thanks

Reply to
mook johnson

Know nothing about the part. BUT..can *part* of the program memory be written (externally) without disturbing other parts? If so, that is the work-around: have the program (under strict conditions) re-program a specific program memory section. Natually, this ties up some pins for output, some for input (programming) and one or two for control.

Reply to
Robert Baer

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.