Skip to content

Beacon Software

Gabriel Mariano Marcelino edited this page May 16, 2019 · 26 revisions

The beacon software is responsible to transmit periodic beacon signals, containing the satellite identification and a basic telemetry data.

To achieve it, this software communicates with other modules of the satellite (to acquire data to transmit in the beacon packets), controls the beacon's radio module and its antenna module.

It's written in C, using the Code Composer Studio IDE (Version 7.4.0). The radio module (Si4463 IC) is configured using the WDS (Version 3.2.11), a step-by-step tutorial is available here.

Dependencies

The beacon software is dependent of the following libraries:

  • NGHam: Used to generate and interpret the NGHam protocol packets (This library was modified for this firmware).
  • DriverLib: Used to handle the internal peripherals of the MSP430F6659 uC.

Software Layers

The image below describes the software layers of the beacon system.

It is composed by five layers:

  • Hardware layer: All the TTC hardware (MSP430F6659 and the RF4463F30).
  • Drivers layer: The software to make the interface with the hardware (Internal peripherals of the uC, the radio module and the antenna module).
  • System layer: General usage functions and resources of the beacon system (like data structures, power management, etc.).
  • Application layer: The main beacon software, where all the tasks were implemented.

Flowcharts

Main

Initialization

Watchdog

The watchdog is initialized using the ACLK as clock source and a 512k clock divider (generating a 16 second watchdog). The counter starts right after the initialization.

CPU

For the CPU configuration, the core voltage is setted to level 2 (required for a clock between 12 and 20 MHz). The DCO FLL reference is setted to REF0 (with the clock divider equal to 1). The ACLK clock is setted to be equal to REF0 (same as DCO, clock divider equal to 1). The SMCLK reference is setted to be the DCO, but with a divider factor equal to 4.

So, the final configuration is: MCLK = 16 MHz, SMCLK = 4 MHz and ACLK = 32,768 kHz.

Memory

NOTE: Under development.

Time

During the time initialization, the last value stored in the memory is loaded and the counter continues from it value, preventing the lost of time reference after a system reboot or fault.

Timer

For the system time, a 1 second timer is used (using the timer interruption to increment a second counter variable, 32-bit unsigned integer). This counting starts from the last value stored into the memory.

Antenna

NOTE: Under development.

EPS Communication Bus

The EPS communication bus (UART) is configured at a transfer rate of 4800 bps, no parity bit, LSB first and one stop bit. The clock source of this UART bus is the SMCLK. The EPS queue is also initialized.

OBDH Communication Bus

The same occurs for the OBDH communication bus (SPI): the transfer rate is 2400 bps and the endianness is MSB first. The OBDH queue is also initialized.

Radio

During the initialization of the radio, it is reseted and all the configuration parameters are transfered to the radio module. More informations about this process can be found in the radio IC documentation.

RF Protocols

The NGHam, AX.25 and the FSP protocols also need an initialization, to set internal variables and counters.

OBDH Communication ISR

The flowchart of the interruption service routine (ISR) of the OBDH communication can be seen below. Basically, when a new byte arrives, it is pushed to a queue (if it isn't full), and periodically, the OBDH communication task process these new bytes (taking out the bytes from the queue).

EPS Communication ISR

The flowchart of the interruption service routine (ISR) of the EPS communication can be seen below. It's operation is equal to the OBDH communication ISR.

Operation Modes

There are three operation modes in the beacon software:

  • DEBUG MODE: In this mode, the operation of the beacon is described through an UART port. At every operation, a message describing what is happening is transmitted to the debug UART port.
  • TEST MODE: In this mode, the antenna deployment routines are not executed. This is the main mode to use during the satellite integration tests.
  • FLIGHT MODE: This is the mode to use in flight, with all the available resources enabled.

The selection of the operation mode can be done using the "BEACON_MODE" variable in the "config.h" file.

Packets Payload

In the normal satellite operation, the beacon packets contains the following data:

Information Length (Bytes)
Packet ID code: 0x00 (NGHam packet) or 0x03 (AX.25 packet) 1
Satellite callsign: "0PY0EFS" 7
Batteries voltages 4
Batteries tempearatures 6
Total charge of batteries 2
Solar panels currents 12
Solar panels voltages 6
Overall status of the satellite 2
Accelerometer and gyroscope 12
Time since boot 4
Number of OBDH module resets since launch 2

If a fault on the OBDH module occurs, only the EPS data are transmitted:

Information Length (Bytes)
Packet ID code: 0x01 (NGHam packet) or 0x04 (AX.25 packet) 1
Satellite callsign: "0PY0EFS" 7
Batteries voltages 4
Batteries tempearatures 6
Total charge of batteries 2
Solar panels currents 12
Solar panels voltages 6
Energy level 1

If a fault occurs in the OBDH and the EPS modules, only the satellite ID is transmitted:

Information Length (Bytes)
Packet ID code: 0x02 (NGHam packet) or 0x05 (AX.25 packet) 1
Satellite callsign: "0PY0EFS" 7
Satellite ID: "FLORIPASAT" 10

The decodification of the packets data are done automatically by the GRS software, but if you want to do it manually, you can use these equations.

USCI Configuration

The table below, briefly list all the used USCI interfaces from the uC.

MSP Interface Mode Connected Components
USCI_A0 UART RX EPS Bus
USCI_A0 UART TX Packets transmission (Only for tests)
USCI_A1 UART TX/RX Debug
USCI_A2 SPI Slave OBDH Bus
USCI_B0 SPI Master Beacon Transceiver
USCI_B2 I2C Master Antenna Bus

Timers

Only one timer from the uC is used: It is used as the internal time reference.

Timer Interface Mode Period Function
TIMER_A1 Continuous-Compare 1 s Time control

Clone this wiki locally