Character LCD display, it is a dedicated to display letters, numbers, symbols and other dot matrix LCD module. Character type LCD, can display 16x02 or 32 characters at the same time.
It consists of a number of 5X7 or 5X11 and other lattice character bit, each bitmap character bits can display a character, each bit between a dot pitch interval between each line also has a distance, played a character spacing and line The role of spacing, because of this so it does not show the graphics well
The character memory (CGROM) inside the LCD module has stored 160 different dot matrix character graphics, such as Arabic numerals, capital letters in English letters, commonly used symbols, and Japanese kana, and each character has a Fixed code, such as the capital of the English letter "A" code is 01000001B (41H), the display module to address 41H dot matrix graphic display, we can see the letter "A". Because 1602 is to identify the ASCII code, the test can be directly assigned to the ASCII code, in the microcontroller programming can also be used character constant or variable assignment, such as 'A'
Show custom characters
First get the desired Chinese or graphic font array. Through the font software can not directly extract 5 * 8 dot matrix font data, you can manually extract the method
Save the generated array of lattice to CGRAM memory to generate custom characters. 1602 internal CGRAM is used for custom character dot matrix storage for a total of 64 bytes. From the previous step lattice extraction we can see that each character consists of 8 bytes of data. So 64 bytes of CGRAM memory, can store 8 sets of custom characters dot matrix array. According to the CGRAM address is divided into 0-7 for the first group, 8-15 for the second group, followed by 56-63 for the eighth group of data. The array of custom characters is stored in a group of 8 bytes in the CGRAM
After the custom character is stored in any group of CGRAM, each group (8 bytes) also has a display code. In the order of 00H-07H. Display, as long as the call of each group of code, that can display the corresponding characters.
When the internal common characters are displayed, the display code starts at 0x20. 0x00-0x0f is specifically reserved for custom characters. 0x00-0x07 and 0x08-0x0f content is the same. For example: call 0x01 position and 0x09 location, the contents of the display is the same. Directly in accordance with the display of a single character call display function, you can display the custom characters.