paul@3 | 1 | Introduction
|
paul@3 | 2 | ------------
|
paul@3 | 3 |
|
paul@3 | 4 | The ben-pcf8833 distribution provides some programs that run on the Ben
|
paul@3 | 5 | NanoNote to control a "Nokia 6100" LCD using the Nuelectronics "Color LCD &
|
paul@3 | 6 | Joystick Shield". To connect the shield to the Ben, the 8:10 port which is
|
paul@3 | 7 | typically employed to access microSD cards is instead used to hold a suitable
|
paul@3 | 8 | breakout board that exposes the 8:10 port's connectors to other circuits.
|
paul@3 | 9 | These connectors are in turn connected to specific connectors on the shield
|
paul@3 | 10 | via some level shifter components as follows:
|
paul@3 | 11 |
|
paul@3 | 12 | Sniffer UBB Shifters Shield
|
paul@3 | 13 | ------- ---- ---------- ------
|
paul@3 | 14 | DAT2 DAT2 A1 (#2) B1 8 (BACKLIGHT)
|
paul@3 | 15 | CD DAT3 A2 (#1) B2 10 (SS/CS)
|
paul@3 | 16 | CMD CMD A1 (#1) B1 9 (RESET)
|
paul@3 | 17 | VCC VDD LV HV VIN
|
paul@3 | 18 | CLK CLK A4 (#1) B4 13 (SCLK/CLK)
|
paul@3 | 19 | GND GND GND GND GND
|
paul@3 | 20 | DAT0 DAT0 A3 (#1) B3 11 (MOSI/SEND)
|
paul@3 | 21 | DAT1 DAT1
|
paul@3 | 22 |
|
paul@3 | 23 | Here, two level shifters are used and are labelled #1 and #2 above. The
|
paul@3 | 24 | VCC/VDD and GND connections from the Ben are connected to the LV and GND
|
paul@3 | 25 | connections respectively on the level shifters.
|
paul@3 | 26 |
|
paul@3 | 27 | In addition to the Sniffer or UBB connections, additional connections for 5V
|
paul@3 | 28 | power and ground must be connected as follows:
|
paul@3 | 29 |
|
paul@3 | 30 | 5V Supply Shifters
|
paul@3 | 31 | ----------- ----------
|
paul@3 | 32 | 5V HV
|
paul@3 | 33 | GND GND
|
paul@3 | 34 |
|
paul@3 | 35 | The 5V output of an Arduino Duemilanove board was successfully used, as it
|
paul@3 | 36 | normally would be with the shield, but any regulated 5V supply should be
|
paul@3 | 37 | suitable.
|
paul@3 | 38 |
|
paul@3 | 39 | Collecting Images for Display
|
paul@3 | 40 | -----------------------------
|
paul@3 | 41 |
|
paul@3 | 42 | Before building the bitmap program, some images with the following specific
|
paul@3 | 43 | properties are required:
|
paul@3 | 44 |
|
paul@3 | 45 | Width: 132 pixels
|
paul@3 | 46 | Height: 132 pixels
|
paul@3 | 47 |
|
paul@3 | 48 | To save you the effort of finding suitable images, some example files are
|
paul@3 | 49 | included in this software distribution.
|
paul@3 | 50 |
|
paul@3 | 51 | An image preparation program then needs to be run on a list of image filenames
|
paul@3 | 52 | to produce suitable source files that can be incorporated into the built
|
paul@3 | 53 | program. This program should be run automatically when building, meaning that
|
paul@3 | 54 | you can skip forward to the "Building the Software" section, but to use other
|
paul@3 | 55 | images or to customise the software you will need to consult the following
|
paul@3 | 56 | instructions.
|
paul@3 | 57 |
|
paul@3 | 58 | The image preparation program can be found in the tools directory and is
|
paul@3 | 59 | called bitmap.py. This program is written in Python and needs the Python
|
paul@3 | 60 | Imaging Library, available in Debian as the python-imaging package and in
|
paul@3 | 61 | other GNU/Linux distributions under other names. It is also available from the
|
paul@3 | 62 | following location:
|
paul@3 | 63 |
|
paul@3 | 64 | https://pypi.python.org/pypi/PIL
|
paul@3 | 65 |
|
paul@3 | 66 | Images are prepared for the program as follows (and this is normally done by
|
paul@3 | 67 | the Makefile automatically):
|
paul@3 | 68 |
|
paul@3 | 69 | python tools/bitmap.py bitmaps examples/*.JPG
|
paul@3 | 70 |
|
paul@3 | 71 | Here, two JPEG files will be loaded, internally converted (the files are not
|
paul@3 | 72 | changed), and the bitmap data written out to two files:
|
paul@3 | 73 |
|
paul@3 | 74 | bitmaps.c
|
paul@3 | 75 | bitmaps.h
|
paul@3 | 76 |
|
paul@3 | 77 | Since the Makefile and bitmap program reference these files, it is recommended
|
paul@3 | 78 | that the "bitmaps" basename be retained when running the bitmap.py program.
|
paul@3 | 79 |
|
paul@3 | 80 | The bitmap.py program also supports other common image formats such as PNG.
|
paul@3 | 81 |
|
paul@3 | 82 | Building the Software
|
paul@3 | 83 | ---------------------
|
paul@3 | 84 |
|
paul@3 | 85 | Before building the software, it will probably be necessary to edit the
|
paul@3 | 86 | Makefile to specify the locations of the cross-compilation toolchain and of
|
paul@3 | 87 | libubb. Obtaining a toolchain and libubb is currently beyond the scope of this
|
paul@3 | 88 | document.
|
paul@3 | 89 |
|
paul@3 | 90 | The programs are built as follows:
|
paul@3 | 91 |
|
paul@3 | 92 | make
|
paul@3 | 93 |
|
paul@3 | 94 | Running the Software
|
paul@3 | 95 | --------------------
|
paul@3 | 96 |
|
paul@3 | 97 | On the Ben, the programs can be deployed together with libubb in a particular
|
paul@3 | 98 | directory and invoked as follows:
|
paul@3 | 99 |
|
paul@3 | 100 | LD_LIBRARY_PATH=. ./spin
|
paul@3 | 101 | LD_LIBRARY_PATH=. ./bitmap
|
paul@3 | 102 |
|
paul@3 | 103 | Alternatively, the library search path can be configured properly and the
|
paul@3 | 104 | programs installed in such a way that merely typing the name of the programs
|
paul@3 | 105 | is enough to run them.
|
paul@3 | 106 |
|
paul@3 | 107 | Hardware: Color LCD & Joystick Shield
|
paul@3 | 108 | -------------------------------------
|
paul@3 | 109 |
|
paul@3 | 110 | This board provides a "Nokia 6100" display and a joystick (currently unused):
|
paul@3 | 111 |
|
paul@3 | 112 | http://shieldlist.org/nuelectronics/colorlcd-joystick
|
paul@3 | 113 |
|
paul@3 | 114 | Nuelectronics do not seem to exist any more, but a similar product is
|
paul@3 | 115 | documented on the Sparkfun site:
|
paul@3 | 116 |
|
paul@3 | 117 | https://www.sparkfun.com/products/9363
|
paul@3 | 118 |
|
paul@3 | 119 | A more appropriate board for the Ben might be the following:
|
paul@3 | 120 |
|
paul@3 | 121 | https://www.sparkfun.com/products/11062
|
paul@3 | 122 |
|
paul@3 | 123 | Since it runs at 3.3V, it would probably be possible to use this particular
|
paul@3 | 124 | board directly with the Ben, leaving out the level shifters/converters
|
paul@3 | 125 | entirely.
|
paul@3 | 126 |
|
paul@3 | 127 | Note that with all boards providing LCD panels, careful inspection and/or
|
paul@3 | 128 | research is necessary to determine which display controller is actually being
|
paul@3 | 129 | used. Annoyingly, product descriptions tend to omit such information.
|
paul@3 | 130 |
|
paul@3 | 131 | Hardware: 4-channel I2C-safe Bi-directional Logic Level Converter - BSS138
|
paul@3 | 132 | --------------------------------------------------------------------------
|
paul@3 | 133 |
|
paul@3 | 134 | Since the Arduino shield described above operates at 5V whereas the Ben
|
paul@3 | 135 | operates at 3.3V, some level shifters are required. The following product was
|
paul@3 | 136 | used for such purposes:
|
paul@3 | 137 |
|
paul@3 | 138 | https://www.adafruit.com/products/757
|
paul@3 | 139 |
|
paul@3 | 140 | Since five signal lines are required for the communication, two such level
|
paul@3 | 141 | shifters are needed (two multiplied by four lines). There are other products
|
paul@3 | 142 | providing more lines, but when choosing a replacement it is important to check
|
paul@3 | 143 | that SPI usage and that 3.3V inputs and 5V outputs can be supported. The above
|
paul@3 | 144 | product supports SPI and I2C communication as well as bidirectional
|
paul@3 | 145 | conversion.
|
paul@3 | 146 |
|
paul@3 | 147 | Hardware: 8:10 Port Breakout Board
|
paul@3 | 148 | ----------------------------------
|
paul@3 | 149 |
|
paul@3 | 150 | To connect the Ben NanoNote to the E-Paper Display module, a suitable breakout
|
paul@3 | 151 | board is required to expose the connections inside the 8:10 slot. To achieve
|
paul@3 | 152 | this, the Sparkfun microSD Sniffer has been used:
|
paul@3 | 153 |
|
paul@3 | 154 | https://www.sparkfun.com/products/9419
|
paul@3 | 155 |
|
paul@3 | 156 | This board is apparently intended for eavesdropping on communications between
|
paul@3 | 157 | a "host" device with a microSD slot and a microSD-based device that can be
|
paul@3 | 158 | inserted into a slot mounted on the board (instead of being inserted directly
|
paul@3 | 159 | into the host device). However, the board-mounted slot can be ignored and the
|
paul@3 | 160 | exposed connections routed to the display board instead.
|
paul@3 | 161 |
|
paul@3 | 162 | Another board that achieves the same purpose is the Universal Breakout Board
|
paul@3 | 163 | (UBB):
|
paul@3 | 164 |
|
paul@3 | 165 | http://en.qi-hardware.com/wiki/UBB
|
paul@3 | 166 |
|
paul@3 | 167 | The UBB is somewhat more difficult to work with as its connectors are very
|
paul@3 | 168 | small and, compared to the microSD Sniffer, awkward to attach things to. The
|
paul@3 | 169 | microSD Sniffer employs connectors situated around holes with 0.1 inch
|
paul@3 | 170 | spacing, meaning that commonly available connection headers can be soldered
|
paul@3 | 171 | onto the board.
|
paul@3 | 172 |
|
paul@3 | 173 | Although the labelling of the connections is different between the microSD
|
paul@3 | 174 | Sniffer and UBB (see above), the layout appears to be identical.
|
paul@3 | 175 |
|
paul@3 | 176 | Contact, Copyright and Licence Information
|
paul@3 | 177 | ------------------------------------------
|
paul@3 | 178 |
|
paul@3 | 179 | The author can be contacted at the following e-mail address:
|
paul@3 | 180 |
|
paul@3 | 181 | paul@boddie.org.uk
|
paul@3 | 182 |
|
paul@3 | 183 | Copyright and licence information can be found in the docs directory - see
|
paul@3 | 184 | docs/COPYING.txt and docs/LICENCE.txt for more information.
|
paul@3 | 185 |
|
paul@3 | 186 | Much of the effort in understanding and documenting the PCF8833 controller was
|
paul@3 | 187 | done by James P. Lynch and is described in the following document:
|
paul@3 | 188 |
|
paul@3 | 189 | http://www.sparkfun.com/tutorial/Nokia%206100%20LCD%20Display%20Driver.pdf
|
paul@3 | 190 |
|
paul@3 | 191 | It appears that most subsequent efforts have drawn from this work, and thanks
|
paul@3 | 192 | are therefore due to the author for his generosity in sharing his findings.
|