PIC Firmware

Firmware Update

On the PIC, there is a bootloader that allows to update the firmware via the USB port or the Raspberry Pi GPIO/ttyAMA0.

Either the [ebus PIC Loader] (https://github.com/john30/ebusd/blob/master/src/tools/README.md) is needed which also allows setting a fixed IP address for the W5500 of the USR-ES1 module, or the [Bootloader Host Application] (https://www.microchip.com/promo/8-bit-bootloader) from Microchip.

To update the firmware, the adapter has to be configured to USB or Raspberry Pi variant: the Wemos D1 mini / USR-ES1 module have to be removed and the jumpers J1 and J4 set correctly, see here.

To activate the bootloader, pins 3 and 4 on jumper J11 have to be short cut before supplying power.

When the bootloader is active, the blue LED lights up immediately very brightly (more than all others), see here.

The firmware is then flashed by using one of the above tools via the serial interface with 115200 baud from word address 0x400.

With the ebus PIC Loader it works like this (where / dev / ttyUSB0 may have to be replaced by the actual USB serial device): ebuspicloader -f firmware.hex /dev/ttyUSB0

Firmware Versions

Important note: The pins on J12 must never be connected to any pin on the other jumpers/pin headers/sockets as separate power sources are used here. Any connection endangers the adapter and devices on the eBUS!

Ethernet Configuration

If a fixed IP address is supposed to be used with the USR-ES1 module instead of obtaining it via DHCP, this can be done with the ebus PIC Loader via the USB connection or the Raspberry Pi GPIO/ttyAMA0.

For example, to set the IP address 192.168.10.20 with a network mask of 255.255.255.0 (=length 24), the ebus PIC Loader is called as follows (where /dev/ttyUSB0 may have to be replaced by the actual USB serial device): ebuspicloader -i 192.168.10.20 -m 24 /dev/ttyUSB0

LED

The blue LED is used to signal states from the PIC firmware. In general, the bootloader and normal modes are quite different.

LED in Bootloader

If the LED lights up permanently very brightly (more than all others) immediately after supplying power, the PIC is in bootloader mode and is waiting for commands on the serial interface.

LED in normal operation (without Ethernet)

In normal operation, the blue LED is initially turned off after supplying power.

LED in Ethernet operation

If the Ethernet module is plugged in and the jumper J12 is set accordingly, the blue LED has other meanings in addition to the ones described above, which are run through in the following stages:

  1. Until the W5500 of the USR-ES1 module responds after the reset, the LED flashes (2x per second).
  2. Until a link is found on the line, the LED flashes very quickly (20x per second).
  3. In case of DHCP, the LED flashes quickly (4x per second) until an IP address has been negotiated via DHCP.