This repository is there to build an open-source firmware for the 60W ZPB30A1 electronic load (often sold as "60W electronic load" without any article number).
The original firmware has read out protection enabled. Therefore you can't go back to this version once you flash a different one. But this firmware aims to be much better in every possible way. If you need a feature either add it on your own and submit a pull request or open an issue and wait till I add it.
This software requires Small Device C Compiler (SDCC) version 3.8 or higher (3.7 sometimes crashes during compilation).
The datasheet of the STM8S005 claims a write endurance of only 100 flash cycles but this is only for marketing purposes as it contains the same die as the STM8S105 which is rated for 10000 cycles. So you don't have to worry about bricking your device by flashing it too often. Mine has far more than 100 cycles and still works. You can easily verify the two chips are the same as you can write the whole 1kB of EEPROM the STM8S105 has instead of only 128 bytes as claimed by the STM8S005 datasheet.
As the original firmware has the bootloader disabled you need a STLink programmer in order to unlock it. Connect it like this:
If you are programming the chip for the first time you have to unlock it. '''WARNING:''' This irreversibly deletes the original firmware.
make unlock
Then you write the new firmware with
make flash
and if you are flashing for the first time you should also clear the EEPROM:
make clear_eeprom
Contrary to the original firmware which requires rebooting to change modes this firmware is completely configurable by an integrated menu system. Push the encoder button to select an item. The "Run" button acts as a back button in most situations. Only in the top level menu it is used to enable the electronic load. The currently selected option blinks. When setting a numeric value the two LEDs between the displays show the selected digit. Values shown with a decimal point are in the unit shown by the LEDs or on the display. If no decimal point is shown it means the display shows 1/1000 of the selected unit.
While in run mode the top display show V, Ah, or Wh. The bottom display show the current. The unit in the top display switches automatically after some seconds. Rotating the encoder changes the unit manually and disables automatic switching. Pressing the encoder enters a menu to change the current setpoint without exiting run mode.
This firmware started as a project to extend the firmware written by soundstorm but it turned out as an almost complete rewrite which keeps the user interface idea.
Schematic can be found in [hardware/schematic.pdf].