Professional Documents
Culture Documents
Using small microcontroller like, say, an in parallel, as many LCD modules do. In Therefore we have relocated the neces-
8-pin ATtiny from Atmel, we’re left with addition, the increased pin-count usually sary conversion from serial to parallel
just five GPIOs remaining after discount- complicates the soldering, because the away from the actual microcontroller
ing the two supply pins, assuming we inter-pin distances are reduced. circuit into a module that contains the
wish to retain the reset pin. That’s not If you neither wish to use larger control- necessary conversion electronics, so that
many. A larger chip with more pins not lers nor forego functions, then you are inexpensive, widely available LCDs can be
only takes up more surface area of the forced to use a port expander, consist- used. A display upgraded in this way can
PCB but we still run out of pins rapidly ing usually of shift registers connected then be connected to any microcontroller
after connecting all the press buttons, either by I2C (slow) or by SPI (requiring with minimal effort.
LEDs and other peripherals, especially an extra pin). Even then, the shift regis-
if they demand that data is transmitted ters use up at least two or even three pins Single-wire solution
of the microcontroller for converting the Long before the Internet age people were
data into parallel format and transferring already aware of methods of tricking a
Technical specification this to suit the particular interface of the shift register into accepting serial data
LCD module. This kind of kludge certainly using fewer inputs than were actually nec-
• Universal interface for parallel LCDs
leaves potential for optimization. essary. The simplest possible shift register
• Serial addressing using only one
has at least two inputs, one for data and
GPIO line
Optimal solution one for the clock. The clock is necessary
• Plugs into LCD modules with
The attainable optimum just has to be to determine the point in time at which
differing pin configurations
the use of a single data line. Anything the level on the data input is valid. How-
• Compatible with low-cost LCD
fewer would be impossible and any more ever, if you generate a special combined
modules
than one not really necessary, as an LCD data + clock format, you can then sepa-
• Minimum transfer time for a
only receives data; it doesn’t send any. rate the data from the clock using a sim-
character = 0.8 ms
An optimum solution should not require ple resistor and capacitor (RC) element.
• Compatible with all microcontrollers
reinventing the wheel each time either. Figure 1 shows how this process works
only make the negative input pulse much however, and does not control the inter-
longer, so that the voltage at the data nal data acquisition for IC1 (as with the
input falls to Low. The input signal now solution in [1]). Instead it enables a reset Figure 1. Block diagram for controlling a shift
consists of a sequence of short and long of its Pin 10. Data acquisition is therefore register via an RC low-pass filter using only one
negative pulses — depending on the bit solved in a different way. data line.
pattern being transmitted. If you select
the timings appropriately, the solution
functions very reliably.
+5V R6
To avoid the data piling up sequentially bit 68R
1
K3
by bit on the parallel outputs and caus- 2
BACKLIGHT
ing indeterminate states there during the 1 3 5 14
LCD_D7
13
clocking-in period, shift register ICs are JP1 LCD_D6
12
LCD_D5
generally provided with an output reg- 2 4 6 11
LCD_D4
ister that takes in data from the actual 10
GND
9 K5
shift register only ‘on demand’ and then GND
8
defines and organizes the data at the +5V +5V GND LCD
7
GND
outputs in one fell swoop. To this end, K1
6
LCD_ENABLE
5
therefore, a third input is necessary. As 1 3
C4 GND
4
LCD_REG SEL
would seem natural, a solution was found 3
2 R1 R2 100n LCD_V_LCD
from authors on the Internet such as [1] 16
2
+5V
2k2
47k
1
by simply using a second RC element with VCC
QA
15 GND
22k
10k
R2 = 47kΩ 1
RC elements against the author’s version
R3,R5 = 10kΩ
R4 = 22kΩ for more stable data transfer. Inciden-
R6 = 68Ω tally, in your own programs you should
P1 = 2.2kΩ trimpot, large, horizontal not make the duration of the Low pulses
Capacitors any shorter (to avoid jeopardizing stabil-
C1,C3 = 4.7nF, 0.1” pitch ity). On the other hand you are free to
C4 = 100nF, 5mm pitch lengthen the High pauses. In the demo
software Luc has also made provision for
Semiconductors
T1 = BS170 a trigger signal to Arduino Digital pin 9
IC1 = 74HC595, DIL (see prototype photo). This is for test
purposes and you can of course omit this
Miscellaneous
in your own implementation to save pins.
K1 = 3-pin pinheader, 0.1” pitch
K2+K4,K3+K5 = 16-pin pinheader or 16-way
pinheader receptacle*, 0.1” pitch Construction and operation
JP1 = 6-pin (2x3) pinheader, 0.1” pitch
There is really not very much to say about
2 pcs jumper, 0.1”pitch
LCD module, 2x16 characters* populating the board seen in Figure 4.
PCB # 130397-1* With only one wired IC and ten passive
Figure 4. Component side of the PCB for
single-wire LCD interface. non-SMD components, there is nothing
* see text
insurmountable even for raw recruits to