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