# Micro-Satellite Systems Design, Integration, and Flight
## 3 ChipSat RTOS and RF Development
### Implementing RF Communications on TI Launchpad Using CCS  
The next goal was to achieve communication between two ChipSats using radio frequency (RF). Code Composer Studio (CCS) was the tool used to program the RF tasks. The Alpha mission only required transmissions, but both transmissions and receptions were performed on the ChipSats. A TI-RTOS program had already been developed by Dr. [PERSON] [14] for his \"Monarch\" PCB boards as part of his thesis work. The program included the use of an IMU, a GPS, an analog-to-digital converter (ADC), and radio communication (RF). However, for RF development, only RF tasks were needed. Dr. [PERSON] [15] code was the basis for the new test code. The code had a main script that ran two task scripts: receiving and transmitting. However, the new code needed to change the way the semaphores were posted and pended. The previous code had the semaphores posted and pended in different places in the different tasks depending on the expected execution order. Having only two tasks resulted in a semaphore imbalance. After one transmission, the channel was locked forever. The problem was fixed, and the semaphores were reorganized to append at the beginning of the task and post after finishing the task. The code worked well for both transmission and reception between each of the two TI launchpads. However, the transmissions were set up to send the raw modulated data without any error correction or filtering. The next section will explain the theory behind the modulation used. The modulation was coded using the EasyLink APIs available in Code Composer Studio. Non-blocking calls were selected so that the packets would be sent without waiting for a confirmation from the receiver. Also, a clear channel checker was added to make sure that the transmitter would only send if the chosen channel was free (not occupied). The following basic sequence is used to send a packet from the launchpad:  
\[\text{EasyLink\_setRffPower(14)};\] \[\text{EasyLink\_setFrequency(915000000)};\] \[\text{EasyLink\_transmitCCaAsync(&txPacket, lbtDoneCb)};\]  
Here, the packet name is txPacket, and the TX done function pointer is lbtDoneCb. The power of the transmission is 14 dBm at 915 MHz. These packets can then be received in the RX tasks with the following API:  
Figure 14: TI-RTOS semaphore APIs. Figure 13: Semaphore process flow. EasyLink_receiveAsync(rxDoneCb, 0);  
Async was also used on the receiver to make sure the function was also non-blocking. The zero represents the relative start time of the receiver. The APIs used above were able to be programed, with help from the EasyLink API guide [35]. RF Signal Modulation with Gaussian Frequency Shift Keying (GFSK)  
The modulation technique used on the ChipSats is frequency shift keying (FSK). The FSK technique was determined by requirement 3.0 (see Table 4). In frequency shift keying, data are sent through a discrete change in the carrier signal frequency, with no effect on the signal power. ChipSats, therefore, use the maximum power available to them to transmit data. The data sent by the ChipSats are coded in binary. With binary frequency shift keying, the carrier signal oscillates between a high and low frequency. The high frequency represents a 1, and the low represents a 0. Figure 15 is an example of an 8-bit carrier signal. BFSK is an effective method for the ChipSats because this frequency modulation produces a good signal-to-noise ratio in this instantiation, it has a smaller risk of interference, and the signal power radiates less (it is relatively unidirectional). However, frequency modulation can be expensive. Having to shift frequency (theoretically) instantaneously is straining on the transmitter. It requires costly, powerful, bulky electronic equipment, all of which are unaffordable for a ChipSat. To resolve this issue, the ChipSats use a transmitter that implements Gaussian frequency shift keying (GFSK). The receiver measures the period of change in the incoming signal.