Payload Motor Board Firmware Design Specification

Warning

This is just a template, this is NOT a completed design doc, delete this line when the firmware specification is complete

Overview

Give an overview what does the firmware do, example:

Injector Sensor Hub firmware periodic reads analog sensors and report analog data to CAN, analog sensors includes pressure transducers and hall effect sensors.

Reference Documents

List of reference documents (e.g. link to hardware Datasheets), example:

Note if the firmware involves data storage or transmission(e.g. Logger SD card log, telemetry packet format), then a separate rst need to be created in the same directory, to describe data format(see Logger Data Specification for example)

Initialization

Describe step-by-step initialization sequence, example:

  1. Use setup using external oscillator, with 4xPLL

  2. Setup PPS(Peripheral Pin Select) for all peripherals

  3. Initialize ADC, setup to use FVR(Fixed Voltage Reference)

  4. Setup CAN module

Runtime

Heart Beat

Red LED shall toggle every 500ms.

Health Check

Describe what health check need to be performed, example:

  • Firmware shall check 12V input voltage every 500ms, and report voltage with SENSOR_ANALOG.SENSOR_12V_VOLT CAN message, if the voltage is below 11.5V or above 12.7V, the firmware shall signal error with GENERAL_BOARD_STATUS CAN message.

Sensor Reading

Describe what sensor shall be read and report to CAN bus, example:

CAN Communication

CAN Message Sent by Firmware

CAN Message Sent by Firmware

Message Type

Description

Period

SENSOR_ANALOG.PRESSURE_OX

Report oxidizer tank pressure

10ms

CAN Message Handled by Firmware

CAN Message Handled by Firmware

Message Type

Description

RESET_CMD

Reset board if targeted(check with check_board_need_reset function in canlib)

GENERAL_BOARD_STATUS board specific error field usage

GENERAL_BOARD_STATUS board_error_bitfield Bit definition

Bitfield Name

Description

Offset

PT_OUT_OF_RANGE

4-20 mA Pressure transducer signals less that 4mA or more than 20mA

0

Mathematics Model

Describe common used math equations in the firmware, if the equation is more than one line, then a link to a Matlab model should be provided.

Convert pressure transducer ADC pin voltage input to pressure

Insert formula here