University of LeicesterPLUMERef: PLM-OBDH-COMSInterf-218-1
Date: 18/03/2010
OBDH – COMS Interface Document
David Marshall, Gareth Gould
Date / Updated Reference Number / change[29/11/2009] / [PLM-OBDH-COMSInterf-218-0] / First draft
[18/03/2010] / [PLM-OBDH-COMSInterf-218-1] / Updated information and configuration parameters.
Table of Contents
1 Introduction 1
2 COMS subsystem overview 1
3 Interface overview 2
4 Modem Commands 2
5 Modem Initialisation 5
6 Baud Rate Settings 5
7 References 7
1 Introduction
This document describes the interface between the PLUME system board and the various components of the COMS subsystem. The interface is tested using the modem prototype board which contains both a PIC (Peripheral Interface Controller) modem and an RF Datatech transceiver.
All documents mentioned are referenced in section 7.
2 COMS subsystem overview
The COMS subsystem will receive control signals sent to the satellite from the ground station, as well as transmit system status, payload, ADCS and camera data. The data will be temporarily stored in the SD card until it’s transmitted.
The satellite must be in a certain state before it attempts to power-up the payload. For this reason, the satellite will transmit its state to the ground station, and wait for the ground station to request that the payload be powered-up.
The COMS system will be powered on in Recovery mode and transmit a beacon to allow the ground station to track the satellite. The antenna will be deployed after 30 minutes. Intervals will be left in the beacon transmission to allow the reception of the first contact command from the ground station.
Should the satellite be unable to receive data from the ground station for whatever reason, to avoid the mission failing completely the satellite will enter Autonomous mode, where the important ADCS and payload data will be continuously transmitted.
3 Interface overview
The COMS subsystem connects to our Pumpkin FM430 flight module using the USART (Universal Synchronous/Asynchronous Receive/Transmit) peripheral interface built into the board’s MCU, a Texas Instruments MSP430F1612. The USART is set to asynchronous mode (UART) and uses the address-bit multiprocessor asynchronous communication format.
The COMS subsystem consists of an RF DataTech PIC (Peripheral Interface Controller) 16C711 modem, an RF DataTech LRT470-1 transceiver and an antenna. The flight controller communicates with the COMS subsystem entirely through the modem.
The flight controller connects to the modem through the modem connections shown in table 3.1.
Table 3.1: Modem connections
Modem pin / Description / Board pinRADRXD / Outputs serial data / H1.39 TXD_MHX
RADTXD / Serial data input / H1.40 RXD_MHX
RSSI Voltage / Received signal strength indicator / -
RAD+ / Transmitter power supply / -
+5V / 5 Volt Supply / -
TXPSUEN / 10 Volt Supply / -
0V / Ground / H2.32 GND
TXP / Transmitted power / -
The flight controller communicates with the modem through the modem’s RADRXD and RADTXD connections; aside from the ground, the other pins are not required.
The UART character format is shown in Fig.3.1 and consists of a start bit (ST) (low), eight data bits (ABCDEFGH) (high or low), an address bit (X) (high or low) and a stop bit (SP) (high). The bit period is defined by the selected baud rate.
Figure 3.1: Character Format
Table 3.2 shows the bus pins required to operate the COMS subsystem, extra to those that directly connect to the modem.
Table 3.2: Required pins for COMS subsystem
Pin / Name / I/O / DescriptionH1.10 / P4.6 / O / Set low to enable +5V_SW power
H2.2 / P6.6 / O / Set low to enable transceiver interface
4 Connecting to the modem prototype
The modem prototype uses a DE-9 connector for serial RS-232 communication, however only 3 of the 9 pins are used. A diagram of the connector mounted on the side of the modem is shown in Fig.4.1.
Figure 4.1: Modem DE-9 female connector.
The modem is connected to a laptop using a custom DE-9 cable with an integrated level shifter shown in Fig.4.2. The level shifter switch must be set to the ‘on’ position for the connection to work correctly.
Figure 4.2: Level shifter
The modem is connected to the board using a different modified cable, with a DE-9 connector at one end and three pins for connection to the board at the other shown in Fig.4.3. The pins are each labelled for convenience.
Figure 4.3: Modem cable connected to the development board bus
The two modems must be powered using an external power supply. In flight this will be provided by the PSU subsystem, during testing a DC power supply unit is used. The power supply must be set to 5V and maximum current for the modems to operate correctly. The power supply connected to the two modems is shown in Fig.4.4.
Figure 4.4: Modems connected to the power supply.
To simulate the transmission of data using aerials, an attenuator is used to damp the signals passing between the modems. Each modem has a coaxial cable which must be connected to each end of the attenuator as shown in Fig.4.5. The right hand 20dB switch should be on and the other switches left off for testing.
Figure 4.5: Attenuator connected to the modems.
The connections to the board have sections of bare wire for connecting to a logic analyser, an example of the signals going to and from the modem as monitored with a logic analyser is shown in Fig.4.5.
Figure 4.5: Signals to and from the modem during modem initialisation monitored with a logic analyser. The top and bottom rows show signals from the board and signals from the modem respectively.
Specifics of operating the logic analyser are detailed in the document PLM-COMS-BenchTestingComs-129-3.
5 Modem Commands
The ACK (0000,0000) character is returned following every sent character to indicate that the modem is ready to receive the next character. This applies to both data and control characters. The only exceptions are replies to WAKE and ENQ.
The modem can be put into a sleep mode to save power. However any commands it receives in this state will not be processed. To wake the modem the WAKE command should be sent, the modem will respond with WAKAK and is ready to receive new commands. Should the modem respond with WAKAK unexpectedly, then the modem was asleep and the last character should be sent again. Even if the modem is already awake, it will respond with WAKAK to the WAKE command.
Table 2: Modem commands
Send / Description / Add / Binary / Hex / Receive / Add / Binary / HexSLEEP / System sleeps / C / 1000,0000 / 80 / ACK / C / 0000,0000 / 00
WAKE / System wakes / C / 1111,1111 / FF / WAKAK / C / 0000,0010 / 02
TXSTT
+ Data / Transmit / C / 101E,DCBA
+ Data / - / ACK / C / 0000,0000 / 00
TXEND / End transmit mode / C / 0010,0000 / 20 / ACK / C / 0000,0000 / 00
ENQ / Enquire / C / 010E,DCBA / - / RQD
+ Data / C / 0000,0001
+ Data / 01
ENQ0 / Enquire for status / C / 0100,0000 / 40 / RQD
+ Data / C / 0000,0001
+ Data / 01
ENQ1 / Enquire for type / C / 0100,0001 / 41 / RQD
+ Data / C / 0000,0001
+ Data / 01
ENQ2 / Enquire for version / C / 0100,0010 / 42 / RQD
+ Data / C / 0000,0001
+ Data / 01
TEST / Enable test mode / C / 011E,DCBA / - / ACK? / C / 0000,0000? / 00?
TEST1 / Test mode 1 / C / 0110,0001? / 61 / ACK? / C / 0000,0000? / 00?
TEST2 / Test mode 2 / C / 0110,0010? / 62 / ACK? / C / 0000,0000? / 00?
TEST3 / Test mode 3 / C / 0110,0100? / 63 / ACK? / C / 0000,0000? / 00?
TEST4 / Test mode 4 / C / 0110,1000? / 64 / ACK? / C / 0000,0000? / 00?
TEST0 / Exit test mode / C / 0110,0000 / 60 / ACK / C / 0000,0000 / 00
CFG / Configuration / C / 000E,DCBA
+ Data / - / ACK / C / 0000,0000 / 00
Notes for modem commands with modifiable character bits follow.
TXSTT - Transmit – Command - 101E,DCBA
The lead in delay is the amount of time before the data is transmitted; this allows time to raise TXP from 0V to 5V so the power is correct.
If E is 1, then bits DCBA give the lead in delay as a multiple of 80ms (e.g. 0001=80ms, 0010=160ms etc), range 0-1200ms.
If E is 0, then bits DCBA give the lead in delay as a multiple of 5ms (e.g. 0001=5ms, 0010=10ms etc), range 0-75ms.
Currently E,DCBA is set to the maximum 1,1111 for testing, giving a lead in delay of 1.2 seconds.
ENQ – Enquire – Command - 010E,DCBA
Returns the RQD character rather than ACK, this denotes that the next data byte will be the control data requested. The modem is ready to receive the next character once both bytes have been received.
The bits ABCDE control the format of the returned data byte.
ENQ0 - ABCDE = 00000 - 0100,0000
Returns status MLKJ,IHGF where -
F = 1 = channel busy
G = 1 = data carrier detected
H = 1 = transmitter on
I = 1 = test mode on
J = 1 = synchroniser out of lock (error)
K = 1 = rx buffer overflow (error)
L = 1 = tx buffer overflow (error)
M = 1 = power on reset status (error) – Set when the modem is powered on, as a result of a watchdog reset on the radio, or if an incomplete configuration is performed on the modem.
ENQ1 - ABCDE = 00001 – 0100,0001
Returns an 8 bit identifier to signify the radio type e.g. UHF MPT1329.
ENQ2 - ABCDE = 00010 – 0100,0010
Returns the code version running in the radio.
Note: The radio identifier and code version are not described further in the manual. The formats of the returned characters are unknown.
TEST – Test – Command – 011E,DCBA
Puts in the PIC into a test mode.
ABCDE control the test number to be run.
TEST0 – ABCDE = 00000 – 0110,0000
Restores normal PIC operation.
TEST1 – ABCDE = 00001 – 0110,0001 ?
Transmit continuous zero tone.
TEST2 – ABCDE = 00010 – 0110,0010 ?
Transmit continuous one tone.
TEST3 – ABCDE = 00100 – 0110,0100 ?
Transmit continuous one carrier.
TEST4 – ABCDE = 01000 – 0110,1000 ?
Transmit 50Hz square wave.
CFG – Configuration – Command – 000E,DCBA
Configures the PIC.
ABCDE control which parameter to set.
All 7 configuration parameters must be set in sequence from CFG0 to CFG6. Should the configuration not complete, the modem will not function correctly.
6 Modem Initialisation
The modem requires configuration commands in a specific order to set it up. Each command returns ACK.
The parameters are provided by the COMS team.
Send / Description / Add / Binary / Hex / SetsCFG0 / Configuration parameter 0 / C / 0000,0000 / 00
TXPLL0 / msd of the synthesiser TX code / D / 1100,1110 / CE
CFG1 / Configuration parameter 1 / C / 0000,0001 / 01
TXPLL1 / lsd of the synthesiser TX code / D / 1010,0000 / A0
CFG2 / Configuration parameter 2 / C / 0000,0010 / 02
RXPLL0 / msd of the synthesiser RX code / D / 1011,0010 / B2
CFG3 / Configuration parameter 3 / C / 0000,0011 / 03
RXPLL1 / lsd of the synthesiser RX code / D / 1000,0000 / 80
CFG4 / Configuration parameter 4 / C / 0000,0100 / 04
OFFSET / synthesiser offset / D / 0100,0000 / 40
CFG5 / Configuration parameter 5 / C / 0000,0101 / 05
FFBAUD / FFSK baud rate / D / 1000,0000 / 80 / Baud rate = 1200bd
CFG6 / Configuration parameter 6 / C / 0000,0110 / 06
FFMODE / FFSK format / D / 0000,0100 / 04 / 8 bit, parity off, one stop bit
7 Baud Rate Settings
The mspgcc website has a Baud Rate calculator at http://mspgcc.sourceforge.net/baudrate.html. This can be used to calculate the required settings of the registers BR0, BR1 and MCTL for any given clock speed and required baud rate.
Information from the calculator for the correct clock rate is given below.
/*
uart calculator: http://mspgcc.sourceforge.net/baudrate.html
this program license is at: http://www.fsf.org/licenses/licenses.html#GPL
this program is distributed WITHOUT ANY WARRANTY
clock: 762000Hz
desired baud rate: 9600bps
division factor: 79.4
effective baud rate: 9596.98bps
maximum error: 0.6561us 0.63%
time table (microseconds):
event desired effective error error%
startbit->D0 104.17 103.67 +0.492 +0.47
D0->D1 208.33 208.66 -0.328 -0.31
D1->D2 312.50 312.34 +0.164 +0.16
D2->D3 416.67 417.32 -0.656 -0.63
D3->D4 520.83 521.00 -0.164 -0.16
D4->D5 625.00 624.67 +0.328 +0.31
D5->D6 729.17 729.66 -0.492 -0.47
D6->D7 833.33 833.33 +0 +0.00
D7->stopbit 937.50 937.01 +0.492 +0.47
end of stopb 1041.67 1041.99 -0.328 -0.31
*/
UBR00=0x4F; UBR10=0x00; UMCTL0=0x4A; /* uart0 762000Hz 9596bps */
UBR01=0x4F; UBR11=0x00; UMCTL1=0x4A; /* uart1 762000Hz 9596bps */
8 Ground station controls
The ground station needs to be able to send control signals to the satellite which will cause the flight controller to perform a variety of tasks. The tasks are as follows.
a) Report status
b) Power-up payload
c) Power-down payload
d) Take photo
e) Transmit data from the SD card.
9 References
http://cubesat.wikidot.com/local--files/transceiver-page/PLM-COMS-LRTManual-136-1.pdf
http://cubesat.wikidot.com/local--files/coms/PLM-COMS-DataInter-117-2.docx
http://cubesat.wikidot.com/local--files/coms/PLM-COMS-BenchTestingComs-129-3.docx
http://focus.ti.com/lit/ug/slau049f/slau049f.pdf
Page 9 of 10