logo
English
Home News

Intuitive STN LCD Control Interface

China ESEN HK LIMITED certification
China ESEN HK LIMITED certification
Excellent service gives us confidence in your products.

—— Henry

In the process of cooperation, the technical team responded quickly and solved the various problems we encountered in a timely manner, so that our production process can be carried out smoothly, and we look forward to more cooperation in the future.

—— Ford

After-sales service team is very professional, regular visits and technical support, so that we have no worries.

—— Marco

A reliable partner for our company.

—— Mia

I'm Online Chat Now
Company News
Intuitive STN LCD Control Interface
Latest company news about Intuitive STN LCD Control Interface

ESEN offers a wide range of standard character LCD modules for customers' applications. You can achieve display with the minimum number of control pins, making it easier to select the MCU.

The common Character LCD Modules in the market will add a transfer board to support I2C interface as figure 1 shows, which lead to the increase of LCM thickness, more processes in manufacturing and the lower yield rate.

latest company news about Intuitive STN LCD Control Interface  0 latest company news about Intuitive STN LCD Control Interface  1
Figure 1: The common Character LCD Module in the market which add a transfer board to support I2C. Figure 2: 1602 character liquid crystal module of ESEN. It supports I2C and SPI interfaces and does not require an additional transmission board.


You don't need to add a relay board. Just connect the Arduino Uno development board, and you can directly control the character LCD module using different communication interfaces.

Identify the LCM's pin define

Table 1:LCM pin define
Pin No. Symbol Description
No.1 Vss Ground
No.2 Vdd Power supply for logic
No.3 V0 Contrast Adjustment
No.4 RS Command/data selection
No.5 RW Read/Write select signal for interface 6800 8/4bit only
No.6 E Enable signal for interface 6800 8/4bit only
No.7 DB0/SA0 Data bus line 0 for 6800 8bit interface only
SA0 address setting line for I2C interface
No.8 DB1/SA1 Data bus line 1 for 6800 8bit interface only
SA1 address setting line for I2C interface
No.9 DB2 Data bus line 2 for 6800 8bit interface only
No.10 DB3 Data bus line 3 for 6800 8bit interface only
No.11 DB4 Data bus line 4 for 6800 8/4bit interface only
No.12 DB5/CSB/CSB Data bus line 5 for 6800 8/4bit interface only
CSB enable selection lines for I2C & SPI interface
No.13 DB6/SDA/SCLK Data bus line 6 for 6800 8/4bit interface only
SDA data line for I2C interface
SCLK timing for SP Interface
No.14 DB7/SCL/SID Data bus line 7 for 6800 8/4bit interface only
SCL timing line for I2C interface
SID data line for SPI interface
No.15 A+ Power supply for B/L +
No.16 K- Power supply for B/L -


Regarding V0 in the above table, a 20k Ohm variable resistor is used to adjust the contrast of characters. If the text is invisible or it continues to display the background image during the test, please turn this variable resistor to adjust the contrast.

The connection method of V0 variable resistor as shown in Figure 3:

latest company news about Intuitive STN LCD Control Interface  2
Figure 3:V0 variable resistor connection method


How to connect LCM and development board Arduino Uno

 

The connection methods of four LCM communication interfaces (I2C, SPI, 6800 8bit/4bit) to Arduino Uno as shown in Figure 4. The users can observe that the I2C and SPI interfaces only need a small number of GPIO pins to control the Character LCD modules.

For I2C interface, since Arduino Uno provides the pull-up resistors inside the I2C pins, there are no additional pull-up resistors connected to SDA and SCL pins. If the internal pull-up resistor is disabled in the program, an external pull-up resistor must be connected.

(a)I2C interface connection
 
(b) SPI interface connection
 
latest company news about Intuitive STN LCD Control Interface  3             
 
             latest company news about Intuitive STN LCD Control Interface  4
 
(c)6800-4bit interface connection
 
(d)6800-8bit interface connection
 
latest company news about Intuitive STN LCD Control Interface  5             
 
             latest company news about Intuitive STN LCD Control Interface  6
 
Figure 4:Connection methods of 4 LCM communication interfaces to Arduino Uno.


LCM Commands

Not every communication interface can use the full command set of LCM; with SPI interface, there is no RW control line and MISO pins, therefore, the read command is not supported. For writing, through RS control line to determine whether to write command data or display data.

In the I2C interface, there is also no RW control line so there is no support for read commands either. Before writing command data or display data, the command control code (A0=0) or data control code (A0=1) has to be sent to determine whether the next byte to be sent is command data or display data.

SPI and I2C Interface Timing

Two timing diagrams are shown in Figure 5 and Figure 6. It is the timing diagram of controlling the LCM through the SPI interface. The users can observe that the LCM uses an SPI that is not the typical SPI interface provided by a typical MCU, it requires an additional RS signal line to determine whether the current byte being sent is a command? or data? The bit data (BIT7~BIT0) of the data line (SID) changes when the clock line (SCLK) is at low level. The bit (BIT7~BIT0) data is captured when the clock line (SCLK) is high level (BIT7~BIT0).

latest company news about Intuitive STN LCD Control Interface  7
Figure 5:Timing of SPI write command
latest company news about Intuitive STN LCD Control Interface  8
Figure 6:Timing of SPI write data


Figure 7 and 8 show the timing diagram of controlling the LCM through the I2C interface. Except for the chip select bar (CSB), readers can observe that the I2C interface control is to send three bytes each time to write a command data or display data. Among them, the A0 bit of the second byte will determine whether the third byte is command data or display data.

latest company news about Intuitive STN LCD Control Interface  9
Figure 7:I2C Timing of writing commands
latest company news about Intuitive STN LCD Control Interface  10
Figure 8:I2C Timing of writing data


Code

The LCM can be compiled and used directly by modifying the program settings.

Step1: set the maximum number of characters in a single line of LCM.
For example, the following sets a single line to have a maximum of 16 characters.

latest company news about Intuitive STN LCD Control Interface  11

Step2: set the maximum number of lines in the LCM.
For example, the following sets the LCM to have 2 lines.

latest company news about Intuitive STN LCD Control Interface  12

Step3: set the LCM interface.
For example, the following sets I2C interface.

latest company news about Intuitive STN LCD Control Interface  13

Step4: compile and upload the program to the Arduino Uno development board.
Figure 9 shows a schematic diagram of the screens of three LCMs.
When the display contrast is light or dark, the variable resistor at the V0 pin can be adjusted to an appropriate contrast, as shown in Figure 10.

(a) Light contrast Only light characters can be seen. (b) Appropriate contrast (c) Dark contrast Each character has an obvious shadow.
latest company news about Intuitive STN LCD Control Interface  14 latest company news about Intuitive STN LCD Control Interface  15 latest company news about Intuitive STN LCD Control Interface  16
latest company news about Intuitive STN LCD Control Interface  17 latest company news about Intuitive STN LCD Control Interface  18 latest company news about Intuitive STN LCD Control Interface  19
latest company news about Intuitive STN LCD Control Interface  20 latest company news about Intuitive STN LCD Control Interface  21 latest company news about Intuitive STN LCD Control Interface  22
Figure 9:a schematic diagram of the screens of three LCMs
 

latest company news about Intuitive STN LCD Control Interface  23

Figure 10:the V0 pin is adjustable

If you have demand of full demo code, please contact us.

Pub Time : 2025-07-18 09:00:00 >> News list
Contact Details
ESEN HK LIMITED

Contact Person: Mr. james

Tel: 13924613564

Fax: 86-0755-3693-4482

Send your inquiry directly to us (0 / 3000)