Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The MLC / Raspberry Pi is the SPI master. It exchanges data with the LLC / ATmega2560 slave. The communication is synchronous, i.e. the LLC waits for the MLC to initiate the exchange. The data exchange repeats at 50 Hz. SPI is full duplex, the input and output data are exchanged simultaneously.TODO explain CRC error checking and retransmission

In each time step (20 ms), two data packets are transmitted between the MLC and LLC, one in each direction. The data integrity is checked on both sides using the cyclic redundancy check. The LLC will acknowledge receiving a correct message from the MLC through a status bit. The MLC will repeat the transmission within a time step, until a correct message from the LLC is received and the slave's acknowledge bit is set. Thus, every transmission will be done at least twice. The MLC signals the end of the (re)transmission phase to the LLC through a separate "chip select" / "slave select" line.

https://git.rwth-aachen.de/CPM/Project/Lab/software/blob/master/vehicle_raspberry_firmware/src/spi.c

...

https://git.rwth-aachen.de/CPM/Project/Lab/software/blob/master/vehicle_atmega2560_firmware/vehicle_atmega2560_firmware/spi.c

Simulation Mode

TODOThe MLC contains a simulation of the vehicle, which replaces the LCC and SPI. The switch to the simulation mode is made at compile time. The MLC build script creates multiple variants of the MLC software, for simulation and for normal operation.