scieee AI-readable full text Open interactive document viewer

Low Speed Telemetry Link System for CubeSat

Adyl Fidalgo Jammoue, Daniel

Abstract

The main purpose of this project is developing a multidisciplinary Simulation Platform for CubeSats. It will be composed of three differentiated blocks, around which the project is structured: a mechanical simulation platform, a management software and a prototype that will be the base for the future GranaSAT-I. This Master’s Thesis is addressed from a double perspective: on the one hand, the development of a Simulation Platform of great usefulness in an academic environment, as a way to get students from multiple degrees closer to the aerospace world, and particularly to CubeSats, given its current context of peak, being fostered by institutions such as European Space Agency (); on the other hand, in a research environment, providing with a mean to implement new communication algorithms, orbit controllers, and generally speaking, for the development and test of new technologies and techniques, before launching. The development and implementation of this project is performed following methodologies of System Engineering contrasted in the aerospace industry, giving realism and getting the student closer to professional techniques, widely recognized in the job market. Furthermore, the complexity and multidisciplinary scope of this Master’s Thesis allows covering not only the different specialties of the Master in Telecommunication Engineering but also acquiring knowledge and transversal abilities from other fields of the Engineering, such as Mechanical or Aerospace. Besides specific software of each of the mentioned areas, advanced techniques of machining (aluminum milling), manufacturing (solder reflow) or characterization of different devices (lithium batteries, silicon solar cells...) among others, have been analyzed and applied. The result of the exposed culminates with the obtention of a complete and functional simulation environment, which complies with the requirements defined in the preliminary stages, and supposes the finalization of the Master.

Full text

