Communication

The Charger has a simple communication interface on the SPI bus. It understands two commands: One command is "SetCharging" and it configures maximum current, maximum voltage and timeout. The other command is "ChargerRead". This command to the Charger reads the voltage and current seen from the ATtiny861. (Refer to section COMMAND to/from Charger for more information about the communication.)

If it receives any other command, doesn't get all parameters, or notices a checksum error it will just discard the message.

The implementation is based on the BC100 reference design and application note AVR458. Refer to this application note for more information about charging Li-Ion batteries.