From ches@qualcomm.com Fri Aug 02 09:58:16 2002
Subject:batteries (was RE: Musical Instrument Companies that Care)
At 09:26 AM 8/2/02 -0500, you wrote:
> >Will the back up internal battery in a clone (the battery that saves the
> >settings during power-down) drain faster in a clone that is saving user
> >presets as opposed to a clone that is saving only factory settings?
>
>in computer related electronics with CMOS batteries (which I would assume
>includes clones), the function of the battery is to supply voltage to a
>circuit that retains settings (you already know this). The thing is,
>regardless of the amount of data being preserved, the current draw on the
>battery should remain the same for all practical purposes. Some of you EE
>types can certainly answer this better than I, an unschooled PC geek...
>-Deke The Geek
The short answer:
It doesn't matter. The battery will last the same length of time regardless
of whether it's preserving factory data or user data.
The long answer:
In order for a clone, PC, or other device to retain data between power
cycles, you need to have some sort of non-volatile memory device. Some
types of non-volatile memory require an external battery to preserve the
content - static RAM is probably the most common. (At Gulbransen we used
EEPROMs for non-volatile storage because no battery is required. EEPROMs
were expensive, and at the time didn't hold much data though. Newer
instruments might use FLASH ROM, which also does not require a battery.)
There are often performance limitations with ROM devices, particularly
while writing. For this, and various other reasons, battery-backed-up-RAM
remains a popular choice for preserving non-volatile memory.
So, if you've got a battery, most likely your clone is using static RAM to
preserve the contents of memory. The battery's job is to keep the memory
device powered, even when the clone is turned off or not plugged in.
Nowadays, the RAM hardly draws any current at all. Often it's less than the
battery's own self-resistance. In other words, your battery might last as
long inside the clone as it would if you'd left it in the little Duracell
blister-pack.
Now, when the software in your clone wants to save something (a preset,
say) away to non-volatile memory, along with your new preset, it will
probably also tuck a cookie away, a CRC or checksum. On most of the
products I've worked on, there's one CRC calculated over the whole contents
of non-volatile memory. When any part of non-volatile memory is updated, a
new CRC must be calculated and stored away also. The reason for the CRC?
When the software first boots up, one of the things it must do is
recalculate what the CRC should be and compare it to the CRC that's stored
in non-volatile memory. If the two are different, then Houston, we've got a
problem: the non-volatile memory is corrupt. (Or as we say in the biz, the
device has "lost its brains.") Typically, once the software sees that the
non-volatile RAM has been corrupted, clears out the RAM and resets it to
some known initial state (ie, the factory default settings). It also
recomputes the CRC/checksum and stores that away. There are fancier ways to
deal with memory corruption, but this method is fairly typical of both the
products I've developed as well as synths and such that I've used.
Whenever you write a user preset to memory, the CRC is also updated. So
that as long as the battery is good, the unit will see that the CRC matches
when it boots up and knows it can trust the contents of its non-volatile
memory. As an interesting aside, there are all kinds of special safeguards
an engineer must take before writing to non-volatile memory. Consider what
might happen if you happened to power down your clone just as something was
being written to memory. If the write operation did not finish, you'd most
likely lose your settings next time you power it back up. There are a
number of strategies to deal with this, all of which are probably far
beyond the scope of the CloneWheel group. But suffice it to say, special
care must be taken when writing to any non-volatile memory device.
Anyway, the battery in your clone doesn't "see" any of this. It simply
provides a constant power source to the non-volatile memory device, which
draws a constant amount of current regardless of what's stored. Your data,
factory default data, it's all the same to your little battery.
So stash those patches away with bravado!
Regards,
Dave