- Computer connected to MTB-USB is turned on. MTB-USB module is turned on, because it is powered from computer's USB. MTB-USB module starts scanning bus.
- Slave modules are powered on. MTB-USB modules detects them. Slave modules load their configuration from EEPROM, thus they communicate in right bus speed. Slave modules put their outputs to save state (save state is part of modules configuration and thus loaded from volatile memory).
- MTB daemon on PC starts. It connects to MTB-USB, reads its firmware and protocol version etc.
- MTB daemon asks MTB-USB for list of active modules. MTB-USB sends the list to the daemon.
- Demon configures modules based on its configuration stored in PC.
- Model railway control SW connects to daemon, asks for state of inputs, starts settings output.
- Input changed are reported to MTB-USB, MTB daemon and railway control software.
- Railway control software disconnects, MTB daemon sends Reset Outputs for modules controlled by the railway control software.
It does not matter on order of computer, MTB-USB and slave-modules powering on. Each time MTB daemon finally detects all modules.
When some slave modules stop responding, MTB-USB notices this situation and informs MTB daemon about it.
MTB-USB periodically scans all (even non-present) bus addresses. Thus it finds new modules. new module is reported to MTB daemon. MTB daemon configures the new module and reports information about new module to railroad control software.
Any slave module could be hot-swapped when bus is fully running.
Modules could be readdressed while bus is running. MTB-USB simply detects old address missing and new address appearing.
Speed must be changed either directly on slave module (reprogramming, button press etc.) or MTB daemon must set communication to different speed, find misconfigured module, instruct it to change speed and change bus speed back.
All slave modules could be upgraded directly over MTBbus. While upgrading, other communication over bus is advised to be stopped.
Upgrade procedure for single module in as follows (M = master = MTB-USB, S = slave):
- M>S: Firmware Upgrade Request.
- Response S>M: ACK, slave reboots to bootloader.
- M>S: Module Information Request.
- Response S>M: Module information – module is in bootloader.
- M>S: Firmware Write Flash: address, 64 bytes of data.
- Response S>M: ACK.
- Slave starts writing flash.
- M>S: Firmware Write Flash Status Request
- S>M: Firmware Write Status: writing flash / flash written / error.
- M>S Reboot.
- Slave checks checksum of flash at boot.