MRBus-Computer Interface 2.0 (USB) MRBus-CI2

The MRBus-Computer Interface 2.0 (USB) connects your MRBus network to a computer via USB, using an FTDI TTL-232R-5V-WE serial-to-USB converter and letting it do all the nasty USB protocol stuff. It is based on an AVR ATmega128 or ATmega162, which feature two serial interfaces, and talks raw MRBus packets overlayed by the SLIP protocol. It's primarily intended for fast bridging of two MRBus networks, or connecting a PC software to the bus, and thus does not include an ASCII hex mode; although it should be easy to merge those routines from Nathan Holmes's MRB-CI interface into this code here.

The baud rate is 115200, hardware handshaking (RTS#/CTS#) is supported, and character format is 8-N-1. When sending a packet to the interface, the following must be considered:

  • the SLIP protocol must be followed;
  • a full MRBus packet with a minimum size of six bytes must be sent, including PKT_LEN and two CRC bytes (can be dummies);
  • PKT_LEN of the contained MRBus packet is checked against the number of bytes received by the SLIP handler.

The interface recalculates the CRC checksum bytes before sending the packet onto the bus, so applications that are not able to calculate the checksum can send dummy bytes.

Instead of the ATmega128, an ATmega162 can be used. It also has two USARTs, but has the advantage of being available in a 40-pin DIP package. See the two different schematics and source code zip files below.

The following PC-side applications are available:

  • Interface program: talks to the MRBus interface and provides a TCP/IP socket (either as server or client)
  • Terminal program: allows to receive and send MRBus packets in Hex mode, connects to the Interface program via TCP/IP (either as server or client), not yet available.

TCP/IP connections make it possible

  • to connect to an MRBus installation from any place of the world via internet
  • to forward data to multiple clients (hub)
  • to bridge two MRBus networks, e.g. layout and dispatcher console via WLAN

and do this either as a client or server. This is very useful if one user is beind a firewall and doesn't know how to open an inbound TCP port. In this case, server and client functions can be flipped.


Documentation and Source Code

Schematics

ATmega128 (TQFP)[download]
ATmega162 (DIL-40)[download]


Source code

ATmega128 zip file[download]
ATmega162 (DIP-40) zip file[download]


PC software

TDisp-SLIP interface for MRBus-CI2[download]