Bootloader

The hydrocontrol bootloader is based on the arduino mega bootloader with the following changes:

    • fixed a bug, where the sketch would sporadically not start, when coming from the watchdog restart
    • removed the waiting time, when coming from a watchdog restart

forum post about the bug and how to code the bootloader (both not needed if you use the standard hydrocontrol bootloader)

https://forum.arduino.cc/index.php?topic=378288.msg2612863#msg2612863

How to upload the bootloader

First, you need an arduino AVR ISP programmer. You can buy one. If you already have an arduino, you can use this as ISP programmer. I use an arduino. Google for help.

    1. install the arduino IDE
    2. download the hydrocontrol bootloader file from the file section direct link
    3. rename and move it to
    4. C:\Program Files (x86)\Arduino\hardware\arduino\avr\bootloaders\stk500v2\stk500boot_v2_mega2560.hex
    5. start the arduino IDE
    6. connect the PC to the programmer via usb.
    7. connect the Programmer to the hydrocontrol PCB with confectioned 6 conductor flat ribbon cable or jumper cables.
    1. menu tools / board / arduino mega
    2. menu tools / port/ select the active serial port
    3. menu tools / programmer / arduino as ISP
    4. menu tools / burn bootloader
    5. you should see the message
      1. avrdude: verifying ...
      2. avrdude: 1 bytes of lock verified
      3. avrdude done. Thank you.
    6. or similar

Verify

    1. Establish a serial connection with the FTDI232 USB serial adapter. For windows 8.1 or newer, you probably don't need to install drivers. More information:
    2. http://lab.dejaworks.com/programming-arduino-mini-pro-with-ftdi-usb-to-ttl-serial-converter/
    3. http://www.ftdichip.com/Drivers/D2XX.htm
    4. https://learn.sparkfun.com/tutorials/how-to-install-ftdi-drivers/all
    5. Make sure your FTDI adapter is set to 5V, or is suitable for 5V.
    6. menu tools / port / select the active serial port
    7. menu tools / serial monitor
    8. set a baud rate of 115 200
    9. close and reopen the serial monitor
    10. you should see BL2
    11. if the upload was successful, but nothing appears in the serial monitor, then probably the arduino IDE is using a cached version of the bootloader. Rename the hex file, and name of the bootloader in the following file
    12. C:\Program Files (x86)\Arduino\hardware\arduino\avr/boards.txt
    13. Restart the IDE.
    14. Repeat the burn bootloader process.