Tips for Driving LCDs
   

Tips for Driving LCDs


By Ronald Gonzalez and Tatiana Orofino

Are you looking for a solution to drive liquid crystal displays (LCDs) with up to 320 segments? This article will provide you the path to using two Freescale 8-bit MC9S08LC60 (LC60) microcontrollers (MCUs), as well as instruction on making hardware connections that take full advantage of the LCD control and synchronization between the two MCUs.


Introduction


The LC60 is a member of the cost-effective, high-performance S08 family. This device has a rich set of peripherals and an LCD module which is able to drive displays with up to 160 segments. A 12-bit ADC offers high-precision analog to digital conversion. In addition, flash is configured in two independent arrays, allowing part of it to be used as EEPROM while the application runs. All these features are executed with very low power consumption, characteristic of the S08 architecture, making it attractive for battery-powered and handheld applications. This 8-bit MCU offers a high-integration level ideal for applications such as thermostats, calculators, digital multi-meters, medical monitoring devices, toys and appliances. The powerful peripherals and LCD module help reduce stress on the core. See the block diagram provided in Figure 1 to see how the additional hardware modules work.


LCD Characteristics


The TN-type LCD glass compatible with MC9S08LC60 should follow the specifications below:

  • LCD operating voltage-typical values for LCD glass operating voltage are 3 or 5V. The operating voltage is the nominal voltage level threshold to power on a segment.
  • Current consumption-related to the total segment area
  • View area-related to the size of the LCD glass
  • Driving mode-duty cycle (1/2, 1/3 and 1/4) and bias (1/3)
  • View angle-3 o'clock, 6 o'clock, 9 o'clock and 12 o'clock
  • View mode-reflective, transmissive and transflective
  • Operating temperature-varies

To have 160 segments driven by the LC60 MCU, 40 front planes and four backplanes are combined in a matrix structure with the front planes as rows and backplanes as columns. LC60 MCUs provide four voltage levels for front planes and backplanes, generating all the necessary waveforms for driving all segments. No external voltage regulator is required to drive these levels. One example can be viewed in Figure 2, which considers ½ Duty Cycle and ½ Bias ratios (three voltage levels). The data is loaded to the LCD display when registers LCDRAM [0..20] are loaded with new values. Turning a segment on or off is just a matter of setting or clearing one bit. Please read AN3280, "Interfacing an LCD to MC9S08LC60," for detailed information.


Figure 1: MC9S08LC60 Block Diagram

An LC60 MCU can drive LCD displays with up to 160 segments, therefore, two of them will be used to drive 320-segments LCDs. There are a few topics to be considered when connecting two MC9S08LC60 to a single LCD, such as:

  • Backplane control
    Only one of the two LC60 MCUs should drive the four backplanes having their signals connected directly to the pins of the display.
  • Front plane control
    Each LC60 MCU can control 40 front planes. Together they'll be able to drive 80. Therefore, they must exchange commands and data every time the display needs updating. The suggested interface is I2C, with one LC60 MCU as the Master and one LC60 MCU as the Slave.
  • Clock synchronization
    Each MCU will control half of the LCD front planes. However, only the Master will generate the backplane signals that will be connected to the LCD. For each segment to be turned on, a specific combination between backplanes and front planes is required. In that way, as front planes and backplanes are configured in a matrix structure, any changes to a front plane or backplane signal would require both Slave and Master to have updated synchronization. Therefore, microcontrollers must update LCDRAM and enable segments simultaneously, to have the same clock for synchronization.



Figure 2: Waveforms for LCDs with 1/2 Duty and 1/2 Bias Ratios

Figure 3 shows a block diagram of the system using two MCUs and a 320-segment LCD display.


Figure 3: System Block Diagram


LCD Initialization Module


The flowchart in Figure 4 represents a suggested LCD initialization routine from Master perspective. This ensures both LC60 MCUs enable the front planes they control simultaneously. After the I2C interface is already configured, the LCD controlled by the Master must be initialized but not enabled. It will be enabled only after the confirmation, via I2C, that the Slave has successfully received all transferred data and is ready to enable the LCD it controls. A keyboard interrupt (KBI) signal is sent to the Slave and both do the LCD enabling synchronously. This interrupt is referred to in the flowcharts as "initOK" command.

At the Slave perspective (see Figure 5), it should first initialize its LCD module, receive all data to be loaded in the LCD glass through I2C and store it in RAM and inform Master that transfer is finished. When initOK is detected (signal sent from Master), it enables the LCD.


Figure 4 and 5: LCD Initialization Module


LCD Data Update


When the display needs updating, a single writing to RAM registers wouldn't be simultaneous at the Master and Slave because Slave must wait for data transmission from Master before display updating. We suggest a mirror, which is a reserved space in Master and Slave RAMs, that receives and stores new LCD data for front planes controlled by Master and front planes controlled by Slave, respectively. These mirrors must have the same size as LCDRAM registers. For data updating in both LCD halves, it's necessary to have all data transferred to mirrors in both LC60 MCUs which stores the new content until theyre synchronized.

After I2C signaling, content should be copied into LCDRAM registers at Master- and Slave- sides. Figures 6 and 7 show the flowcharts.

The Master MCU must transfer content to the "lower" LCD-the 40 front planes controlled by the Slave MCU-and wait until the transfer gets acknowledged.

Another keyboard interrupt signal, called mesgOK in this article, must be sent to the Slave. Only after it detects this signal will it start transferring it to its LCDRAM registers.


Figure 6 and 7: LCD Data Update


Summary


This advanced member of the S08 family, MC9S08LC60, comes to add value to Freescale's broad 8-bit microcontroller portfolio. It's cost-effective and easy to implement multiple MCUs to drive LCD displays through I2C.


References


All resources are available for electronic access at www.freescale.com.

Daniel Malik, "XGATE Library: TN/STN LCD Driver", Freescale Application Note, AN3219.

Steven Torres, "Interfacing a LCD to the MC9S08LC60", Freescale Application Note, AN3280.

Steven Torres, "Software to Accompany AN3219 Interfacing a LCD to the MC9S08LC60". Freescale Application Note, AN3280SW1.

This product incorporates SuperFlash® technology licensed from SST.

Download Article PDF >

Ronald Gonzalez worked as a developer at Philips for 11 years and has been a Freescale Latin America FAE since 1999, supporting automotive and home appliance customers in the region.

Tatiana Orofino is a computer engineer and has worked as a Freescale Latin America FAE since 2005, supporting customers globally as well as ZigBee® technology and ColdFire® products in the region.


Return to Top Return to Top