[SOLVED] Storing values to be available at power on (addressing flash memory)

Question 1
I have an emergency power-off switch - which does what it says - but leaves me with a problem of knowing where everything is.

E.g. at what degree of rotation is a stepper motor at the point the power is shut off?

So what I want to do is store a few key values in some flash memory (or something non-volatile) that will be available at start up.. My question is can I write and read to flash memory on the Atmega chip (eg where the program code is stored) or do I need to use a flash memory chip?

(I would probably look to save the values as part of an interrupt triggered from the power down cycle).

Question 2
Does the Arduino IDE give access to all the programming functionality as standard or is there an extended (or lower level) programming environment?

Hi, See:

http://playground.arduino.cc/Code/EEPROM-Flash

Botolph:
Question 2
Does the Arduino IDE give access to all the programming functionality as standard or is there an extended (or lower level) programming environment?

You can access all the hardware registers from the IDE (the C++ environment) so there is no need for any other environment. Occassionally people use Assembler for very specific purposes (where timing is absolutely critical) but this does not sound like it applies in your case.

Thanks for your replies. They answer the question.

On the programming side I am fairly much a novice with C so this is all fairly new but I did do nearly 10 years with assemblers a couple of decades ago (and on occasions just binary when it wasn't worth writing an assembler). I do miss that feeling of control it gives.

Must be Mad