Upload
others
View
0
Download
0
Embed Size (px)
Citation preview
University of Leicester PLUME Ref: PLM-OBDH-Operations-215-1Date: 06/08/2009
OBDH Operations Manual
Peter R Hague
Date Updated Reference Number change
06/08/2009 PLM-OBDH-Operations-215-1 Created document
Table of Contents
Introduction...........................................................................................................................................3
What is covered in this document.....................................................................................................3
Anti-static procedures...........................................................................................................................4
The anti-static mat.............................................................................................................................4
Anti-static wrist straps.......................................................................................................................4
Working with electro static discharge sensitive equipment..............................................................4
Development Hardware........................................................................................................................6
Inventory...........................................................................................................................................6
Instructions for use............................................................................................................................9
Flight Hardware...................................................................................................................................10
Inventory.........................................................................................................................................10
Instructions for use..........................................................................................................................10
Clean equipment procedures..............................................................................................................11
Compiling code....................................................................................................................................12
Uploading and executing code............................................................................................................13
Using the logic analyser.......................................................................................................................14
Setting up the logic analyser............................................................................................................14
Using the logic analyser...................................................................................................................15
Page 1 of 20
University of Leicester PLUME Ref: PLM-OBDH-Operations-215-1Date: 06/08/2009
Troubleshooting..............................................................................................................................16
Retrieving data from the SD card........................................................................................................17
Windows..........................................................................................................................................17
Linux................................................................................................................................................17
Page 2 of 20
University of Leicester PLUME Ref: PLM-OBDH-Operations-215-1Date: 06/08/2009
Introduction
This document is designed to teach you how to safely use the OBDH development hardware and the OBHD flight hardware. You should read this entire document before handling any of the equipment described here.
What is covered in this document
This document covers the physical handling of the hardware (development and flight), interfacing the hardware with a computer to upload programs, working with the logic analyser to debug programs, and retrieving data from SD cards.
It is recommended that you learn about the architecture of the MCU (microcontroller unit) i that we are using, and how to program it in Cii, before attempting to work with the board.
Also, the first time you work on the development hardware you should do so under the supervision of a senior member of the OBDH team.
Page 3 of 20
University of Leicester PLUME Ref: PLM-OBDH-Operations-215-1Date: 06/08/2009
Anti-static procedures
All hardware is to be considered ESD sensitive, whether it is flight hardware or development hardware. What this means is that the hardware may be permanently damaged by static discharges that can occur during handling. The following procedures must be adhered to at all times.
The anti-static mat
The first thing to do when working with static sensitive equipment is to find an uncluttered place to work, which won’t have lots of people crowding around, and has a mains outlet easily accessible. Connecting to the mains outlet should not require stretching cables across areas where people are walking, as this could result in equipment being pulled off the bench.
Roll out the static mat, and connect the accompanying mains plug to a socket. This mains plug only connects to the earth pin of the socket, and has three metal connectors on it. One of these should be connected, with the cable provided, to a corresponding one on the anti-static mat.
Anti-static wrist straps
Everybody working around the anti-static mat must wear an anti-static wrist strap, even if they do not intend to touch any hardware (accidents happen). Each wrist strap consists of the strap itself, and a cable to attach it to one of the metal connectors.
Straps must be tight on the wrist, so that they maintain electrical contact with the users skin (and not any clothing/gloves they are wearing), and are useless if not connected to earth. Attach the cables either to one of the remaining metal connectors on the mat, or one of the metal connectors on the plug.
Do not take the wrist strap off until all static sensitive equipment is put away. If you must leave the area for any reasons, step away from the mat before removing your wrist strap.
Working with electro static discharge sensitive equipment
Page 4 of 20
University of Leicester PLUME Ref: PLM-OBDH-Operations-215-1Date: 06/08/2009
Figure 1 - The development board in its anti-static bag
Once everything is ready, carefully remove your equipment from its anti-static bag and place on the mat. Keep the mat clear of anything that may generate static (such as plastic bags, other than ones labelled as anti-static bags).
Page 5 of 20
University of Leicester PLUME Ref: PLM-OBDH-Operations-215-1Date: 06/08/2009
Development Hardware
The development hardware is the hardware used to program, test, and debug the code which will ultimately run on the satellite. None of it will fly in space, and therefore it does not need to be used in a clean room. However, much of it is sensitive to Electro Static Discharge (ESD), and so precautions against static discharge must be taken at all times. For how to safely handle the hardware, see the Static Precautions section.
Inventory
The following items are included with the development hardware:
1. The development board
Figure 2 - the development board
Page 6 of 20
University of Leicester PLUME Ref: PLM-OBDH-Operations-215-1Date: 06/08/2009
2. The power supply for the development board
Figure 3 - The board power supply
3. The USB programmer
Figure 4 - The USB programmer plugged into the development board
Page 7 of 20
University of Leicester PLUME Ref: PLM-OBDH-Operations-215-1Date: 06/08/2009
4. An SD card
Figure 5 - An SD card, inside protective plastic box
5. An anti-static mat
Figure 6 - an anti-static mat laid out in the lab
Page 8 of 20
University of Leicester PLUME Ref: PLM-OBDH-Operations-215-1Date: 06/08/2009
6. One or more anti-static wrist straps
Figure 7 - an anti-static wrist strap
7. A desktop PC
Instructions for use
The anti-static procedures described above must always be followed when using the development hardware. Once the board is ready to be handled without risk of static discharge, it must be connected up. First, whilst wearing a static wrist strap, insert the SD card carefully into the slot in the lower left hand corner of the board.
Secondly, plug the USB programmer into the daughter board (the smaller circuit board mounted on top of the development board). Be gentle and do not force any connections. Plug the USB end of the programmer into the PC, and turn the PC on.
Finally, take the 5V power supply for the board, and check the output voltage written on it. There may be a number of power supplies in the lab that physically fit in the board but do not give the correct voltage. It is imperative that you check the output voltage of the power supply every time you use the board. When you are confident you have the correct 5V power supply, plug it in and turn it on at the mains. Three of the four LEDs near the middle of the board should now be lit up, and you are ready to begin working on it.
Page 9 of 20
University of Leicester PLUME Ref: PLM-OBDH-Operations-215-1Date: 06/08/2009
Flight Hardware
The flight hardware is the hardware that will actually be sent into space. As well as being ESD sensitive, like the development hardware, it is also necessary to keep the flight hardware clean at all times. It must be handled only in the clean room at the Space Research Centre (SRC), and only under the supervision of SRC staff.
Inventory
The following items are included with the flight hardware:
1. The flight board2. The satellite frame (integrated with the board)3. The “Remove Before Flight” pin
Instructions for use
The flight hardware is located in the SRC clean room, and must never leave there until it is to be delivered. All work done on the flight hardware must be done there, and work must only be done on the flight hardware when absolutely needed.
From a computational point of view, the flight board is identical to the development board. The only differences are that the development board is larger to facilitate easier work on it, and it has some extra electronic featuresiii. Code will run exactly the same on the two boards, assuming both are working properly. Therefore, there is no reason to do code work on the flight hardware.
When it comes time to work with the flight board, its must be handled carefully. The remove before flight pin must not be removed and reinserted without good reason, as it may wear down. The hardware has a switch on the bottom (i.e. the face of the satellite with the board set into it) that detects when the satellite is deployed on orbit. Again, this must not be pressed in without good reason, and the satellite should never be rested on that face.
Page 10 of 20
University of Leicester PLUME Ref: PLM-OBDH-Operations-215-1Date: 06/08/2009
Clean equipment procedures
All equipment that is to be sent into space must be kept clean. Such equipment can only be handled in a clean room, or a laminar flow cabinet. Both of these can be found in the Space Research Centre.
Even with precautions in place, it is best to minimise the handling of flight hardware. Any time you wish to work with the flight hardware, ask yourself if your task is possible to accomplish with the development hardware. If it is, you should do so.
All the equipment for handling clean hardware is available in the SRC, and staff there will instruct you on how to proceed. Do not attempt to handle flight hardware without the supervision of SRC staff.
All the equipment that must be kept clean is also static sensitive, so you must also adhere to the above precautions as well as those required for keeping the hardware clean.
Page 11 of 20
University of Leicester PLUME Ref: PLM-OBDH-Operations-215-1Date: 06/08/2009
Compiling code
Before any code can be run on either the development or flight hardware, it must be compiled on a PC.
The only compiling tool used by OBDH is a version of gcc specifically developed for our microcontroller, the MSP430. It can be found here:
http://sourceforge.net/projects/mspgcc/files/
msp430-gcc is not a development environment (although it can be used with a third party development environment, such as Code::Blocks, easily enough). It is a command line application. In order to use it, you must first bring up a terminal. On a Windows machine, this is done by going to the start menu, selecting 'run' and typing 'cmd' into the dialogue box and hitting enter.
When you have a terminal, navigate to the location of where msp-gcc is installed and type the following command:
msp430-gcc <filename.c> -mmcu=msp430x1612 –o <OUTPUT.ELF>
With <filename.c> replaced by the name of the C file you wish to compile and <OUTPUT.ELF> is the name of the executable file you wish to create. If you do have a Windows development environment you wish to use as an editor, it is in some cases possible to instruct the programme to use an alternative compiler. Search the option menus until you find the command used to compile your code and change it from its default to 'msp-gcc'.
The only language the compiler recognises is C. Although there are more modern variants of this language, notably C++, they are too complex to run on the microcontroller’s hardware. A complete description of the C programming language is beyond the scope of this manual, but knowledge of it is absolutely essential for everyone involved with the OBDH subsystem.
Page 12 of 20
University of Leicester PLUME Ref: PLM-OBDH-Operations-215-1Date: 06/08/2009
Uploading and executing code
Before uploading any code, it is necessary to physically connect the development board. This, and the required anti-static precautions, is covered in previous sections.
The PC that is in the lab with the development board should have the required software already installed. Using a USB stick, transfer a compiled .ELF file to the PC, copy it onto a local folder and remove the USB stick (the uploader has bugs, and can fail sometimes if a USB stick is in use).
If a .ELF file appears with a blue icon that has “MSP430” written inside it, the software is installed and you can just double click on the file. If not, the software can be downloaded from the pumkin website.iv
Although it is likely the PC will not have an internet connection so you will have to transfer this via USB stick as well.
Once you have clicked on the .ELF file, a dialogue box will appear. Choose USB, and the Erase All, and the program should be uploaded to the board. It will begin running immediately, but if you wish to start the code again at any point, there is a reset button on the surface of the development board which can be used by anyone wearing an anti-static wrist strap.
Page 13 of 20
University of Leicester PLUME Ref: PLM-OBDH-Operations-215-1Date: 06/08/2009
Using the logic analyser
The development board has no real capacity to display data, so in order to check programs are working and for them to return debugging data, some external hardware must be used. The main piece of hardware is the logic analyser.
The logic analyser connects to various output pins on the board, and produces a trace of the digital output from that pin on the screen, which can then be used to ascertain what is happening inside the MCU.
Setting up the logic analyser
Figure 8 -The 'POD 1' cable
Firstly, turn the logic analyser on at the mains, and with the power switch on the back of the unit. Take the ribbon connected marked ‘POD 1’ and look for a black wire. Attach one of the hooks to the end of this wire (if one is not already attached) and clip it on to any of the red ground connections on the board.
Page 14 of 20
University of Leicester PLUME Ref: PLM-OBDH-Operations-215-1Date: 06/08/2009
Figure 9 - A ground wire and a data wire, with hooks
Now find the pins you want to measure (This information can be obtained from the manuals for the MSP430 and for the board, see the links at the end of this document) and attach the numbered wires (via hooks) to those pins.
Using the logic analyser
Upload a program (as described above) that will produce output on the desired pins. You may want to start with a simple program, or one provided to you that definitely works, when first trying out the logic analyser.
Press the ‘Display’ button on the front of the analyser in order to display the traces. Then, when the program is running, press the ‘Run’ button to start collecting data. After a short time, press the ‘Stop’ button, and the signals sent to the pins should appear on the screen.
Page 15 of 20
University of Leicester PLUME Ref: PLM-OBDH-Operations-215-1Date: 06/08/2009
Figure 10 - An example trace, from a test of code to buffer data being sent to the SD card. The quick transitions are memory writes, the long ones SD card writes in this case
Troubleshooting
The logic analyser is a complex machine and a full description of it is beyond the scope of this document. It should be set up so the above procedure works, but if not there are manuals with it, and more senior members of the team should be available to help. Documentation is also available online.v
Page 16 of 20
University of Leicester PLUME Ref: PLM-OBDH-Operations-215-1Date: 06/08/2009
Retrieving data from the SD card
Current OBDH programmes write raw data to the SD card, destroying any file system there and making them unreadable by ordinary means. It is, however, not difficult to directly extract data from an SD card, as long as you have available a computer with a card reader. USB card readers are inexpensive and each member of the team should ensure they have this capability easily available to them.
Windows
Download the program HxD in your language and install it:
http://mh-nexus.de/en/downloads.php?product=HxD
If you are using Windows Vista, right click the HxD icon you will be using to launch the program and choose properties. Click the 'Advanced…' button and tick 'Run as administrator', confirm any UAC windows that appear as you close the properties window. Without this step, HxD may not detect the SD card if it doesn't contain a valid file system.
Launch the program, ensure the SD card is in your reader, and navigate to 'Extras/Open disk…'. Alternatively click the 'Open disk' icon in the toolbar.
Select the SD card in the 'Physical disks' section; it is likely to be called something like 'Removable Disk 1'. Press open, and the raw SD card data will be displayed.
Linux
The basic procedure uses Linux, with python installed.
The card is inserted into the reader and is detected (shown by it popping up into gnome, or from its existence in the /dev directory). A mount command is then run to find the location of the card (this is not the only way but is the easiest and quickest thing I could think of).
Python is then started in interactive mode as root. The following code is then typed in line by line
file=open("/dev/device","rb") print file.read(512) file.close()
Page 17 of 20
University of Leicester PLUME Ref: PLM-OBDH-Operations-215-1Date: 06/08/2009
'/dev/device' is replaced with the actual device name as shown in /dev, and 512 in the read command is the amount to read in bytes from the SD card (512 is chosen as it is the size of a sector), the print command will print it out as ASCII and not hexadecimal but this is a trivial thing, this code is here is more a proof of concept than a practical implementation, which will come later in a full blown program.
An alternative method to get the data from the SD card is to copy directly from the card to a file on a Linux machine; this is done using the dd command
dd if=/dev/device of=out.bin count=1024
This can then be opened using a hex editor to view the actual values of the file, and therefore the actual values on the SD card.
Page 18 of 20
University of Leicester PLUME Ref: PLM-OBDH-Operations-215-1Date: 06/08/2009
For more information about the development and flight hardware:
http://cubesatkit.com/docs/datasheet/DS_CSK_FM430_710-00252-C.pdf
Page 19 of 20
i Texas Instruments, MSP430 users manual (retrieved 13/08/2009) http://focus.ti.com/lit/ug/slau049f.pdf
ii C programming tutorials (retrieved 13/08/2009) http://cprogramming.com
iii Pumpkin Incorporated, Development board datasheet (retrieved 13/08/2009), http://www.cubesatkit.com/docs/datasheet/DS_CSK_DB_710-00297-D.pdf
iv Pumpkin Incorporated, FET driver download page http://www.cubesatkit.com/driver/thirdparty/fet/ti/
v Agilent Technologies, 1650A logic analyser manuals, http://www.home.agilent.com/agilent/prodct.jspx?cc=US&lc=end&nid=-536900196.5368964&pageMode=PL