Menu

communication protocol

Victor Aldecoa Henrique de Souza Nery

This page defines the communication protocol used between the micro-controller and the central processing board.

General description

Each message starts with one byte containing the message code. That means that we could have until 256 different messages on each side (since messages from micro-controller may have the same code that messages to the micro-controller).

After the message code, it comes all the message parameters, which order depends on each message.

The possible messages currently are:

micro-controller -> central processing

Connect (no parameters):
|Description| Type | nº bytes | value (if constant)
| msg code | byte | 1 | 0x00

DataAcquired:
| msg code | byte | 1 | 0x00
| l_sensor | int16| 2 | ----
| c_sensor | int16| 2 | ----
| r_sensor | int16| 2 | ----
| distance | float| 4 | ----
| speed | float| 4 | ----
| state | char | 1 | ----
| sonar_dist| sInt | 2 | ----

central processing -> micro-controller

Accept connection:
| msg code |byte | 1 | 0x01
|meters_per_edge|float| 4 | ----

PWMs:
| msg code | byte | 1 | 0x01
| traction | byte | 1 | ----
| steering | byte | 1 | ----

State machine (seen by the micro-controller)

Communication State Machine


Related

Wiki: Home
Wiki: guimag-acquisition
Wiki: guimag-beaglemodule
Wiki: microcontrolador de aquisição de dados
Wiki: placa de processamento central

MongoDB Logo MongoDB