Avionics Software

Avionics software acts as a conductor for space missions. It sets out on a celestial adventure by combining hardware and software components in a seamless manner. Avionics software guarantees accurate control, dependable communication, and strong error correction, opening up a wide range of opportunities in space exploration. The software manages everything from microcontroller specs to real-time operating systems. Keep reading to find out more about avionics software and how it works in detail. 

How Does Avionics Software Work?

Avionics software uses an Atmel SAMD21J18A microcontroller and the EQUiSat real-time operating system. Find out more details in the section below.

Atmel SAMD21J18A microcontroller

The key specifications for the Atmel SAMD21J18A microcontroller are as follows:

  • ARM Cortex-M0+ CPU running at up to 48MHz
  • 256KB in-system self-programmable Flash
  • 32-bit Real Time Counter (RTC)
  • One full-speed (12Mbps) USB 2.0 interface
  • Up to six Serial Communication Interfaces (SERCOM)
  • One 12-bit, 350ksps Analog-to-Digital Converter (ADC) with up to 20 channels
  • 10-bit, 350ksps Digital-to-Analog Converter (DAC)
  • Up to 52 programmable I/O pins
  • Watchdog Timer (WDT)
Avionics software explained

EQUiSat real-time operating system

EQUiSat’s software stack is based on FreeRTOS, which, as its name suggests, is a free, open source, real time operating system (RTOS) intended for use on microcontrollers.  An RTOS is especially useful in the context of our mission, as it adheres to a strict schedule, ensuring events are responded to in a timely and deterministic manner.

EQUiSat real-time operating system

Using FreeRTOS allows the different aspects of our software to be written as independent tasks that are executed according to their assigned priority. This scheme ensures that the most urgent tasks will be carried out immediately, even if a task of lower importance is already running.

Avionics Software Development Tools 

Here are some development tools that help in the design and running of Avionics software:

Atmel Studio 

EQUiSat software is developed in Atmel Studio. It is an integrated development platform for Atmel. IDP is built on top of Visual Studio and allows us to develop in C and assembly. It has a built-in debugger and allows us to easily target the SAMD21 with our builds. Atmel Studio’s integration with the Atmel microcontroller and included libraries and example projects make it the obvious choice for developing EQUiSat’s software. 

Atmel ICE 

This tool is used to programme the SAMD21 once it is soldered to the PCB using the JTAG interface. It also has an embedded debugger, which is very useful for debugging code running on the processor using Atmel Studio. 

Atmel SAMD21 Xplained Pro 

We use the Xplained Pro, a development board based on the SAMD21, to assist us with development. It has an embedded debugger, status LEDs, and exposed pins as male headers to make connecting and testing hardware peripherals much simpler.

atmel

Three Pillars of Avionics Software Operation

EQUiSat’s software is responsible for controlling much of the satellite’s operation while in orbit, from initiating the antenna deployment to flashing the LED beacon to collecting data from various onboard sensors.  The software stack can be broken up into three main pillars: data collection, data transmission, and error correction.

Data Collection

ADC

We collect data from a variety of sensors on the satellite that interface with the microcontroller using different protocols.  The magnetometer (HMC5883L) and IR sensor (MLX90614) communicate over the I2C protocol, while the temperature sensor (AD590) and photodiode (TEMD6200FX01) are read using the processor’s ADC.

Data Transmission

The microcontroller communicates with our XDL Micro radio using 3.3V UART.  The software is responsible for sending commands over serial to correctly set the radio settings (frequency, baud rate, etc.) as well as storing our collected data and sending it to the radio for transmission.

The software also listens for uplinked packets received by the radio in the event we need to send a command to kill communications or send EQUiSat into a reduced low-power mode in case of an emergency.

Error Correction

While in orbit, bit flips (i.e., a 1 changes to a 0 or vice versa) can occur as a result of cosmic radiation. The SAMD21 has 3 regions of memory that could potentially be affected by bit flips: the data memory, programme memory, and bootloader.

DATA MEMORY

The data memory (SRAM) is volatile, meaning a bit of a flip here can be fixed with a reboot.

PROGRAMME MEMORY

In the programme memory, one of the biggest risks is a bit of flipping in a return address, thus changing the value of the address. This and other similar errors in the programme code can be guarded against using a watchdog timer. This timer counts down from a specified value. If it reaches 0 before being reset to the original value, it triggers a reset of the entire system.  Therefore, inserting a call to reset the watchdog timer in the main loop of the programme (the FreeRTOS kernel in this case) will ensure that a reset takes place in the event that the programme becomes corrupted. In this case, a simple reboot wouldn’t solve the problem since the programme memory would still be corrupted. Therefore, we have modified the bootloader to load a copy of the programme memory stored in external memory, then copy it to overwrite the programme memory on the Atmel chip.  The external memory is an MRAM (MR25H10) that is not affected by the radiation in LEO.

BOOTLOADER

There is not much that can be done in the event of corruption in the bootloader, since it would require a second processor to overwrite the corrupted bootloader in the SAMD21. However, the bootloader is extremely small in size compared to the programme memory and data memory, meaning corruption is much less likely to occur here. By creating solutions for corruption in the programme memory and data memory, we have significantly reduced the size of the vulnerable region, making it very unlikely for a bit of flipping to damage the system.

Conclusion 

EQUiSat avionics software is more than simply a string of ones and zeros; it is a ballet of code that directs a small satellite as it travels through space. As the code is revealed on the open-source platform, it makes space more accessible to everyone. We encourage others to replicate and hopefully even build on our work. To help facilitate this, all of our code can be found on our GitHub repo. Feel free to ask, of course and contact us if you have any questions.

Why trust Brownspace?

At Brownspace, we write about what matters most to the audience. We do well-researched work to provide in-depth knowledge of drones. Additionally, we interview people using drones to ensure the credibility of the drones used and offer real-life user experience to our readers. 

Bwown Space Author

Hi, drone enthusiasts! Born with a natural curiosity for the skies, I developed a love for drones early in life. I began flying drones in 2017 and have since piloted some of the best drones available, such as the Yuneec Typhoon, DJI Mini, Mavic Pro, Hover Camera, and Phantom 3. With passion for drones and expertise gained over the years, I would love to share my knowledge of drones at Brownspace. Stay tuned for an insider’s perspective about drones. 

The views and opinions expressed on this website are our own and are based on our experiences. This website contains affiliate links. We only recommend products that we genuinely believe will add value to our audience. The decision to buy the product entirely depends on you.

Categories

Follow us on...