Thank you to teknics for this information, posted here.
NVRAM (Non Volatile Random Access Memory)
NVRAM is a rather unique feature. The system memorizes the profile of the eccentric shaft plate on the e-shaft pulley. It basically knows how the e-shaft spins, on an individual basis, 2 cars NVRAM will generally never be absolutely identical, they're pretty close to unique.
As you'd imagine with such a specialized system you wouldn't want this information relearned and forgotten very easily, relearning the profile isn't a short process (drive cycle, dont worry you dont do anything special to relearn it). So this info is kept in a special area of the PCM it CANNOT be cleared in any way EXCEPT the proper procedure, you could disconnect the battery and do a jig for a year and it won't erase.
When/Why should you erase the NVRAM?
Realistically there are only a few times, generally the only times it's really needed is when replacing a motor since you'll be installing a new e-shaft position plate. Sometimes you'll also repair a misfire, yet the misfire code will return even with you not noticing anything, in those cases clearing the NVRAM will sometimes help. Also during PCM replacement it's good to clear it.
How do you reset NVRAM?
Here it is straight from mazda:
2004-2008 Method
1. Turn ignition switch to "ON" position, but do not start engine.
2. Pump the brake pedal at least 20 times within 8 seconds after the ignition switch is turned ON.
NOTE:
Manual transmission equipped vehicles produced after VIN 40132647 and automatic transmission equipped vehicles produced after VIN 40132607 or vehicles with PCM updated to "L" calibration or later can confirm the clearing procedure was performed. If procedure was successful, the oil pressure gauge needle will move to right of center slightly (nearer H).
Vehicles produced prior to these VIN's or vehicles without "L" calibration do not have an indicator to confirm the clearing procedure was performed.
3. Drive vehicle and confirm misfire related DTCs are not stored.
NOTE:
If the malfunction cannot be corrected even though the procedure was successful, the eccentric shaft position plate may be damaged. Inspect the eccentric shaft position plate. Refer to MS3 online instructions or Workshop Manual section 01-40 ECCENTRIC SHAFT POSITION PLATE INSPECTION and repair as necessary.
2009-2011 Method
1. Record customer radio station presets (FM1/2, AM, SAT).
2. Disconnect negative battery cable for a minimum of 1 minute.
With negative battery cable disconnected, depress and release brake pedal one time.
3. Reconnect negative battery cable.
4. If equipped with DSC, perform the STEERING ANGLE SENSOR INITIALIZATION PROCEDURE located in MS3 online instructions or Workshop Manual section 04-15.
5. Input customer radio station presets.
6. Initialize power windows. Refer to MS3 online instructions or Workshop Manual section 09-12 POWER WINDOW INITIALIZATION PROCEDURE.
KAM (Keep Alive Memory)
Keep alive memory is not named because it keeps the car alive, rather it's named after the way it works. When you remove the battery terminals from the battery you'd assume all power in the car is lost right, hell your clock resets so the PCM must too, right? WRONG. KAM is saved by "Keep Alive" power, reserve battery power if you will.
KAM generally doesn't store very important stuff, other then the airbag operating on KA power they dont store anything in the KAM tho they just use the same reserve power. The main thing KAM stores are things like fuel trims etc. It's useful to reset KAM when you have lean/rich codes where the fuel trims have been able to reach 25%. It takes a while even after repair for the fuel trims to go back to proper levels, if you clear the KAM it will reset them to 0%.
How do you reset KAM?
Two easy ways, disconnect the battery and leave it like that for at least 10 minutes, sometimes longer. To expedite the process disconnect the battery and hold down the brake pedal, itll drain the KA power quicker. This will allow all codes to clear and KAM to clear.
After some research, at this time, it seems pulling the Room Fuse on the interior fusebox will also clear only the KAM. Not 100% sure yet, but pretty close.
NVRAM is a rather unique feature. The system memorizes the profile of the eccentric shaft plate on the e-shaft pulley. It basically knows how the e-shaft spins, on an individual basis, 2 cars NVRAM will generally never be absolutely identical, they're pretty close to unique.
As you'd imagine with such a specialized system you wouldn't want this information relearned and forgotten very easily, relearning the profile isn't a short process (drive cycle, dont worry you dont do anything special to relearn it). So this info is kept in a special area of the PCM it CANNOT be cleared in any way EXCEPT the proper procedure, you could disconnect the battery and do a jig for a year and it won't erase.
When/Why should you erase the NVRAM?
Realistically there are only a few times, generally the only times it's really needed is when replacing a motor since you'll be installing a new e-shaft position plate. Sometimes you'll also repair a misfire, yet the misfire code will return even with you not noticing anything, in those cases clearing the NVRAM will sometimes help. Also during PCM replacement it's good to clear it.
How do you reset NVRAM?
Here it is straight from mazda:
2004-2008 Method
1. Turn ignition switch to "ON" position, but do not start engine.
2. Pump the brake pedal at least 20 times within 8 seconds after the ignition switch is turned ON.
NOTE:
Manual transmission equipped vehicles produced after VIN 40132647 and automatic transmission equipped vehicles produced after VIN 40132607 or vehicles with PCM updated to "L" calibration or later can confirm the clearing procedure was performed. If procedure was successful, the oil pressure gauge needle will move to right of center slightly (nearer H).
Vehicles produced prior to these VIN's or vehicles without "L" calibration do not have an indicator to confirm the clearing procedure was performed.
3. Drive vehicle and confirm misfire related DTCs are not stored.
NOTE:
If the malfunction cannot be corrected even though the procedure was successful, the eccentric shaft position plate may be damaged. Inspect the eccentric shaft position plate. Refer to MS3 online instructions or Workshop Manual section 01-40 ECCENTRIC SHAFT POSITION PLATE INSPECTION and repair as necessary.
2009-2011 Method
1. Record customer radio station presets (FM1/2, AM, SAT).
2. Disconnect negative battery cable for a minimum of 1 minute.
With negative battery cable disconnected, depress and release brake pedal one time.
3. Reconnect negative battery cable.
4. If equipped with DSC, perform the STEERING ANGLE SENSOR INITIALIZATION PROCEDURE located in MS3 online instructions or Workshop Manual section 04-15.
5. Input customer radio station presets.
6. Initialize power windows. Refer to MS3 online instructions or Workshop Manual section 09-12 POWER WINDOW INITIALIZATION PROCEDURE.
KAM (Keep Alive Memory)
Keep alive memory is not named because it keeps the car alive, rather it's named after the way it works. When you remove the battery terminals from the battery you'd assume all power in the car is lost right, hell your clock resets so the PCM must too, right? WRONG. KAM is saved by "Keep Alive" power, reserve battery power if you will.
KAM generally doesn't store very important stuff, other then the airbag operating on KA power they dont store anything in the KAM tho they just use the same reserve power. The main thing KAM stores are things like fuel trims etc. It's useful to reset KAM when you have lean/rich codes where the fuel trims have been able to reach 25%. It takes a while even after repair for the fuel trims to go back to proper levels, if you clear the KAM it will reset them to 0%.
How do you reset KAM?
Two easy ways, disconnect the battery and leave it like that for at least 10 minutes, sometimes longer. To expedite the process disconnect the battery and hold down the brake pedal, itll drain the KA power quicker. This will allow all codes to clear and KAM to clear.
After some research, at this time, it seems pulling the Room Fuse on the interior fusebox will also clear only the KAM. Not 100% sure yet, but pretty close.