GenBoard/BackupPower (2004-11-22 11:46:52)

BackupPower - only for developers

The name of the page is misleading, it should be data-integrity, consistent-write or something... Controlled power supply is only one solution.

About the Issue

If the power is removed when the ECU writes to internal EEPROM, the data can be corrupted.

This is not currently a problem since we only write to EEPROM when the laptop is connected:

In the future we might want to write data to EEPROM now and then automatically - only makes sense for learnt values. Note that logging will go to MMC flash and self-learning can also go to MMC flash. Logging into MMC will apply error detection anyway.

Possible HW solution

Possible SW solutions


more on the hardware solutions

Most of the time we only need 0.1 seconds of backup power, but if we want to update 1024 bytes of tables from SRAM to EEPROM on shutdown the worst case scenario is 9 seconds!

But this number is meaningless:

Also, this assumes that 25% of AVR SRAM is used for such late-write (learnt) data (512 bytes of learnt data is probably more realistic. Many ECM's run on only 180 bytes of data altogether, 0 bytes of which is learnt).


ways to solve this:

A backup capacitor is a good way. In that case we only need to add the capacitor to +12v (the supply signal) and read the voltage on the +13.8v signal to know when to stop writing. We can also fit a supercap or similar capacitor to the VCC supply. We need to minimize power draw from these lines very quickly after the power is lost. The supercap capacitors is limited to 10mA current draw, a 1A version is also available but that is three to four times more expensive for the same capacitance (1F). If a +12v capacitor is used we need to limit draw since it is much lower capacitance then the supercap. If we could limit current draw to 10mA during the write we have 50seconds of backup power on a 1F supercap. Temp range can be a problem with the capacitor solution, the supercap is -25 to 70C. The capacitor solution will also protect against intermittent power connection and low battery while cranking.

An other way it to use a constant power line, this works well unless someone disconnect the battery at the wrong time. This is common on race cars where an external battery disconnect is specified in the rules, some people use this as a kill switch.


Supply links