Skip to content

Firmware

Wiring

Connect the Arduino Nano to the USBASP programmer. (ArduinoISP has not been tested with the existing platformio.ini sections and may require manual configuration.)

img

img

Note: Pinout may differ on some connectors.

img

Compilation and Flashing

configuration.h

:arrow_forward: Configure your firmware in the configuration.h file.

Compilation errors

If you encounter memory size mismatch errors during compilation, run: pio update pio pkg update

Select Number of Scale Modules

#define SCALES_MODULE_NUM 2
#define SCALES_MODULE_NUM 3
#define SCALES_MODULE_NUM 4

1. Flashing MiniCore Bootloader

You’ll need a USBASP programmer.

2.1 Fuse Configuration

pio run -e fuses -t fuses
pio run -e fuses -t fuses

2.2 Flash EEPROM

pio run -e EEP -t uploadeep
pio run -e EEPPB -t uploadeep

Flashing the Microcontroller

pio run -e EEP -t upload
pio run -e EEPPB -t upload

Autopid Calibration (Optional)

Performed in two steps:

Edit configuration.h:

#define AUTOPID_RUN 1
#define SCALES_MODULE_NUM X (X = number of scale modules)

Then flash the firmware (step 2.3). PID calibration will begin automatically. Once completed, the screen will display "Flash Part 2". Now set:

#define AUTOPID_RUN 0

Then reflash (step 2.3).

Fan Test Firmware (Optional)

In configuration.h, uncomment:

// #define PWM_TEST

Then flash (step 2.3).

The fan will cycle through all supported PWM frequencies with 100-10% duty cycles. Once complete, choose the desired frequency:

#define PWM_11_FREQUENCY

Then comment out:

#define PWM_TEST

And reflash (step 2.3).

Startup Errors

If errors occur during startup or runtime, refer to configuration.h.

Tutorial Video

Join Telegram Group :fontawesome-solid-paper-plane:

Contribute :material-file-edit: