1 Protocol for sending measurements via UART
Robert edytuje tę stronę 2021-07-25 20:14:40 +02:00
This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

Purpose

To ensure data integrity sent from the ionization chamber device to computer, a simple protocol was added to encapsulate each data/command send.

Protocol details

The field “msg length” describes amount of bytes the “data” section has.

Definition of the message:

architecture

Content of data section in above message is an example and can be different depends on message id, but now only one message is supported and it is as shown above.

Defined message ids and message content

  • Msg id: 1 - data from last analog measurement of actual value.
  • Msg data section:
  • ADC configuration
  • MSB (most significant byte) from ADC
  • LSB (least significant byte) from ADC

CRC

CRC is calculated xoring all bytes in data section.