TELECOMMUNICATION ENGINEERING Low Speed Telemetry Link System for CubeSat Daniel Adyl Fidalgo Jammoue Bachelor's Degree in Telecommunication Technology and Engineering Low Speed Telemetry Link System for CubeSat 2019/2020 Daniel Adyl Fidalgo Jammoue Tutor: Andrés María Roldán Aranda BACHELOR'S THESIS AQUI FALTA INTRO Daniel Adyl Fidalgo Jammoue is an engineering student from Granada, Spain. He finished his Bachelor's Degree in 2020, within the speciality of Communication Systems. Andrés María Roldán Aranda is the academic head of the present project, and the student's tutor. He is a professor in the Departament of Electronics and Computers Technologies. U n i v e r s i t y o f G r a n a d a A e r o s p a c e G r o u p G r a n a S A T UNIVERSITY OF GRANADA Cover credits NASA. All rights reserved. “Low Speed Telemetry Link System for CubeSat” Bachelor’s Degree in Telecommunication Technology and Engineering Bachelor’s Thesis “Low Speed Telemetry Link System for CubeSat” ACADEMIC COURSE: 2019/2020 Daniel Adyl Fidalgo Jammoue Bachelor’s Degree in Telecommunication Technology and Engineering “Low Speed Telemetry Link System for CubeSat” AUTHOR: Daniel Adyl Fidalgo Jammoue SUPERVISED BY: Andrés María Roldán Aranda DEPARTMENT: Electronics and Computer Science Low Speed Telemetry Link System for CubeSat Daniel Adyl Fidalgo Jammoue PALABRAS CLAVE: , Altium Designer®19, Diseño aeroespacial, , , , Electrónica, , , EPS, , Diseño de PCB, . RESUMEN: El objetivo principal del presente proyecto es desarrollar una Plataforma de Simulación multidisciplinar de CubeSats. Estará compuesta de tres bloques diferenciados, en torno a los cuales pivotará el proyecto: una plataforma de simulación mecánica, un software de gestión de y un prototipo de , que constituirá la base del futuro GranaSAT-I. Este Trabajo Fin de Máster se aborda desde una ambiciosa doble perspectiva: por un lado, el desarrollo de una Plataforma de Simulación de amplia utilidad en el ámbito académico, como medio para el acercamiento del alumnado de múltiples titulaciones al mundo aeroespacial y en concreto a los CubeSats, en el contexto de auge actual, fomentado por instituciones como la Agencia Espacial Europea (); en segundo lugar, en el ámbito de investigación, proveyendo de un medio para la implementación de nuevos algoritmos de comunicación, de control orbital y, en general, para el desarrollo y testeo de tecnologías y técnicas novedosas, de manera previa a su lanzamiento. El desarrollo e implementación de este proyecto se lleva a cabo siguiendo metodologías de Ingeniería de Sistemas contrastadas y asentadas en la industria espacial, dotándolo de realismo y acercando al alumno a técnicas profesionales de amplio reconocimiento en el mercado de trabajo. Asimismo, la complejidad y ámbito multidisciplinar de este Trabajo Fin de Máster le permite cubrir, no sólo las diferentes especialidades del Máster de Ingeniería de Telecomunicación, sino también adquirir conocimientos y habilidades transversales o específicos de otros campos de la Ingeniería, como la Mecánica o la Aeroespacial. Así, además de software especialista de cada uno de los campos mencionados, se han analizado y aplicado técnicas avanzadas de mecanizado (fresado de aluminio mediante control numérico), fabricación (soldadura utilizando técnicas de reflow) o caracterización de diferentes dispositivos (baterías de litio, células solares de silicio...), entre otros. El resultado de todo lo expuesto culmina con la obtención de un entorno de simulación completo y funcional, que cumple con los requisitos definidos en etapas iniciales, y con el cual se cierra la etapa universitaria de Máster. 0xiv Daniel Adyl Fidalgo Jammoue ‘Tough and competent’ Acknowledgments: HERE ACKNOWLEDGMENTS IN ENGLISH 0xviii Agradecimientos: AQUÍ AGRADECIMIENTOS EN ESPAÑOL Daniel Adyl Fidalgo Jammoue Index Defense authorization vii Library deposit authorization ix Abstract xi Dedication xv Acknowledgments xvii Index xix List of Figures xxi Code Index xxiii List of Videos xxv List of Tables xxvii Glossary xxix Acronyms xxxi 1Introduction 1 Low Speed Telemetry Link System for CubeSat xix 0xxvi List of Videos Daniel Adyl Fidalgo Jammoue List of Tables 3.1Comparisson among transceivers . . . . . . . . . . . . . . . . . . . . . . . . . 10 3.2Comparisson among camera modules . . . . . . . . . . . . . . . . . . . . . . 11 3.3Weightofthecomponents............................. 15 3.4Powerbudget .................................... 15 A.1Differences between microcontrollers . . . . . . . . . . . . . . . . . . . . . . 28 Low Speed Telemetry Link System for CubeSat xxvii 0xxviii List of Tables Daniel Adyl Fidalgo Jammoue Glossary CubeSat Miniaturized satellite made up of multiples of 10 cm × 10 cm × 10 cm cubic units. FloripaSat-1Brazilian CubeSat mission. Linux Open-source and free OS. microcontroller Compact integrated circuit used to take control over an operation in an embedded system [14]. MSP430FR6989 MCU used in this project. RF4463F30 RF module used in this project. Texas Instruments Technology company the microcontroller has been bought from. transceiver Device able to transmit and receive. Low Speed Telemetry Link System for CubeSat xxix 0xxx Glossary Daniel Adyl Fidalgo Jammoue Acronyms (G)FSK Gaussian Frequency Shift Keying. (G)MSK Gaussian Minimum Shift Keying. ADC Analog-to-Digital Converter. AES Advanced Encryption Standard. AM Amplitude Modulation. ASK Amplitude-Shift Keying. CCS Code Composer Studio. Comp Comparator. CRC Cyclic Redundancy Check. DAC Digital-to-Analog Converter. DMA Direct Memory Access. EPS Energy Powering Subsystem. eUSCI Enhanced Universal Serial Communication Interface. FIFO First In First Out. FM Frequency Modulation. FRAM Ferrite Random Access Memory. FSK Frequency Shift Keying. GND Ground. Low Speed Telemetry Link System for CubeSat xxxi 0xxxii Acronyms I/O Input/Output. I2CInter-Integrated Circuit. IF Intermediate Frequency. IrDA Infrared Data Association. LCD Liquid Crystal Display. LDO Low-Dropout Regulator. LED Light-Emitting Diode. LNA Low Noise Amplifier. LO Local Oscillator. MCU Microcontroller Unit. MPY Hardware Multiplier. NASA National Aeronautics and Space Administration. OOK On-Off Keying. OS Operating System. PA Power Amplifier. PCB Printed Circuit Board. RAM Random Access Memory. RDS Radio Data System. RF Radio Frequency. RISC Reduced Instruction Set Computing. RTC Real Time Clock. RX Receive. SDR Software Defined Radio. SMA SubMiniature version A. Daniel Adyl Fidalgo Jammoue xxxiii 0 SPI Serial Peripheral Interface. SRAM Static Random Access Memory. TX Transmit. UART Universal Asynchronous Receiver-Transmitter. USB Universal Serial Bus. USCI Universal Serial Communication Interface. Low Speed Telemetry Link System for CubeSat 0xxxiv Acronyms Daniel Adyl Fidalgo Jammoue Chapter 1 Introduction AQUÍ VA LA INTRO Low Speed Telemetry Link System for CubeSat 1 3 8Chapter 3. Analysis 3.1.2RF Module The RF module used in this project is the RF4463F30 [10], of which schematic is shown in Figure 3.3. In this case, it is the same as the one used in FloripaSat-1because its features are better than those in other options found on the market. Therefore, it is not necessary to migrate from RF modules like in the case of the microcontroller. Figure 3.3–RF4463F30 Schematic [10] The RF4463F30 is a high power wireless transceiver module, with a [11] chip (Figure 3.4), which is an integrated low power transceiver. Furthermore, this RF module also has a PA, so there is no need to use an external PA. Daniel Adyl Fidalgo Jammoue 9 3 Figure 3.4–Si4463 Functional Block Diagram [11] Another component that can be done without is a circuit to switch the RX and TX paths, since this module has a built-in antenna switching for both modes. This feature has a huge relevance because it allows the use of a single antenna for transmitting and receiving in each frequency band, instead of using one for the and another for the . Among its characteristics, some that must be highlighted are: • Output power of 30 dBm maximum. • Very high receiving sensitivity (-126 dBm). • Power supply range from 1.8V to 3.6V, even though it has a LDO to have a constant source of 3.3V for the transceiver. • High data transfer rate from 0.1kbps up to 1Mbps. • Preamble detection in RX mode. • Customizable frequency range from 142 MHz up to 1050 MHz. • Ultra low consumption shut-down mode. Low Speed Telemetry Link System for CubeSat 3 10 Chapter 3. Analysis •64/128-byte RX and TX FIFO data register. • Different possible modulations such as (G)FSK,4(G)FSK, (G)MSK, ASK and OOK. All these features explained make this transceiver fit better in the current project than other candidates, which were the RF module ADF7021-N [1] and the AX5043[3]. Followingly, some of the main characteristics of these three transceivers are compared: Feature RF430F30 AX5043 ADF7021-N Output power (dBm) 30 16 13 Receiving sensitivity (dBm) -126 -126 -122 Power supply range (V) 1.8-3.6 1.8-3.6 2.3-3.6 Data transfer rate (kbps) 0.1-1000 0.1-125 0.5-24 Modulations (G)FSK/ 4(G)FSK/ (G)MSK OOK ASK FSK/MSK/ 4FSK/ (G)FSK/ (G)MSK/ ASK/ AFSK/ FM/PSK 2FSK/ 3FSK/ 4FSK/MSK TX mode current (mA) 550 51.6 23 RX mode current (mA) 10 9.5 18.3 Price (e)7.74 2.17 1.87 Table 3.1–Comparisson among transceivers It is easy to see in this table that the other transceivers are much cheaper and have some advantages over the one used here. However, the chosen one is the RF4463F30 due to its outstanding parity between a high output power and a very good receiving sensitivity. This, combined with everything explained previously, make this RF module a very good choice. Daniel Adyl Fidalgo Jammoue 11 3 3.1.3Camera Module The camera used in this project is the with AL422BFIFO [8]. During the choosing process, other modules were taken into account. Beyond size specifications, image quality and power consumption related features have been highly relevant. The other possible modules were the OV7670 without FIFO [9] and the Adafruit TTL 397 [12]. Feature OV7670 with AL422B FIFO OV7670 Adafruit TTL 397 Maximum Power Supply (V) 3.3 3.3 5 Temperature range (ºC) -30 to 70 -30 to 70 No information Output formats YUV/YCbCr 4:2:2 RGB565/555/444 GRB 4:2:2 Raw RGB Data YUV/YCbCr 4:2:2 RGB565/555/444 GRB 4:2:2 Raw RGB Data Standard JPEG / M-JPEG Maximum Transfer Rate (fps) 30 30 30 Sensitivity (V/Lux ·sec)1.3 1.3No information S/N Ratio (dB) 46 46 45 Pixel size (µm)3.6x3.6 3.6x3.6 5.6x5.6 Power Requirements Active = 60 mW Standby < 20 µA Active = 60 mW Standby < 20 µA75 mA Dynamic Range (dB) 52 52 60 Price (e)11.01 5.99 35.92 Table 3.2–Comparisson among camera modules As seen in Table 3.2, first two modules are very similar. In fact, these camera modules themselves are exactly the same. However, one of them has a FIFO queue. This characteristic is a huge difference in terms of design because, thanks to that, an external clock is not needed to sync up the camera with the MCU. If the module without FIFO was used, a slight desynchronization between the microcontroller and the camera would mean the image loss. Low Speed Telemetry Link System for CubeSat 3 12 Chapter 3. Analysis Therefore, once the without FIFO has been discarded, the next step is comparing the module with FIFO with the Adafruit one. Here, the election seems quite easy just by seeing the difference between prices and between power requirements. Eventually, and as said at the beginning of this subsection, the camera module chosen is the with FIFO. A/D G D[7: 0] B R 50/60 Hz Auto Detect Test Pattern Generator Video Port Image Scaler DSP Buffer Buffer (Lens shading cor rect ion, denoi se, wh i te/ bl ack pi xel cor rect ion, aut o wh i te bal ance, et c. ) FIFO Analog Processing Image Array (656 x 488) Column Sense Amp Exposure/Gain Detect Exposure/Gain Control SCCB Interface Registers Video Timing GeneratorClock SIO_C SIO_D STROBE PWDNRESET#VSYNCPCLKHREFXCLK Row Select Figure 3.5–Camera Block Diagram [9] 384k x8 Memory Cell Array SRAM Cache Timing Generator & Arbiter Write Address Counter Read Address Counter Refresh Address Counter DI7~ DI0 DO7~ DO0 /OE RCK /RRST /RE WCK /WRST /WE Input Buffer Write Data Register Read Data Register Output Buffer Figure 3.6–FIFO Block Diagram [2] Daniel Adyl Fidalgo Jammoue 13 3 Figure 3.7–Camera Module Figure 3.8–FIFO 3.1.4BUS PC-104 As the CubeSat that will hold the PCB of this project has multiple boards, it is needed to add a bus of 104 signals to exchange information among them. Figure 3.9–BUS PC-104 Schematic [13] Most of the signals seen in Figure 3.9are from the EPS, but only some of them are actually used in the current project, which are those highlighted [13]: •5V bus, in s 77 and 78 •3V bus, in s 79 and 80 •GND, in s 61,66,69,73,74,81,82,84,99 and 100 •I2C EPS signals, in s 41 and 43 Low Speed Telemetry Link System for CubeSat 3 14 Chapter 3. Analysis • General I2Csignals, in s 45 and 47 3.2Software Defined Radio and GNU Radio in the Receiver To simulate a , a very good idea is using an SDR connected to an antenna (Figure 3.10) and both connected to a computer with a built schematic. Figure 3.10 –RTL-SDR & DAB FM DVB-T The antenna is used for the RX function and the SDR device for the operation seen in Figure 4.1, where the analog received signals are transformed into digital using an ADC. These elements bring this project enough power sensitivity and receiving frequency range to perform as a good in the distance that the tests will be done. Obviously, these two elements themselves are not enough to demodulate the received signals, which is the main part of the receiving task. If the information is not demodulated, the transmission would be senseless. Hence, as said before, the SDR + antenna must be connected to a computer with a signal processing capable software. In this case, the chosen one is due to some interesting reasons, being the main one that it is programmed in . The clear advantage of this feature is that it is a widely spread language, which is translated in a very large community with a good amount of documentation to solve different problems that will be dealt with along the project process. Another ease given by is that it can be linked without any problem to a coded project, which makes it very useful in the task of presenting the received packets to the user. Daniel Adyl Fidalgo Jammoue 15 3 3.3Power and mass characteristics As said in Chapter 2, this PCB will be part of a CubeSat. This means that there are some power, size and mass limitations that must be respected to make this project possible. The first matter to care about is the total allowed weight. An important reason to choose a component over another is its weight because if it is too heavy, the previous requirements would not be achieved. The weight of each component is shown in the following table: Component Weight (g) PCB 22 Microcontroller 0.6 RF Module 4 PC-104 2.7 Camera 12.9 Camera Connector 2 SMA Connector 1.5 Table 3.3–Weight of the components Taking into account that there are two RF modules and two SMA connectors, the total weight is 51.2g, which meets with the maximum allowed mass requirement of 1.33 kg. In terms of size, only with a right PCB the limitations are covered. Therefore, this is also good for the project. The last task is related to power consumption. Here, the most relevant components are the camera module, the MSP430FR6989 and the RF modules. Saving energy is one of the most important matters. Hence, a very low power consumption in sleep mode and a not so high power consumption in active mode are searched while choosing the components. In Table 3.4these consumptions are shown: Component Sleep Mode (µW) Active Mode (mW) Camera 66 165 Microcontroller 10.56 2.64 RF Module 15 2750 Table 3.4–Power budget As seen, the components chosen have a good energy consumption either in sleep Low Speed Telemetry Link System for CubeSat 3 16 Chapter 3. Analysis mode and active mode. Therefore, this requirement is correctly respected. Daniel Adyl Fidalgo Jammoue Chapter 4 System Design After analyzing the different parts of both, the transmitter and the receiver, it is important to explain how they are designed. To begin with, the transmiiter has some systems and procedures that must be understood in order to design a well simulated ground station that does the inverse processes. Obviously, if both parts are not equivalent, the whole system will not performed in the desired way. 4.1Transmitter design 4.2Receiver design As explained in Section 3.2, the receiver will be simulated using a SDR connected to . After receiving the signals, the antenna’s task is to transform the electromagnetic wave into a signal that the SDR device is able to understand. In this project, the Software Defined Radio will only be used as a receiver. Therefore, its schematic is shown in the next figure: Figure 4.1–Software Defined Radio in reception Low Speed Telemetry Link System for CubeSat 17 5 24 Chapter 5. Tests and results Figure 5.3–FM broadcasting well received Now that the antenna is calibrated, the received FM broadcasting signal looks better, with a lower . Another proof of its well calibration is that the SDR# is able to decode the RDS, which gives information about the channel like its name. Daniel Adyl Fidalgo Jammoue References [1] ADF7021-N: High Performance Narrow-Band Transceiver IC. https://www. analog.com/en/products/adf7021-n.html. [2] AL422 Data Sheets (Revision V1.1). http://www.openimpulse.com/blog/ wp-content/uploads/wpsc/downloadables/AL422-FIFO-Datasheet.pdf. [3] AX5043: Ultra-Low Power Narrow-Band Sub GHz (27 -1050 MHz) RF Transceiver. https://www.onsemi.com/pub/Collateral/AX5043-D.PDF. [4] Description of some GNU Radio blocks. http://blog.sdr.hu/grblocks/types. html. [5] MSP430F665x, MSP430F645x, MSP430F565x, MSP430F535x Mixed-Signal Microcontrollers. https://www.ti.com/lit/ds/symlink/msp430f6659.pdf? ts=1590693622195. [6] MSP430FR698x(1), MSP430FR598x(1) Mixed-Signal Microcontrollers. https://www. ti.com/lit/ds/symlink/msp430fr6989.pdf?ts=1590598345240. [7] Notes on M&M Clock Recovery. https://www.tablix.org/~avian/blog/archives/ 2015/03/notes_on_m_m_clock_recovery/. [8] OV7670 Camera Module with AL422 FIFO. https://www.openimpulse.com/blog/ products-page/product-category/ov7670-camera-module-with-al422-fifo/. [9] OV7670/OV7171 CMOS VGA (640x480) Camera Chip Sensor with OmniPixel Technology. http://web.mit.edu/6.111/www/f2016/tools/OV7670_2006.pdf. [10] RF4463f30 1W High Sensitivity Wireless Transceiver Module. https: //www.nicerf.com/Upload/ueditor/files/2018-12-15/RF4463F30% 201W%20High%20Power%20Wireless%20Transceiver%20Module%20V2. 2-4a0e93b3-6bff-4d22-9efa-abbee5ac3de8.pdf. [11] Si4464/63/61/60 High-Performance, Low-Current Transceiver. https://www. silabs.com/documents/public/data-sheets/Si4464-63-61-60.pdf. Low Speed Telemetry Link System for CubeSat 25 References [12] TTL Serial Camera. https://cdn-learn.adafruit.com/downloads/pdf/ ttl-serial-camera.pdf. [13] Galicia, J. A. M. Telemtry, Tracking & Command board for CubeSat. Master’s thesis, École Polytechnique Fédérale de Lausanne, Laussane, August 2019. [14] Rouse, M. Microcontroller. https://internetofthingsagenda.techtarget.com/ definition/microcontroller. [15] Salmond, R. Automatically calibrate PPM for RTL_SDR. https://rob.salmond. ca/automatically-calibrate-ppm-for-rtl-sdr/. 26 Low Speed Telemetry Link System for CubeSat Appendix A Microcontroller’s migration As explained in Subsection 3.1.1, the microcontroller used in this project is MSP430FR6989, whereas the one used in FloripaSat-1project is . Hence, at the beginning it was necessary to migrate from one MCU to the other. Firstly, it is important to understand which are the main differences between these two modules. Therefore, a good strategy is comparing the functional of both. The of our MCU is shown in Figure 3.2, while the FloripaSat-1’s is here below: Unified Clock System 512KB 384KB Flash MCLK ACLK SMCLK I/O Ports P1, P2 2×8 I/Os Interrupt Capability PA 1×16 I/Os CPUXV2 and Working Registers EEM (L: 8+2) XIN XOUT JTAG, SBW Interface Port PJ PA PB PC PD DMA 6 Channel XT2IN XT2OUT Power Management LDO SVM, SVS Brownout SYS Watchdog P2 Port Mapping Controller I/O Ports P3, P4 2×8 I/Os Interrupt Capability PB 1×16 I/Os I/O Ports P5, P6 2×8 I/Os PC 1×16 I/Os I/O Ports P7, P8 1×6 I/Os PD 1×14 I/Os 1×8 I/Os I/O Ports P9 1×8 I/Os PE 1×8 I/Os MPY32 TA0 Timer_A 5 CC Registers TA1 and TA2 2 Timer_A each with 3 CC Registers TB0 Timer_B 7 CC Registers RTC_B Battery Backup System CRC16 USCI0,1,2 Ax: UART, IrDA, SPI Bx: SPI, I C 2 ADC12_A 200 ksps 16 channels (12 ext, 4 int) Autoscan 12 bit DVCC DVSS AVCC AVSS P1.x P2.x P3.x P4.x P5.x P6.x P7.x P8.x P9.x RST/NMI REF Reference 1.5 V, 2.0 V, 2.5 V DAC12_A 12 bit 2 channels voltage out LCD_B 160 Segments USB Full-speed Comp_B MID Memory Integrity Detection PJ.x 64KB 32KB RAM +2KB RAM USB Buffer +8B Backup RAM Copyright © 2016, Texas Instruments Incorporated Figure A.1–MSP430F6659 Functional Block Diagram [5] To make this comparison easier, it is a good idea to show the main disparities in a table: Low Speed Telemetry Link System for CubeSat 27 References Feature MSP430FR6989 MSP430F6659 Power consumption (µA/MHz) Active Mode: 100 Active Mode: 295 Standby Mode: 0.4Standby Mode: 2.2 Shut-Down Mode: 0.02 Shut-Down Mode: 0.45 CRC 16-Bit and 32-Bit 16-Bit ADC 12-Bit 12-Bit Full Speed USB No Yes RAM FRAM 128 kB SRAM 64 kB / 32 kB No Yes USCI 4eUSCI ports A0and A1for UART,IrDA and SPI B0and B1for SPI and I2C 6USCI ports A0, A1and A2for UART,IrDA and SPI B0, B1and B2for SPI and I2C I/O s10 9 DAC No 12-Bit / 2Channels DMA 3Channels 6Channels 16-Bit Timer 5 4 LCD 320 segments 160 segments Clock frequency 16-Bit up to 16 MHz 16-Bit up to 20 MHz AES Yes No Comp E B RTC C B Internal and digitally enabled capacitors / pull-ups Yes No Extended Scan Interface Yes No Battery Backup System No Yes Price (e)5.89 9.85 Table A.1–Differences between microcontrollers Once all these differences have been seen and understood, it is needed to change all the code related to them. The microcontroller is part of the transmitter. Therefore, all its code is in implemented in using CCS. 28 Low Speed Telemetry Link System for CubeSat Appendix B Blinking Test B.1Code and explanation One of the first tests done is the Blinking Test, focused on making a LED in order to take control over the PCB. To achieve a good performance here, parameters like frequency are relevant to control the LED’s timing of . After the code, an is used to check the correct blinking frequency. Since the PCB used has five LEDs, the first thing to do is deciding which one will perform this testing task. As seen in Figure B.1, two LEDs follow the I2C, one follows the SPI and another is connected to the power supply so it remains switched on all the time. Hence, the chosen LED is the one flagged as SYSTEM_ON, which is connected to the 95 of the MCU. Low Speed Telemetry Link System for CubeSat 29 References LED I2C EPS R6 330R 0805 D1 Red GND LED I2C OBC R7 330R 0805 D2 Red GND LED SPI R8 330R 0805 D3 Red GND SYSTEM ON R9 330R 0805 D5 Red GND R3 1k 0805 D3 Red GND MSP VCC 3V3 Figure B.1–LEDs system With the testing LED chosen, the next task to do is to make it . Therefore, a simple script is written and presented in Listing B.1. To make the comprehension of this code easier, in Figure B.2the is shown: Blinking Test LED Initialization Clock Configuration Turn off LEDs Number of blinks < 8 Yes Delay Turn on LED 4 Delay Turn off LED 4 While (1) No Figure B.2–Blinking Test Flow Diagram 30 Low Speed Telemetry Link System for CubeSat References 1int main( void ) { 2WDTCTL = WDTPW | WDTHOLD; ///< Stop watchdog timer 3 4int blink ; ///< Variable that wil l increase i t s value each time the main loop i s run 5 6init_LEDs() ; ///< Function that i n i t i a l i z e s the LEDs . 7configure_clock(8) ; ///< Function to configure the clock at 8MHz. 8 9turnOffLED (LED1) ; ///< Function that turns off the LED1 10 turnOffLED (LED2) ; ///< Function that turns off the LED2 11 turnOffLED (LED3) ; ///< Function that turns off the LED3 12 turnOffLED (LED4) ; ///< Function that turns off the LED4 13 14 15 for (blink=1; blink <8; blink ++) { 16 turnOnLED(LED4) ; ///< Function that turns on the LED4 17 _delay_cycles(8000000) ; ///< LED on during 800000 cycles . This value is used due to the clock is at 8MHz . 18 turnOffLED (LED4) ; 19 _delay_cycles(8000000) ; 20 } 21 22 while (1) ; 23 } Code B.1–Blinking test main code After stopping the and initializing the LEDs of the PCB, it is necessary to set the microcontroller’s clock frequency. In this test, the chosen value is 8MHz, but it can be another up to 16 MHz, as seen in Subsection 3.1.1. The following action is to turn off (see Listing B.4) every LED but the one connected to the power supply just to make the recognition of the blinking LED easier. Finally, there is a for to turn off and on the LED4seven times, which are enough iterations for this test. In this there are two s to keep the current state during 8000000 cycles. This value allows to see the blinking during about one second, according to the clock of the microcontroller. In this code there are some relevant functions that will be shown in the following Listings. 1void init_LEDs () { 2GPIO_setAsOutputPin(LED1) ; 3GPIO_setAsOutputPin(LED2) ; 4GPIO_setAsOutputPin(LED3) ; 5GPIO_setAsOutputPin(LED4) ; 6PMM_unlockLPM5() ; 7}} Code B.2–LEDs initialization 1void configure_clock ( int8_t freq ) { 2i f ( freq == 1) 3CS_setDCOFreq (CS_DCORSEL_0, CS_DCOFSEL_0) ; 4el se i f ( freq == 4) 5CS_setDCOFreq (CS_DCORSEL_0, CS_DCOFSEL_3) ; 6el se i f ( freq == 8) 7CS_setDCOFreq (CS_DCORSEL_0, CS_DCOFSEL_6) ; 8el se i f ( freq == 16 ) 9CS_setDCOFreq (CS_DCORSEL_1, CS_DCOFSEL_4) ; 10 11 //Set ACLK = VLO with frequency divider of 1 Low Speed Telemetry Link System for CubeSat 31 References 12 CS_initClockSignal (CS_ACLK,CS_VLOCLK_SELECT, CS_CLOCK_DIVIDER_1) ; 13 14 //Set SMCLK = DCO with frequency divider of 1 15 CS_initClockSignal (CS_SMCLK,CS_DCOCLK_SELECT, CS_CLOCK_DIVIDER_1) ; 16 17 //Set MCLK = DCO with frequency divider of 1 18 CS_initClockSignal (CS_MCLK,CS_DCOCLK_SELECT, CS_CLOCK_DIVIDER_1) ; 19 } Code B.3–Clock configuration 1void turnOffLED ( uint8_t port , uint8_t pin ) { 2GPIO_setOutputLowOnPin( port , pin ) ; 3} Code B.4–Turn off LEDs 1void turnOnLED( uint8_t port , uint8_t pin ) { 2GPIO_setOutputHighOnPin ( port , pin ) ; 3} Code B.5–Turn on LEDs All these functions need the s and s of the LEDs in the PCB. Therefore, it is necessary to define them in the . To find out about the s and s that belong to each LED, see code Listing B.6. 1#define LED1GPIO_PORT_P6,GPIO_PIN1///< Port 6, Pin 1 2#define LED2GPIO_PORT_P6,GPIO_PIN5///< Port 6, Pin 5 3#define LED3GPIO_PORT_P2,GPIO_PIN6///< Port 2, Pin 6 4#define LED4GPIO_PORT_P10 , GPIO_PIN0///< Port 10 , Pin 0 Code B.6–LEDs definition in PINMAP B.2Results Once the code is understood, the following step is to see if the results agree with the expected performance. To do so, watching the ’s output might be a good choice: Figure B.3–Pulse High 32 Low Speed Telemetry Link System for CubeSat References Figure B.4–Pulse Low Low Speed Telemetry Link System for CubeSat 33