On an Atmega128:
When I, for example, store incoming characters at the serial port into a char array, or store an A2D measurement into an int, is the default memory location the onboard SRAM? I am not cognizant of specifying which memory to save to in my code, so wherever I'm saving to is the default setting (using CodeVisionAVR).
I've read the datasheet and their terminology is a little confusing to me, but as near as I can tell the program memory is located in flash, and any data stored or manipulated by the program is SRAM. Is that correct?
I ask because I'd like to lock the flash bits, and I don't want to do that and find out that I'm actually storing data there and after I lock the bits the program won't work because it can't store data.
Oh, and if I lock the flash bits then I can't reprogram the processor again unless I erase it first, correct? When I program a chip using CAVR, I see a message at the bottom stating that the chip is being erased, so I guess there is nothing further I need to do to enable that feature?