-
The Past and the Future
01/04/2017 at 16:05 • 0 commentsThe current firmware is written in C, compiling it optimized for size leads to a 902 byte binary. It uses 20 different characters from the LCD which adds another 100 byte of data. The total size is thus 1002 bytes.
I could reduce the size of the binary by using a custom startup code, here and there a little optimization. But I don't think I'll get it much smaller that way.
So I started writing a version completely in assembler. It has around 520 bytes now. But it also has a number of bugs and I got distracted a bit too often to finish it on time.
Here is a list of features I want to add but they will probably not fit into 1kB:
- Sleep mode: Turn off all hardware and go to sleep after a period of no activity.
- Wake-up: A way to wake up from the sleep mode would be very nice, no? Possible options: Button, periodic checks, a low power circuit which triggers on weight changes
- Serial port: Sending the measurements to a computer.
- Users: The ability to choose a user name for the measurement.
- EEPROM: Store one or more previous measurements and maybe show a trend.
- Calibration: A way to calibrate the scale, either using display and buttons or over the serial port.
- Tara: A button or serial command to set the scale to zero.
I hope I find time to implement a few of these ideas.