![Arrow :arrow:](./images/smilies/icon_arrow.gif)
This is the way it is supposed to works. Nothing get lost while activating idle mode. However, developing without idle mode is advise, and then test should be done with power save mode (idle activated) activated.
A specific peripheral (its name is Low Voltage Detection (LVD)) but it is not implemented yet on the blockset.
The problem that may appears with solution you propose: going into sleep mode using C call: All peripheral are configured to works, or Wake up the core, during the sleep mode. Thus, you will not get a very long sleep. Anyway, if reconfiguring bits in peripheral to make them not workable during sleep, dans also disabling all interrupts, it may be possible to get a deep sleep mode.
![Arrow :arrow:](./images/smilies/icon_arrow.gif)
For Li-ion or Li-Po power cells, the best practice is to use a small circuit close to the battery that cut off battery power when voltage is lower than a predetermined threshold. Difficulties may appear when motor are driven from theses Li-Po/Li-ion cellules as a current peak may appears at motors start that may activate the cut-off circuit (this one is re-enabled automatically as soon as battery is charged, even for very short time (1s) ) . This way makes battery well protected but you must beware of current drain by rapid motor consign changes (an interesting constraint for control model) . If only electronics is driven, there should be no problems.
During prototyping process, I usually get my Li-Po / Li-ion cells getting fat. Reason is either I draw too much current when cells drives motors. On electronics parts, the drop down of Li-po cells is very fast ad end of charge. Thus, the microcontroller stop working quite suddenly thus, I disconnect my li-po as soon as I see it.
Of course, that is not the way to do for commercial products…
Lubin