Embedded Development Basic Tutorial: Detailed Explanation of the 16×2 LCD Module

Table of Contents

1. Understanding the Schematic

Hua Xian Jing’s LCD design schematic can be divided into three main areas: the pin information area, the text introduction area, and the LCD module dimensions area.

Design Drawing of HSM1602A-108-A0 Introduction

1.1 Text Introduction Area

This section is added by the designer to summarize the features of the LCD module, allowing users to quickly assess whether it meets their requirements. From the schematic, we can immediately determine that the HSM1602A-108-A0 is a blue STN LCD, with an operating temperature range of -20°C to 70°C, and uses the AIP31066 driver IC. The optimal viewing direction is at 6 o’clock, along with other information related to the HSM1602A-108-A0.

1.2 Pin Information Area

For embedded engineers, this is the most important part of the LCD module schematic. From the schematic, we learn that the pin order of the HSM1602A-108-A0 is from left to right, corresponding to pins 1-16. The pin definitions reveal that the HSM1602A-108-A0 uses an 8-bit MPU interface, with the pin details as follows:

No.SymbolFunction
1VSSGround (0V)
2VDDSupply Voltage for Logic (+5.0V)
3VOContrast Adjustment
4RSData/Instruction Select
5R/WRead/Write Select
6EEnable Signal
7-14DB0-DB7Data Bus
15LED_APower Supply + (5.0V)
16LED_KPower Supply – (0V)

1.3 LCD Module Dimensions Area

This section provides details about the dimensions of the LCD module. However, this information is less relevant for embedded development, such as active and visible areas, so we don’t need to spend much time on it.

2. Detailed Explanation of the AIP31066

Huaxianjing’s HSM1602A-108-A0 uses the AIP31066, a low-power CMOS matrix LCD driver IC produced by Zhongwei Aixin. It supports English, Japanese, Russian, and custom graphic characters.

2.1 Confirming the Interface Information of the AIP31066

Pin Description - AIP31066

The AIP31066 datasheet is very user-friendly, allowing us to easily extract key information. As shown, we can see that pins 38-46 of the AIP31066 correspond to pins 4-14 of the HSM1602A-108-A0 schematic. Additionally, we can determine that the AIP31066 only supports 4-bit and 8-bit MPU connection modes. Based on the pin information of the HSM1602A-108-A0, we know that the 8-bit MPU mode of the AIP31066 is used. The characteristics of the MPU interface indicate that the external CPU can only connect to the LCM through the IC driver to control the LCM, so the AIP31066 should contain CGRAM and CGROM, which is confirmed later in the datasheet.

2.2 Electrical Characteristics of the AIP31066

Electrical Characteristics of AIP31066

As shown in the diagram, the rated voltage range of the AIP31066 is -0.3V to 7.0V. Typically, the working voltage of the LCM in our embedded system is 5V, so we use the 4.5V-5.5V operating range as a reference.

Another important piece of information is that at a 5V operating voltage, the internal clock frequency range of the AIP31066 is 190kHz-350kHz, with a typical value of 270kHz. The external clock frequency range is 125kHz-410kHz, with a typical value of 270kHz. The following diagram shows the level changes in read/write mode and interface mode, which will serve as important reference information during error checking in later work.

waveforms of AIP31066
waveforms-2 of AIP31066

2.3 Interpretation of AIP31066 Registers

Read/Write Operations The AIP31066 has an 8-bit bus, with the data length selected through the DL register. The target RAM is selected using the RAM address setting instruction, and all internal read/write operations to the RAM are completed automatically. Two temporary registers, the Data Register (DR) and the Instruction Register (IR), are used during read/write operations. These registers help overcome the speed difference between the internal clock and the MPU clock. The AIP31066 stores control information in the IR or DR registers to perform internal operations. The DR is a temporary register for writing and reading DDRAM/CGRAM data. When the external MPU reads data from the DR, the DDRAM/CGRAM data is transferred to the DR. Similarly, when the MPU writes data to the DR, it is automatically transferred to the DDRAM/CGRAM. The IR register temporarily stores instructions from the MPU. However, the MPU cannot read the instruction code, which can only be controlled through the RS pin. Various kinds of Operations according to RS and R/W bits:
RS R/W Operation
0 0 Instruction Write Operation (MPU writes Instruction code  into IR)
0 1 Read Busy flag (DB7) and address counter (DB0 to DB6)
1 0 Data Write operation (MPU write data into DR)
1 1 Data Read operation(MPU reads data from DR)

2.4 Function Settings

  • DL (Data Length Control Bit):
    When DL is high, it indicates an 8-bit bus connection to the MPU.
    When DL is low, it indicates a 4-bit bus connection to the MPU.
    Therefore, DL is the signal for selecting 8-bit or 4-bit bus mode. In 4-bit bus mode, data needs to be transferred twice in 4-bit chunks.

  • N (Display Line Control Bit):
    When N is low, it is in 1-line display mode.
    When N is high, it is in 2-line display mode.

  • F (Font Type Control Bit):
    When F is low, it is in 5×8 dot matrix display mode.
    When F is high, it is in 5×11 dot matrix display mode.

2.4 Some Instruction Tables

AIP31066 Instruction Tables - 1

2. Datasheet

HSM1602A-108-0: Datasheet

AIP31066: Datasheet

Share:
Contact Us
Related Posts
Hua Xian Jing Sales - Lyna Huang

Get A Quick Quote!

Cookie Consent Banner by Real Cookie Banner