Following a number of requests from customers for more information on the Memory LCD breakout boards I sell, I have decided to make the board schematic publicaly available rather than responding privately to each request.
The schematic is identical for the small and large breakout boards except for the number of pushbutton switches.
A high resolution pdf of the schematic is available here.
This is the larger of my two Memory LCD breakout boards and is designed for the 400 x 240 pixel Memory LCD LS027B7DH01 :
What Are Memory LCDs?
Memory LCDs are the type of black & white, ultra low-power, ultra high-contrast displays used in smartwatches like the Pebble and the Agent. They fall somewhere between being an e-ink display and a regular LCD. They have the low-power requirement and high contrast of an e-ink display, but as with a regular LCD, you need to keep power connected to maintain the image.
However they do have (write-ony) pixel memory, so you don’t need to repeatedly send the same frame data to the LCD in order to keep the image on screen. Once you’ve sent the data to the screen, it stays there for as long as power is supplied.
The LCDs have a simple SPI interface which is rated at 1 MHz (although I’ve had some models running glitch-free at 4MHz) and a simple command structure. The commands are simply:
Write a single line
Write multiple lines
Clear the screen
Enter power saving mode
As you can see from the commands – the minimum addressable unit is a single line. You can’t alter single pixels individually. If you want to do that, you’ll have to incrementally update a line buffer or a whole frame buffer before sending the completed line(s) to the LCD.
Why do you need a breakout board?
Well, luxurious and ergonomic as they look inside a smartwatch, as a bare component they are nothing but a small rectangle of glass with a delicate and breadboard-unfriendly 0.5 mm pitch flat flex cable dangling off one edge.
With the breakout board, you get the following features that make using the Memory LCD easy:
0.5 mm pitch flat flex cable connector to connect the Memory LCD
0.1″ header strip for compatibility with breadboards
3V LDO voltage regulator and logic level shifting IC (all Memory LCDs have a 3V logic-high level).
Jumper to select the correct supply volage for the particular Memory LCD model (some Memory LCDs have a 5V power requirement)
Jumper to select the display refresh signal source
Positions for 6 optional tactile switches around the perimeter of the LCD
3mm mounting holes for easy mounting of the board inside an enclosure
Double-sided adhesive pads to secure the LCD to the PCB
The dimensions of the large Memory LCD breakout board are 88 x68 mm (W x H) and it is designed for the following LCD:
LS027B7DH01 (2.70″, 400 x 240 pixels, HR-TFT, requires a minimum 5V supply)
The higher the number of pixels in the display, the more microcontroller RAM you’ll have to dedicate to a framebuffer (assuming you’re wanting to use one, that is). Assuming you’re being frugal and storing individual pixels as bits, not bytes, for a complete framebuffer;
400 x 240 pixel LCD requires 12,000 Bytes of RAM
So, if you geek weapon of choice is an Arduino, you’re not going to be able to store a complete framebuffer for this display. I do not recommend using this LCD with a standard Arduino. It is possible to use it, but it’s not ideal as you’ll be limited to a line buffer or buffering <40 lines. The only exception in the Arduino family is the Arduino Due with its 32-bit ARM microcontroller and 96 KB SRAM.
More suitable alternatives to Arduinos can be found among the more powerful 32-bit microcontroller based dev boards and single board computers such as the Beagle Bone Black and Raspberry Pi.
Finally, and just as important to note is the fact that Sharp uses two different display technologies in its Memory LCD family, The 2.70″ Memory LCD mounted on the large breakout board uses Sharp’s HR-TFT design. The differences are best explained by the text from the Sharp Memory LCD website:
PNLC and HR-TFT Modules
Sharp’s Polymer Networked Liquid Crystal (PNLC)-type Memory LCD is composed of a PNLC layer formed between a transparent surface electrode and mirror-reflective pixel electrodes. The PNLC module uses a scattering mode and does not require polarizers, which results in a very bright reflective display. A 1-bit memory circuit is embedded into each pixel, which retains the pixel information once it’s written.
Sharp’s high-contrast HR-TFT technology adds a polarizer to the top layer to greatly enhance the contrast of the display. The black level is dramatically enhanced, resulting in an almost paper-like black and white image.
How to use the breakout board?
The breakout board comes partially assembled. All surface mount components are already soldered onto the back of the board, as are the two 3×1 right-angle headers for selecting the Memory LCD supply voltage and EXTMODE. The LCD is affixed to the front of the board with double-sided sticky foam pads. All you have to do is solder the supplied 14-way header to the board and decide which, if any, of the two types of tactile switches you want mount on the board and solder them in place too.
Two different types of tactile switch are included. The first type has a short actuator and is intended for use on breakout boards that will be used exposed (e.g. on a breadboard). The second, with the longer actuator, is designed for breakout boards that are to be mounted inside an enclosure and the actuators are intended to be long enough to protrude through a hole in the wall of an enclosure with a wall thickness of between 2 to 3 mm. The following photographs show the difference between the two switch types, (albeit demonstrated on the small breakout board):
As previously mentioned, the Memory LCDs have a 0.5 mm flat flex cable with 10 contacts. Aside from the two power and two ground connections (which are reduced to a single Vin and GND on the breakout board 0.1″ header) – there are 6 data connections that need to be made. The first three will be familiar to anyone who’s ever used an SPI peripheral before.
SI – Serial data In
SCS – Serial Chip Select
SCLK – Serial Clock
SPI Note 1: The Serial Chip Select (SCS) pin is active high – which is a departure from the standard SPI approach of having CS active low. So don’t try to communicate with the Memory LCD using your microcontroller’s dedicated CS pin and a standard SPI library.
SPI Note 2: The SPI “mode” expected by the display is 0 (CPOL = 0, CPHA = 0).
SPI Note 3: The Memory LCD datasheet suggests a SPI clock of 1 MHz or less, although I have had some samples running at 4 MHz without problems.
The other three pins from the flat flex connector that are brought out to the 1″ header are:
DISP – Display on/off (active high)
EXTMODE – Set source of VCOM inversion signal
EXTCOMIN – External COM INversion signal
DISP should be self explanatory and could simply be tied high instead of being controlled by a microcontroller pin, but EXTMODE and EXTCOMIN need some discussion.
Memory LCDs require a regular polarity inversion of the voltage across the LCD panel to prevent latent charge building up. The recommended frequency of this inversion is from 1-60 Hz and it is the EXTMODE and EXTCOMIN pins that control/provide the source of the signal that instructs the panel to invert its polarity.
EXTMODE allows the user to control whether the polarity inversion is actioned through software or hardware.
Tie EXTMODE to LOW for software control of the inversion signal. Software control consists of flipping a particular bit in one of one of the command bytes that preceeds the pixel line data sent over SPI when communicating with the LCD. You can save a microcontroller pin (the EXTCOMIN pin, which is explained below) by using this software control but you MUST remember to keep sending commands to the LCD at least once a second even if you’re not changing what’s displayed on the screen.
Tie EXTMODE to HIGH for hardware control of the inversion signal. This tells the LCD to listen for a square wave signal on the EXTCOMIN pin that will act as a toggle for the polarity inversion. Yes, it uses a microcontroller pin, but it means that you can use a dedicated PWM pin, set it to output a 2 Hz squarewave, connect it to EXTCOMIN and just forget about it.
NB: Setting EXTMODE high or low is intended to be done by changing the position of the shunt/jumper on the 3×1 right-angle header JP1. When you receive your breakout board, you do NOT need to connect the EXTMODE pin on the breakout board’s 14-way header to anything on your breadboard or microcontroller. However, if for some strange reason, you do wish to set EXTMODE manually on your breadboard or automatically using your microcontroller, then removing the shunt/jumper from the JP1 header and shorting the two exposed contacts of the EXT-MCU pad with a blob of solder will allow you to set EXTMODE high or low via the EXTMODE pin on the 14-way header.
Aside from the pins on the breakout board header that control the Memory LCD, there are 8 pins for the optional tactile switches that can be mounted around the perimeter of the board. The switches are SPST-NO type and depressing the switch will result in a LOW signal. I designed the breakout board to make use of a microcontroller’s INTERNAL pull-up resistors. If your microcontroller does not have internal pull-up resistors or you do not wish to make use of them, you will need to add your own external pull-ups.
I have now ported my Arduino library for controlling Sharp Memory LCDs to the Raspberry Pi. The extra memory and processing power available on the Pi certainly expand what you can do with this great little display. The lowly Arduino and even the 80 MHz ChipKIT did struggle to complicated process frames of data for the display, but the Pi breezes through them all without any trouble.
I have written my Memory LCD library for Raspberry Pi in C++ (sorry to all you Pi Python fans, I have no plans to port it to Python) and it uses the Broadcom bcm 2835 C library to control the Pi’s GPIO pins. The library is available on my Github page and this article discusses how to get started with Memory LCDs and the Raspberry Pi.
An Important Note Concerning EXTCOMIN
Before I start to discuss installing the software and connecting the breakout board to the Pi, you need to understand about the need to constantly refresh the Memory LCD’s screen while it is turned on.
The only way to avoid constantly refreshing the LCD is to turn it off in one of two ways. The first way is the obvious hard turn off by disconnecting Vin. The second way is a soft turn off by pulling the DISP pin LOW.
The Memory LCD datasheets advise that a periodic VCOM inversion is required to regularly impose a polarity inversion across the LCD panel in order to stop a latent charge from building up within the liquid crystal cells. This inversion should happen at a rate between 2 Hz and 60 Hz and can be triggered in one of two ways:
Software EXTCOMIN Inversion
The first way is via software commands. For this, the jumper JP1 on the rear of the breakout board should be set to LOW, and the user needs to flip a particular bit within the command ID byte when instructions are sent to the pi over SPI at the rate given above.
So even if the image on the LCD is supposed to stay static for a second, a minute, an hour or even longer, commands must still be sent to the LCD over SPI telling it to invert the display’s polarity. This software method is NOT implemented in my library (although a basic function showing how to do it is in the library, it is not automatically invoked).
You can also use the DISP pin to turn the Memory LCD off while the Raspberry Pi remains powered (see below).
Hardware EXTCOMIN Inversion
The second way to ensure polarity inversion is via an eternal square wave supplied to the EXCTOMIN pin on the breakout board. For this to work, JP1 on the rear of the breakout board should be set to HIGH and a square wave of 50% duty cycle and frequency between 2 Hz and 60 Hz should be supplied to the EXTCOMIN pin.
This second, hardware based method of polarity inversion is the one that I recommend. However, using the Memory LCD on the Pi does complicate matters.
When using the Memory LCD breakout board with an Arduino, it’s nice and easy – you can set one of the dedicated hardware PWM pins on the Arduino to generate your square wave and forget about it. That square wave will be output from the moment the Arduino powers on, to the moment it powers off. There’s no danger of the LCD ending up with an image displayed but without receiving a polarity inversion signal, unless you really, really screw up your code and somehow freeze the Arduino, disabling the PWM pin in the process.
On the Raspberry Pi, however, the Memory LCD turns on at the same time as the Pi starts to boot. When the Memory LCD turns on, it also turns a random selection of pixels on – pixels which will need a polarity inversion signal to be supplied. Now, if you’re not running your own Memory LCD program on boot, those pixels are going to sit there with the latent charge building up on them until you choose to start your program that supplies a proper signal to EXTCOMIN.
The same thing happens when you issue the shutdown command to the Raspberry Pi, the Memory LCD continues to draw power from the GPIO header and display whatever image was on it when your program stopped. It only powers off when the USB connection is removed from the Pi.
There are a number of solutions to this – the first is to wire up a 555 timer on the same breadboard as the Memory LCD breakout board and use the 555 in astable mode to supply a squarewave to the EXTCOMIN pin. This is probably the most foolproof method and can be seen in my videos of the Memory LCD and the Pi. If you want to calculate resistor and capacitor values for the 555, use this 555 calculator. To generate an approx 3 Hz squarewave, I am using:
C = 20 nF
R1 = 2.7 MOhm
R2 = 10 MOhm
Although foolproof and therefore ideal for use during development and debugging, using the 555 timer introduces additional external components you can do without if a little more work is done in software.
The second method is to make use of the DISP pin on the Memory LCD breakout board. Whenever this is set LOW, the Memory LCD is turned OFF and the squarewave on EXTCOMIN is not needed. Unfortunately, the Raspberry Pi’s GPIO pins that I have connected DISP to so far, all seem to default to HIGH when the Pi is powered on. For this you will need to write a small program that will run at both boot and shutdown to ensure the DISP pin to LOW, thus deactivating the MemoryLCD until you decide to run whatever program that uses it.
The third method is to run your program as a properly written service that starts at boot and stops at shutdown, managing not just the setting of the DISP pin but also the squarewave generation for EXTCOMIN.
First, a warning on connecting the Memory LCD breakout board to the Pi:
I have had a powered-on Pi switch itself off upon inserting a breakout board into a breadboard that already had the necessary connections made with the Pi’s GPIOs.
So, save any open files and power your Pi down gracefully before connecting a Memory LCD to it.
Also, while reading this section you may find it helpful to refer to the Raspberry Pi GPIO diagram here.
You must make the following connections between the Pi’s GPIO pins and the breakout board header to make the demo run. You can alter the GPIO pins used in your own code for SCS, DISP and, EXTCOMIN by changing the pins given when the Memory LCD constructor is called. NB: SI and SCLK cannot be changed.
Connections from Breakout Board –> Raspberry Pi:
DISP –> “GPIO 24” [can be changed]
EXTCOMIN –> “GPIO 25” [can be changed] (or connect EXCOMIN to the output of a 555 timer)
SCS –> “GPIO 23” [can be changed]
SI –> “GPIO 10 (MOSI)” [Must be on this pin, is dedicated bcm2835 hardware SPI pin]
SCLK –> “GPIO 11 (SCLK)” [Must be on this pin, is dedicated bcm2835 hardware SPI pin]
Vin –> 5V or 3V3 depending on minimum Vin of your Memory LCD model [can be changed]
GND –> GND [can be changed, multiple GND connections on the GPIO header]
Jumper settings (on rear of breakout board):
JP1 = HIGH for hardware control, or LOW for software control (see above)
JP2 = Set according to your model of LCD
Download the zip file from GitHub and extract it a directory of your choice within your HOME directory using the following commands:
Now, in addition to the Memory LCD library for Raspberry Pi from my GitHub page, it is essential to install the C library for the Pi’s Broadcom BCM 2835 chip. This library allows direct control of the GPIO pins. The library’s home is here and the all important documentation and API can be read here.
Use the following commands to download and install it (NB: version number may change, check website for latest version before entering these commands):
tar zxvf bcm2835-1.38.tar.gz
sudo make check
sudo make install
Now, before you compile and run the Memory LCD demo program, you must first open the MemoryLCD.h file and edit the LCDWIDTH and LCDHEIGHT defines such that they match the pixel dimensions of your particular LCD:
#define LCDWIDTH 96
#define LCDHEIGHT 96
must be changed to match the dimensions of your particular model of Memory LCD in pixels. The boards I am selling are either (WxH) 96×96 pixels, 128×128 pixels, or 400×240 pixels.
If everything has gone to plan, change to the demo directory within the Memory-LCD-for-Raspberry-Pi-master/ directory and compile, link and run the demo program
A few weeks ago, I got lucky while poking around in the skips at the back of a local business that’s undergoing refurbishment. They’d just upgraded their IT hardware and had thrown out their old thin client PCs.
I asked if I could have them and I was duly allowed to take them.
They’re mostly Neoware CA9 thin clients purchased between 2006 and 2009 if you date them according the earliest PAT stickers they had plastered over their sides.
Their spec is:
800MHz Via processor
512MB DOM (Disk On Module – a flash drive plugged directly onto a 44 pin IDE motherboard header.)
3x USB (2x front, 1x rear)
Mic in, Line out
1x Parallel Port
The spec doesn’t look too bad – if you think of them as a step up from a Raspberry Pi, They’re both 800MHz, 512MB machines, but the Neoware has the advantages of a built in PSU, i686 architecture and the ability to boot from a proper hard drive connected to a proper hard drive interface.
The immediate problem was that they were all dirty and a very lengthy cleaning and de-stickering session followed. It was a case of
“Don’t turn it on! Decontaminate it!”
Piles of PAT stickers, asset tracking stickers in triplicate, motivational slogans, the 10 step checklist that employees were supposed to follow before switching the PC on each morning… all had to be removed along with a thick film of dirt and after all that it turned out that they were silver machines, not matte grey! Thankfully though, the thin clients are fanless, so despite all the external muck, the insides weren’t bunged up with 8 years worth of fluff and hair.
After cleaning them, the joy I felt at getting my first big dumpster dive score in ages started to fade as I tested them all and rapidly discovered that around 50% were either dead or too unreliable to use. An up-to-date PAT sticker on the side was no indication that the machine would actually boot.
However I’ve started the process of repairing the faulty ones and with the exception of one unfortunate machine which bore the tell-tale scars of having been dropped from a great height onto a hard surface, the fault with the others has always been a failed capacitor (or two, or three…) in the power supply.