Knowing how it works may help you figure it out. The radio uses 2 types of power, "Switched Power" power that is controlled by the ignition switch and "Constant Power", power that is constant and never stops.
When the switched power gets turned on and off, the radio turns on and off.
Switched power is usually used to maintain memory (presets) and also lets the radio know when it may have been removed from the car (constant power would not be present). This signals the radio to request a code so it can verify that it still belongs to you.
I would start by verifying that the radio power connector is properly connected to the radio, in my 98 Z3 the power connector is very hard to remove, it has a safety cover that locks it onto the radio and even with that removed the plug itself is difficult to pull off.
Next I would probe the harness for the constant power connection (Sorry don't have color code handy), identify that main constant power wire and then monitor it with a test light or voltmeter while you move the harness around, check the wires for nicks and shorts.
What you are looking for is anything that would cause the radio to loose that constant power, even for a second. A bad wire, connector or short could cause a temporary loss of power and this would trigger your problem.
We cant overlook that this could also be a bad connection or cold solder joint in the radio itself, that being a different fix off course.
One more item that could cause this would be an intermittent ground, this would also cause power to drop out and similar symptoms.
Hope that helps.
Last edited by rudyrov; 08-14-2012 at 08:24 AM.