I am new to the Rabbit so I am not too familiar with initializing persistent variables. My objective is to initialize a set of variables, defined as static, only the first time that the board is powered up. Rest of the times, they can be modified during runtime and should retain their last values after power if cutoff. So my questions are:
If the power fails, or the unit is switched off and the battery is dead, the magic number will be lost, and you know you have to re-initialise all your variables.
Thanks for tips Kenny but I had already tested the ‘static’ part as well as the ‘magic no.’ approach. However, it didnt work until I used the ‘bbram’ keyword before the ‘static’ and changed my compilation options to ‘compile in flash and run in RAM’. I found this hint at the following link.