paul@1 | 1 | Introduction
|
paul@1 | 2 | ------------
|
paul@1 | 3 |
|
paul@1 | 4 | The ben-pololu-imu distribution provides some programs that run on the Ben
|
paul@1 | 5 | NanoNote and control the Pololu MinIMU-9 board which provides a 3-axis
|
paul@1 | 6 | gyroscope, a 3-axis accelerometer, and a 3-axis magnetometer. To connect the
|
paul@1 | 7 | module to the Ben, the 8:10 port which is typically employed to access microSD
|
paul@1 | 8 | cards is instead used to hold a suitable breakout board that exposes the 8:10
|
paul@1 | 9 | port's connectors to other circuits. These connectors are in turn connected to
|
paul@1 | 10 | specific connectors on the MinIMU-9 as follows:
|
paul@1 | 11 |
|
paul@1 | 12 | Sniffer UBB MinIMU-9
|
paul@1 | 13 | ------- ---- --------
|
paul@1 | 14 | DAT2 DAT2
|
paul@1 | 15 | CD DAT3 SCL
|
paul@1 | 16 | CMD CMD SDA
|
paul@1 | 17 | VCC VDD VIN
|
paul@1 | 18 | CLK CLK (3V)
|
paul@1 | 19 | GND GND GND
|
paul@1 | 20 | DAT0 DAT0 (1V8)
|
paul@1 | 21 | DAT1 DAT1
|
paul@1 | 22 |
|
paul@1 | 23 | The 3V and 1V8 pins play no role in the communication, but a six pin header
|
paul@1 | 24 | exposing these pins on the IMU can be used to connect the IMU with the
|
paul@1 | 25 | Sniffer/UBB without any complications.
|
paul@1 | 26 |
|
paul@1 | 27 | Building the Software
|
paul@1 | 28 | ---------------------
|
paul@1 | 29 |
|
paul@1 | 30 | Before building the software, it will probably be necessary to edit the
|
paul@1 | 31 | Makefile to specify the locations of the cross-compilation toolchain and of
|
paul@1 | 32 | libubb. Obtaining a toolchain and libubb is currently beyond the scope of this
|
paul@1 | 33 | document.
|
paul@1 | 34 |
|
paul@1 | 35 | The programs are built as follows:
|
paul@1 | 36 |
|
paul@1 | 37 | make
|
paul@1 | 38 |
|
paul@3 | 39 | Connecting the Hardware
|
paul@3 | 40 | -----------------------
|
paul@3 | 41 |
|
paul@3 | 42 | Given that the Ben normally expects to find something resembling a microSD
|
paul@3 | 43 | card connected via the 8:10 port, it is best to leave the Sniffer/UBB with the
|
paul@3 | 44 | MinIMU-9 board disconnected until the following command has been issued:
|
paul@3 | 45 |
|
paul@3 | 46 | echo jz4740-mmc.0 > /sys/bus/platform/drivers/jz4740-mmc/unbind
|
paul@3 | 47 |
|
paul@3 | 48 | This tells the MMC driver to free the 8:10 port for other applications.
|
paul@3 | 49 |
|
paul@1 | 50 | Running the Software
|
paul@1 | 51 | --------------------
|
paul@1 | 52 |
|
paul@1 | 53 | On the Ben, the programs can be deployed together with libubb in a particular
|
paul@1 | 54 | directory and invoked as described below.
|
paul@1 | 55 |
|
paul@1 | 56 | As an alternative to deploying libubb and the programs together, the library
|
paul@1 | 57 | search path can be configured properly and the programs installed in such a
|
paul@1 | 58 | way that merely typing the name of the program is enough to run them.
|
paul@1 | 59 |
|
paul@1 | 60 | The calibrate program just prints out readings from a particular component on
|
paul@1 | 61 | the MinIMU-9 board. For the gyroscope, accelerometer and magnetometer, it can
|
paul@1 | 62 | be run with the respective commands as follows:
|
paul@1 | 63 |
|
paul@1 | 64 | LD_LIBRARY_PATH=. ./calibrate -g
|
paul@1 | 65 | LD_LIBRARY_PATH=. ./calibrate -a
|
paul@1 | 66 | LD_LIBRARY_PATH=. ./calibrate -m
|
paul@1 | 67 |
|
paul@1 | 68 | The itest program is a graphical program which should be run when the Ben is
|
paul@1 | 69 | showing a console (and not any graphical environment); it is run as follows:
|
paul@1 | 70 |
|
paul@1 | 71 | LD_LIBRARY_PATH=. ./itest
|
paul@1 | 72 |
|
paul@1 | 73 | (It supports an argument -f which enables the high-pass filter on the
|
paul@1 | 74 | accelerometer, but this is generally useless.)
|
paul@1 | 75 |
|
paul@1 | 76 | The imu program can be run as a textual or graphical program as follows:
|
paul@1 | 77 |
|
paul@1 | 78 | LD_LIBRARY_PATH=. ./imu
|
paul@1 | 79 |
|
paul@1 | 80 | The imu program accepts the following options:
|
paul@1 | 81 |
|
paul@1 | 82 | -g Run in graphical mode. This should be done when the Ben is showing a
|
paul@1 | 83 | console and when other graphical programs are not using the
|
paul@1 | 84 | framebuffer. If omitted, the program will run in text mode.
|
paul@1 | 85 |
|
paul@1 | 86 | -c Calibrate before attempting to interpret readings from the gyroscope
|
paul@1 | 87 | and accelerometer. This is highly recommended because uncalibrated
|
paul@1 | 88 | measurements will produce an inaccurate impression of the device's
|
paul@1 | 89 | rotation and motion.
|
paul@1 | 90 |
|
paul@1 | 91 | Hardware: Pololu MinIMU-9
|
paul@1 | 92 | -------------------------
|
paul@1 | 93 |
|
paul@1 | 94 | This board provides the L3G4200D 3-axis gyroscope and LSM303DLM 3-axis
|
paul@1 | 95 | accelerometer/magnetometer components from STMicroelectronics and is described
|
paul@1 | 96 | at the following location:
|
paul@1 | 97 |
|
paul@1 | 98 | http://www.pololu.com/catalog/product/1265
|
paul@1 | 99 |
|
paul@1 | 100 | Note that a different version of the board used the LSM303DLH component and is
|
paul@1 | 101 | described here:
|
paul@1 | 102 |
|
paul@1 | 103 | http://www.pololu.com/catalog/product/1264
|
paul@1 | 104 |
|
paul@1 | 105 | There are subtle differences between the LSM303DLM and LSM303DLH components,
|
paul@1 | 106 | and it is important to know which one is being used. Both of these boards have
|
paul@1 | 107 | now been superseded by the following MinIMU-9 v2 board which uses other
|
paul@1 | 108 | components:
|
paul@1 | 109 |
|
paul@1 | 110 | http://www.pololu.com/catalog/product/1268
|
paul@1 | 111 |
|
paul@1 | 112 | No support for the MinIMU-9 v2 board or the LSM303DLH variant of the MinIMU-9
|
paul@1 | 113 | is present in the software, currently, but other projects do provide support
|
paul@1 | 114 | for these other boards and can be studied to see what the differences are
|
paul@1 | 115 | between the different components involved.
|
paul@1 | 116 |
|
paul@1 | 117 | Hardware: 8:10 Port Breakout Board
|
paul@1 | 118 | ----------------------------------
|
paul@1 | 119 |
|
paul@1 | 120 | To connect the Ben NanoNote to the IMU board, a suitable breakout board is
|
paul@1 | 121 | required to expose the connections inside the 8:10 slot. To achieve this, the
|
paul@1 | 122 | Sparkfun microSD Sniffer has been used:
|
paul@1 | 123 |
|
paul@1 | 124 | https://www.sparkfun.com/products/9419
|
paul@1 | 125 |
|
paul@1 | 126 | This board is apparently intended for eavesdropping on communications between
|
paul@1 | 127 | a "host" device with a microSD slot and a microSD-based device that can be
|
paul@1 | 128 | inserted into a slot mounted on the board (instead of being inserted directly
|
paul@1 | 129 | into the host device). However, the board-mounted slot can be ignored and the
|
paul@1 | 130 | exposed connections routed to the display board instead.
|
paul@1 | 131 |
|
paul@1 | 132 | Another board that achieves the same purpose is the Universal Breakout Board
|
paul@1 | 133 | (UBB):
|
paul@1 | 134 |
|
paul@1 | 135 | http://en.qi-hardware.com/wiki/UBB
|
paul@1 | 136 |
|
paul@1 | 137 | The UBB is somewhat more difficult to work with as its connectors are very
|
paul@1 | 138 | small and, compared to the microSD Sniffer, awkward to attach things to. The
|
paul@1 | 139 | microSD Sniffer employs connectors situated around holes with 0.1 inch
|
paul@1 | 140 | spacing, meaning that commonly available connection headers can be soldered
|
paul@1 | 141 | onto the board.
|
paul@1 | 142 |
|
paul@1 | 143 | Although the labelling of the connections is different between the microSD
|
paul@1 | 144 | Sniffer and UBB (see above), the layout appears to be identical.
|
paul@1 | 145 |
|
paul@1 | 146 | Contact, Copyright and Licence Information
|
paul@1 | 147 | ------------------------------------------
|
paul@1 | 148 |
|
paul@1 | 149 | The author can be contacted at the following e-mail address:
|
paul@1 | 150 |
|
paul@1 | 151 | paul@boddie.org.uk
|
paul@1 | 152 |
|
paul@1 | 153 | Copyright and licence information can be found in the docs directory - see
|
paul@1 | 154 | docs/COPYING.txt and docs/gpl-3.0.txt for more information.
|