I2C Display Communication
The I2C display interface is a common communication protocol for character, graphic, and segment LCDs. An I2C display consists of an LCD controller and a display module. The interface is communicated over two wires which include a data line and a clock line. This resource will explain the process of setting up a display over the I2C interface.
The display used in this example is C162NLGFGSW6WT3CXAH, an FSTN character LCD with 16x2 characters and a gray background. This display is transflective and can be used with or without the backlight. For more information on the display in this application refer to the datasheet.
The features of this display are reviewed below.
|Display Type||Character LCD||-|
|Size||49.7 x 25.3||mm|
The I2C interface is a great option for a quick connection to the display. This interface is typically used for sending initialization commands and data to the display controller. The interface consists of one clock and one data command and therefore is not used for high-speed graphics data.
The I2C interface is used for displays that communicate with less data. For example, a character display operates through 8-bit commands to select preset characters stored in RAM. Additionally, the resolution of a character display is made up of the number of rows and columns of characters which is typically low.
The I2C interface would not be capable of refreshing an image on a TFT display. TFT displays typically have a higher resolution with each pixel containing color data. This interface would not communicate fast enough to update the display with the desired response. However, the I2C interface can be used for TFT initialization commands.
The I2C communication protocol can also be used to communicate with capacitive and resistive touch panel controllers. The standard I2C format reviewed in the following section can apply to a variety of display communication applications.
The I2C interface is used to send initialization commands and RAM data to the display controller. This is done through a clock line and a bidirectional communication line. The two required communication signals are SDA and SCL. The SDA pin is used to send and receive data. The SCL signal is used as the clock.
The two-line communication can be connected to the available I2C interface pins provided by a microcontroller. Preestablished I2C functions can be used to communicate with the display through the standard I2C signal format. Alternatively, any digital data line can can be used for these signals.
Below is the pinout of the display with the I2C pins and their description.
The data and clock lines should be connected to their signal source and to a pull up resistor to a positive supply. A 1 microfarad capacitor should be connected to the capacitor terminal on the display for the voltage boosting circuit of the display.
The clock signal is operated at a frequency of 380 kHz with one data bit being sent per clock pulse. Multiple I2C interfaced devices can be connected to the same data and clock lines in series but addressed individually. The data line SDA communicates to which address is receiving the information if multiple devices are connected.
The display controller used in this application is ST7032. This IC is embedded in the display and is used to control the liquid crystal segments. The data is communicated in 4 and 8-bit formats over the SDA line.
One data bit is communicated per clock pulse of the SCL signal. The SDA bits are sent and received in a sequence defined by the interface. This sequence consists of address, control, and acknowledgement bits.
The data is sent and acknowledged by the display to verify proper communication. The acknowledgement occurs when writing to or reading from the display. Each address, command, and data block is sent as one byte. Each parallel address will receive the same data.
For display communication, the data is sent to registers in RAM to define display parameters where the data is transferred automatically. The control byte is made up of the register command and the continuation bit. The defines whether the control byte is represented as a command or data.
The data is sent to the display following the command sequence. The data can be written to specific locations in RAM or in an incremental stream defined by control parameters. The data is then typically automatically incremented in bytes. This makes writing to the display easier after establishing the control parameters.
It is common for multiple devices to be operated over the same I2C interface. The device is specified in the address byte at the beginning of the I2C communication operation. The devices that are connected in parallel to a specific device address will be addressed individually.
The I2C interface can also be operated with more than one master controller on the same line without corrupting the data. This is done by arbitration of the signals to ensure that only one device is controlling the display at a time.
I2C interfaced displays can be versatile and compatible with numerous other displays and other electronics. This interface is great for displays that only require a small amount of data to operate. The display controllers with prewritten characters and preprogrammed image data would be good options to use the I2C interface.
Buyers and others who are developing systems that incorporate Focus LCDs products (collectively, “Designers”) understand and agree that Designers remain responsible for using their independent analysis, evaluation and judgment in designing their applications and that Designers have full and exclusive responsibility to assure the safety of Designers' applications and compliance of their applications (and of all Focus LCDs products used in or for Designers’ applications) with all applicable regulations, laws and other applicable requirements.
Designer represents that, with respect to their applications, Designer has all the necessary expertise to create and implement safeguards that:
(1) anticipate dangerous consequences of failures
(2) monitor failures and their consequences, and
(3) lessen the likelihood of failures that might cause harm and take appropriate actions.
Designer agrees that prior to using or distributing any applications that include Focus LCDs products, Designer will thoroughly test such applications and the functionality of such Focus LCDs products as used in such applications.