Multipoint protocol

master-slave operation, eg commands are sent to a device and the reply goes back to the sender

multiple nodes on one bus

multiple masters

protected data packets

Thus the datapackets were defined as :

field

value

meaning

1

SYN (0x16)

required, as the 1st startbit is missing

2

STX (0x02)

start of message

3

LEN

length of the packet including STX & CRC

4

SRC

ID of the sender

5

DST

ID of the reciever

6

Msg

message byte

7

[data]

optional data field

8

CRCHi

high byte of CRC16

9

CRCLo

low byte of CRC16

Each node listens to all packets and processes those adressed to itself. If
broadcasting is required, the ID 0xFF may be reserved for broadcasts. The receiver
interrupt is a state machine :

state

0

idle, wait for STX

1

get LEN

2

count down

3

msg received

The main program polls for state 3. Then checks the CRC. If the CRC is wrong,
the packet is discarded. If the CRC is correct, it then checks the ID and processes
the packet in case the ID matches. The ID check and the CRC check may be exchanged,
that may save some CPU time.

The mentioned packet format and its processing enable a save transmission on
a multipoint bus system.

The next layer

A normal device, meaning a slave, sends only one or more packets when requested
from the master to do so. If there is a reply to every packet, the master is
able to detect a missing packet.

Required strategies :

a wire may become disconnected

a bit error appears as missing packet

a packet may become lost to the device or from the device

If there are multiple masters, some administration has to be added.

Choices :

masters with equal rights

embedded master and an occasional PC takes over

Usually a token is passed between the masters. Only the master with the token
is the master of the bus at the current time. This means the master have to
know each other, by a fixed ID or some other mechanism. What happens when token
becomes lost ? A token recovery scheme has to be implemented.

When the network configuration is allowed to change over time, the network
has to be polled from time to time, not to detect missing devices, but to find
newly connected devices.

When there are more devices than ID's to be dynamically connected, a dynamic
ID scheme has to be implemented.