Lumex Display with Microchip Driver for a TI MCU
LCDs have displaced LEDs for many embedded systems and there are several reasons why OLEDs haven’t completely taken over. Stuart uses a Lumex LCD with a Microchip driver for a TMC4 MCU to demonstrate the optimal setup. He then runs through some key criteria for selecting a display including customized options.
LCDs (liquid crystal displays) are used in a lot of modern electronics today. Most computer monitors and televisions are LCDs. Small embedded systems have LCDs. Although OLEDs have replaced LCDs in some applications, LCDs still find plenty of use.
LCDs have mostly displaced the older LED displays for alphanumeric information. LCDs are lighter, draw much less current, and can be read in conditions of high ambient light, such as sunlight. With a backlight, they can be read in low light or total darkness, although at the cost of increased power consumption.
We often use LCD modules with integrated controller ICs that provide a parallel, SPI, or I²C interface. An example would be the Lumex LCM-S01602DSF/C 2-line x 16-character alphanumeric display with a parallel interface. High volume electronics often use LCDs without an embedded controller, the LCD module is soldered to the PCBA and controlled directly by the MCU, or by a controller that is in turn controlled by the MCU. An LCD without a driver is sometimes referred to as just the ”glass”.
OLED: What about OLEDs or Organic Light-Emitting Diodes? An OLED uses more power than an LCD, but that’s not really a fair comparison. A bare LCD is a reflective device, so it doesn’t work well in low-light situations. An OLED is a light-emitting device, so it will work in low light. When you compare an LCD with an added backlight to an equivalent OLED display, the OLED may use less power. But this article is about LCDs.
LCD CONSTRUCTION
An LCD consists of a liquid crystal material sandwiched between two polarizers and then two transparent electrodes. There will be one electrode for each segment or dot in the display. When an electric field is applied to the electrodes, the liquid crystal polarization changes and the dot or segment appears black when viewed through the polarizer.
If you’ve worked with seven-segment LED displays, you know that they are illuminated by driving a common pin (anode or cathode) of the display and then driving the segment pin to illuminate the segment. If the display is common cathode, you’ll drive the cathode low and drive the anodes high to turn on the segments. For a multi-digit display, there will typically be one common anode or one common cathode for each digit and usually the segment pins are shared, so you turn on one digit at a time. You display a multi-digit number by sweeping through the entire display, turning on one digit at a time, fast enough that the human eye doesn’t detect the flicker.
An LCD works similarly, but with one major difference. An LED display is controlled by a DC current, and the brightness of the display is a function of the LED characteristics, the current, and if it’s a multiplexed display, the duty cycle of each digit.
An LCD doesn’t use DC current to illuminate the display, instead an AC voltage is applied. The display will typically have a common pin and then a pin for each segment. An AC voltage is applied to the common pin, and then an AC voltage is applied to the individual segment pins. If the segment AC voltage is in-phase with the common voltage, the segment is invisible. If the voltages are out of phase, the segment is visible.
Figure 1 and Figure 2 show the difference. In Figure 1, the segment pin AC voltage is in-phase with the COM pin voltage, and the segment would not be visible. In Figure 2, the AC voltage is out of phase with the COM pin and the segment would be visible. In both pictures, the yellow trace is the COM signal and the blue trace is the segment signal.
The obvious question is, how do you produce an AC voltage to drive the LCD in a system with a single supply voltage? The key is that the LCD responds to the difference between the COM pin and the segment pins. As long as the COM pin and the segment pins get the same in-phase or out-of-phase signal, the LCD will work.
Figure 3 and Figure 4 show schematics of a simple controller to drive a 3-digit, seven-segment LCD, a Lumex S301C31TR. It is driven with a Microchip AY0438 LCD driver. The AY0438 is controlled from the TI TM4C1233H6PM MCU using an SPI interface. If you’ve seen other projects I’ve done using the TI MCU (e.g. December 2023), you’ll recognize this schematic. The MCU is on a development board that I use for this sort of thing, and as always, I’ve deleted from the schematic anything that isn’t relevant to this project.
Connector J3 is the programming connector. A schematic of the serial port programming adapter is included in the files on the Circuit Cellar website.[1] This is the same programming adapter I’ve used in earlier TM4C projects. The MCU software was created in TI Code Composer Studio.
Figure 5 shows the LCD. It has three digits and there is one COM pin and a pin for each segment on the display. Including the decimal points, that’s a total of 23 segments that have to be driven (the least-significant segment doesn’t have a decimal point). With the COM pin, that is a total of 24 pins.
It would be possible to drive the LCD directly from the MCU, if I had used a 3.3V LCD. But I elected to use an LCD controller. Whether you can directly drive an LCD with an MCU depends on how many pins the LCD needs compared to the number of free I/O pins on the MCU. In addition, the LCD has to be able to operate at the MCU voltage, unless voltage translation is added. If the LCD is directly driven from the MCU, then the MCU has to generate the in-phase and out-of-phase signals to each pin to keep each segment illuminated.
DIRECT MCU DRIVE
Since the frequency is low (see the description of the controller) applying signals to the segment pins won’t be a huge workload for even an 8-bit MCU. One way to do this is for the firmware to store the value of each I/O pin and XOR each bit (including the COM bit) when toggling the display. So any bit that is the same value as the COM bit would change with the COM bit when it inverts, and remain off. Any bit that is the opposite value will be on. As long as all bits are switched at the same time, the in-phase and out-of-phase states will remain consistent with each update.
When a segment needs to change state (say a digit switches from 3 to 4, requiring the segments for that digit to change) the firmware will look up the new values and make them the same or the opposite of the current state of the COM bit, as needed. If the COM bit and segment switching is driven by an interrupt, it would be necessary to either disable the interrupt when changing values, or else do the segment value updates inside the ISR (Interrupt Service Routine). Otherwise, the segment may get out of phase if an interrupt occurs while they are being changed. Of course, driving even this simple LCD directly from the MCU uses 24 pins of the MCU.
LCD CONTROLLER
The AY0438 in the example has 32 outputs for LCD segments and one output for the LCD common pin. Internally, there is a 32-bit shift register that is written by the MCU via the SPI interface. When all 32 bits are shifted in, a load signal is strobed by the MCU to clock the 32-bit value into a register. The AY0438 drives each output to be in phase with the COM pin if the bit is low, making the corresponding LCD segment blank. If the bit is high, the output is driven out of phase with the COM pin, making the LCD segment dark. Only the lower 23 segment pins are used in this project.
The AY0438 contains an internal oscillator that can be driven from an external signal, but it will self-oscillate with an external capacitor. I used a capacitor; 22pf produces an LCD clock at about 100 Hz. Using the AY0438, the MCU only needs 3 pins to drive all 24 LCD pins, and the AC drive waveform is generated by the AY0438, so the MCU doesn’t have to generate it. The MCU only interacts with the AY0438 when the displayed value has to change.
If you need to drive more than 32 segments, you can cascade two or more AY0438 devices by connecting the SPI clock and load pins to all the AY0438 devices, and connecting the data out of one AY0438 to the data in of the next. The SPI bits will be shifted through the first AY0438 to the second from the second to the third, and so on. Of course, this means that if you cascade two AY0438 devices, you need to send 64 bits of SPI data each time you update the LCD. If you cascade three of them, you have to send 96 bits, and so on.
OTHER CONTROLLERS
I used the AY0438 because I was just driving a 3-digit, 7-segment LCD, and because the AY0438 is available in a DIP package, so I didn’t need to fabricate a PCB for it. Other controllers are available for situations that need to drive more segments, or dots on a dot-matrix display. For example, the Rohm BU97950AFUV can drive up to 280 segments or pixels and interfaces to an MCU using the 2-wire I²C interface. It uses a 48-pin TSSOP package. The BU97950AFUV has 35 segment pins and up to 8 COM pins, so it is for driving LCDs with multiple COM pins, which means the LCD has to have groups of segments that are multiplexed by driving the COM pin for each group. The NXP PCA85233 can drive up to 320 pixels (80 x 4 configuration), uses the 2-wire I²C and comes in a bare die package.
INTEGRATED LCD CONTROLLERS
Some MCUs come with integrated LCD controllers. The STM32L152R6T6A has an integrated LCD controller that can manage up to 8 x 40 segments, or 320 pixels. This is suitable for a small display in an embedded application. Of course, this takes a lot of pins and requires a compatible display. The STM32L152R6T6A LCD controller can function as a display driver; the controller can display directly from memory without continuous MCU intervention.
WHY GO DIRECT?
Why would you directly drive an LCD like this instead of using an LCD module with a built-in controller, or even an LED? For a hobby project, you might not. But here are some reasons you would want to do this:
Lower power: An LCD takes less power than an LED. So if the choice is between a 7-segment LCD and a 7-segment LED, the LCD is the clear winner. All else being equal, the LCD takes less power. Now since the LCD requires a controller or a lot of MCU pins to drive the segment pins, there may be more hardware required. An alphanumeric LCD module has a controller, it’s just embedded in the module.
Daylight operation: An LCD is visible at light levels that would wash out an LED display. And with a backlight (which the example LCD doesn’t have) it’s still visible in low light. So a product (such as a tool to measure voltage, temperature, or water quality) that is used outdoors will probably work better with an LCD than and LED. But, again, an off-the-shelf LCD module with a built-in controller would also fit such applications.
Custom display: This is the real reason you would normally use some kind of controller to drive a bare LCD. If you are driving an LCD on an automobile dashboard or a custom display on an appliance console, or any other application requiring a unique LCD, you have to provide the drive circuitry. You might find a supplier who can provide both the LCD and the controller in a package, but someone has to design the controller that controls the segments in that custom LCD. Use of a custom LCD normally implies high enough production volume to justify the cost of having a custom display designed and manufactured, so it’s not something you would use in a hobbyist project. Although the tooling cost for a custom LCD is low enough from some suppliers (a few hundred dollars) that if you really wanted a slick looking hobbyist project, it’s not completely unreasonable.
SPECIFYING A CUSTOM DISPLAY
The things your display supplier has to know are the things that fully specify the LCD so it can be tooled and built. Figure 6 shows a custom display that might be for some product such as the water quality sensor mentioned earlier. It has a 3-digit 7-segment display, a 2-digit 7-segment display, a BATT indicator that can be turned on or off (or blinked to indicate low battery), a 5-segment battery charge indicator, a ‘SENSOR’ indicator to flash if the sensor isn’t connected or isn’t working, and a ‘FAIL’ indicator to turn on if the water quality (or whatever is being measured) is bad.
Segments: The first thing you need to do is determine the number of segments on the display. The 7-segment digits are 7 segments each, for a total of 35 segments. The battery charge indicator is 5 segments. The BATT, SENSOR, and FAIL indicators would be one segment each. You might make each letter of each word a segment, but since you will be turning on each word as a word and not individual letters, you only need one segment for each (for example, BATT will always be on or off, never BA or AT).
The total number of segments is 43. You could control this with two cascaded AY0438 controllers, or you could have a COM pin for the 3-digit display, a COM pin for the 2-digit display, and a COM pin for the remaining segments. The largest number of segments for each COM pin would be the 3-digit LCD at 21 segments. This would let you use a controller such as the STM32L152R6T6A or any controller that has at least 3 COM outputs and 21 or more segment outputs.
The display manufacturer has to bring each segment out to a pin, so you may have to work with the manufacturer to get the displayed segments arranged so that all of them can be driven. This might mean increasing the space between the BATT indicator and the battery bar-graph segments or something similar. Generally, you can’t have a segment that is surrounded by another segment (an island) unless they are turned on and off together. The middle segment in the 7-segment displays looks like an island but if you look closely at a real LCD, there is a tiny gap between each of the segments.
Other things the supplier would need include:
A drawing: This seems obvious, but the supplier will need to know what it looks like, sizes of any icons or segments, and the overall form factor. The supplier may require a specific format such as DXF (Autocad) or a Solidworks file. You’ll need to find out what the supplier can work with.
Viewing mode: Positive or negative. Positive mode has black (or dark) segments on a lighter background. The example circuit uses a positive LCD; black (really dark gray) segments on a lighter gray background. Negative mode has a darker background and lighter segments. In positive mode, if the pixel is turned off, it is transparent, and when it is on it is opaque. Negative mode is the reverse of that.
Operating temperature range: This isn’t really a specification so much as a choice. Depending on the supplier, you’ll be able to select commercial temperature range, industrial, automotive, or military.
Backlight: This may be an option, depending on supplier, and could be LED, fluorescent, or EL (electroluminescent).
Technology: TN (twisted nematic), STN (super twisted nematic) and others. The technology determines the viewing angle, amount of contrast, NRE cost, and final cost. This is something you’ll probably need to work on with the supplier unless you’ve got specific constraints that limit your choices.
Drive voltage: Typically, the options are 2V, 3V, or 5V. Actual voltages available will depend on the supplier, so if you need something weird like 18V drive, your choice of suppliers may be limited.
Static vs multiplexed drive: Put simply, this is whether there is one COM pin and one pin for each segment, or whether there are multiple COM pins and shared segment pins. As with any kind of multiplexed display, static drive will produce a “brighter” (higher contrast) display but requires more pins. In a multiplexed 8-digit LED display, you might have 7-segment pins and 8 anode or cathode pins, allowing you to illuminate one digit at a time. Or you could use two 4-digit displays, resulting in 8 anodes but 14 segment pins, allowing you to turn on two digits (one in each display) at a time. But that requires 7 extra segment drive pins (8 if there is a decimal point). This provides a brighter display at the cost of higher current and at least seven additional pins. A multiplexed LCD with multiple COM pins is essentially the same concept.
— ADVERTISMENT—
—Advertise Here—
For the custom LCD example, if maximum contrast is required, you would specify a static drive but you would then need a driver with a COM output and at least 43 separate segment driver pins. Keep in mind that the LCD will need as many pins as there are segment pins plus COM pins. A multiplexed display as described earlier would need 24 (21 + 3) pins.
Production quantity: If you want a small quantity for, say, a hobby project, this may limit your choice of suppliers. Like many other things, such as PCBs, some suppliers have minimum order quantities, others will accept smaller orders, although the per-part price will likely be higher. Custom LCDs are really suited for high volume manufacturing (1000 or so per year) but there are some suppliers who will provide smaller quantities. But you might not get all the options from some suppliers.
DISPLAY SUPPLIER
Pacific Display Devices (see Resoures) has some very good web pages describing what is needed to specify a custom display. The information is specific to their products but is not atypical. If you have special requirements, you’ll have to work with the supplier to see what they can fabricate. But if you are doing a display for a low-volume product or hobby project, you will likely avoid anything too strange. I’m not recommending for or against Pacific Display specifically, I’ve never worked with them. I’m just recommending their informational pages.
CONCLUSION:
LCDs use less power than an equivalent LED display, and can be customized for your application. They are more complex to drive than older LED-only displays. Hopefully this has provided an overview of what’s involved.
RESOURCES
AY0438 datasheet: http://ww1.microchip.com/downloads/en/devicedoc/80438a.pdf
TB67S111 datasheet: Pacific Display: http://pacificdisplay.com/
PUBLISHED IN CIRCUIT CELLAR MAGAZINE • DECEMBER 2024 #413 – Get a PDF of the issue
Sponsor this ArticleStuart Ball recently retired from a 40+ year career as an electrical engineer and engineering manager. His most recent position was as a Principal Engineer at Seagate Technologies.






