So I have a very simple program, with a 'variable' preset by me, but my simple program allows a user to override the content of the variable (by turning a potentiometer & pushing a switch to confirm)....ok, all is good - I know how to do that.

But then the PIC is powered off ....alas, when it's next powered up again, the variable is going to be populated with my default value again - that's gonna get tiring very quickly if everytime the pic is powered up, the user has to enter his preferred value each time.

So how can I implement a solution so that *if* the end user changes the variable (from default), then this updated variable is saved (to be read when the PIC is next powered up)

Now I know it's going to involve writing something to non volatile memory - how do I do that & more importantly, how can I instruct my PIC to go & get the value?!