fastest means to store only 2 bytes of non-volatile constants

I’m using Rabbit 6750 and Dynamic C 10.72. I need to store only 2 bytes of constants in non-volatile memory. I don’t want to count on battery backed ram because the battery will eventually go dead. I tried the readUserBlock and writeUserBlock but when I started updating the 2 constants (each 1 byte) the Rabbit locked up. Additionally, writing the byte was extremely slow. There must be a way to place these two bytes quickly and reliably in some non-volatile memory. Any help out there? Thanks.

Are you using the SUBFS.c sample program.
The purpose of SUBFS is to make it easier to manage data in the
userID block, which is a non-volatile area of storage available on
all Rabbit boards.

I have done some work on this and found that, eventually, the writeUserBlock() was the function to use. At first the timing indicated writeUserBlock() took 3.75 seconds to work and eventually locked up the application. I created a much simplier app using the writeUserBlock() function and found it only took 123 milliseconds to execute and never locked up the program. I went back to my main app and started commenting out functions I suspected may affect the writeUserBlock() execution.

I found using serial port B was the problem. Apparently, you can’t use serial port B and writeUserBlock() with any success. I went back to the documentation and found that the serial flash uses Port B lines and if you want to use serial port B and writeUserBlock() YOU have to manage those lines - my guess is you must really want to use that serial port B pretty badly to accomplish that.

I think they ought to put a note about the serial port B conflict with writeUserBlock() in the writeUserBlock() function description.

Thanks for your help.

1 Like