285df164f16ddb8fad2db7b620163803756c642c
Board-dat/Board-DAT.md
| ... | ... | @@ -48,6 +48,8 @@ |
| 48 | 48 | |
| 49 | 49 | - [[DAS1010-dat]] |
| 50 | 50 | |
| 51 | +[[DAS1022-dat]] |
|
| 52 | + |
|
| 51 | 53 | ### DAR |
| 52 | 54 | |
| 53 | 55 | - [[DARS016-dat]] |
| ... | ... | @@ -135,6 +137,8 @@ RPI LCD |
| 135 | 137 | |
| 136 | 138 | LED control - [[ILC1063-dat]] |
| 137 | 139 | |
| 140 | +[[ILC1022-dat]] |
|
| 141 | + |
|
| 138 | 142 | |
| 139 | 143 | ### ILE |
| 140 | 144 |
Board-dat/ILC/ILC1022-dat/ILC1022-dat.md
| ... | ... | @@ -0,0 +1,27 @@ |
| 1 | + |
|
| 2 | +# ILC1022-dat |
|
| 3 | + |
|
| 4 | +## Info |
|
| 5 | + |
|
| 6 | +[product url - 1602 16×2 Char LCD Module, Blue](https://www.electrodragon.com/product/1602-lcd-display-hd44780/) |
|
| 7 | + |
|
| 8 | +main info == [[LCD1602-dat]] |
|
| 9 | + |
|
| 10 | +### Board Map, Dimension, Pins, chip info, Use Guide, Setup Jumper, etc. |
|
| 11 | + |
|
| 12 | +BG color == blue, text == white, 16x2 characters |
|
| 13 | + |
|
| 14 | +## Applications, category, tags, etc. |
|
| 15 | + |
|
| 16 | + |
|
| 17 | + |
|
| 18 | + |
|
| 19 | + |
|
| 20 | + |
|
| 21 | +## ref |
|
| 22 | + |
|
| 23 | +- [[ILC1022]] |
|
| 24 | + |
|
| 25 | +- [[interactive-dat]] |
|
| 26 | + |
|
| 27 | +- [legacy wiki page ](https://w.electrodragon.com/w/1602_LCD) |
Tech-dat/interactive-dat/display-dat/LCD-dat/LCD-dat.md
| ... | ... | @@ -1,8 +1,20 @@ |
| 1 | 1 | |
| 2 | 2 | # LCD-dat |
| 3 | 3 | |
| 4 | +- [[LCD1602-dat]] - [[LCD-12864-dat]] |
|
| 5 | + |
|
| 6 | + |
|
| 7 | +- [[LCD2004-dat]] == [2004A 20*4 Char LCD LCM Display](https://www.electrodragon.com/product/2004a-char-lcdlcm-204-words-support-5v/) |
|
| 8 | + |
|
| 9 | + |
|
| 4 | 10 | ## SCH |
| 5 | 11 | |
| 6 | 12 | using with STM32 SPI2 |
| 7 | 13 | |
| 8 | - |
|
| ... | ... | \ No newline at end of file |
| 0 | + |
|
| 1 | + |
|
| 2 | + |
|
| 3 | + |
|
| 4 | +## ref |
|
| 5 | + |
|
| 6 | +- [[interactive-dat]] |
|
| ... | ... | \ No newline at end of file |
Tech-dat/interactive-dat/display-dat/LCD-dat/LCD1602-dat/2025-06-15-14-08-52.png
| ... | ... | Binary files a/Tech-dat/interactive-dat/display-dat/LCD-dat/LCD1602-dat/2025-06-15-14-08-52.png and /dev/null differ |
Tech-dat/interactive-dat/display-dat/LCD-dat/LCD1602-dat/2025-06-30-14-59-11.png
| ... | ... | Binary files /dev/null and b/Tech-dat/interactive-dat/display-dat/LCD-dat/LCD1602-dat/2025-06-30-14-59-11.png differ |
Tech-dat/interactive-dat/display-dat/LCD-dat/LCD1602-dat/2025-06-30-14-59-24.png
| ... | ... | Binary files /dev/null and b/Tech-dat/interactive-dat/display-dat/LCD-dat/LCD1602-dat/2025-06-30-14-59-24.png differ |
Tech-dat/interactive-dat/display-dat/LCD-dat/LCD1602-dat/LCD1602-code/2025-06-15-14-08-52.png
| ... | ... | Binary files /dev/null and b/Tech-dat/interactive-dat/display-dat/LCD-dat/LCD1602-dat/LCD1602-code/2025-06-15-14-08-52.png differ |
Tech-dat/interactive-dat/display-dat/LCD-dat/LCD1602-dat/LCD1602-code/LCD1602-code.md
| ... | ... | @@ -0,0 +1,61 @@ |
| 1 | + |
|
| 2 | +# LCD1602-code.md |
|
| 3 | + |
|
| 4 | +## arduino code |
|
| 5 | + |
|
| 6 | +code 1 |
|
| 7 | + |
|
| 8 | + #include <Wire.h> |
|
| 9 | + #include <LiquidCrystal_I2C.h> |
|
| 10 | + |
|
| 11 | + LiquidCrystal_I2C lcd(0x27,16,2); // set the LCD address to 0x27 for a 16 chars and 2 line display |
|
| 12 | + |
|
| 13 | + void setup() |
|
| 14 | + { |
|
| 15 | + lcd.init(); |
|
| 16 | + // Print a message to the LCD. |
|
| 17 | + lcd.backlight(); |
|
| 18 | + lcd.print("www.electrodragon.com"); |
|
| 19 | + } |
|
| 20 | + void loop() |
|
| 21 | + { |
|
| 22 | + |
|
| 23 | + } |
|
| 24 | + |
|
| 25 | + |
|
| 26 | + |
|
| 27 | +## C code for 8051 |
|
| 28 | + |
|
| 29 | +At the beginning of the program, the LCD module is initialized and the display format is set. |
|
| 30 | + |
|
| 31 | +Note that when displaying characters, the cursor automatically moves to the right without manual intervention. |
|
| 32 | + |
|
| 33 | +Each time a command is entered, the DELAY subroutine is called first to check if the LCD module is busy, then the display position address 0C0H is entered, and finally the code 41H for the character 'A' to be displayed. |
|
| 34 | + |
|
| 35 | +SMC1602A (16x2) simulated port wiring method |
|
| 36 | + |
|
| 37 | +Wiring diagram: |
|
| 38 | + |
|
| 39 | + LCM---51LCM-----51LCM------51 |
|
| 40 | + DB0-----P1.0 DB4--P1.4 RW-----P2.0 |
|
| 41 | + DB1-----P1.1 DB5--P1.5 RS-----P2.1 |
|
| 42 | + DB2-----P1.2 DB6--P1.6 E-----P2.2 |
|
| 43 | + DB3-----P1.3 DB7--P1.7 VLCD connects a 1K resistor to GND |
|
| 44 | + |
|
| 45 | +[注:AT89S52使用12M晶振] |
|
| 46 | + |
|
| 47 | +- code file == [[lcd1602-c-1.c]] |
|
| 48 | + |
|
| 49 | +## ASM code |
|
| 50 | + |
|
| 51 | +## Demo Code and Video |
|
| 52 | + |
|
| 53 | +The character generator ROM (CGROM) inside the 1602 LCD module already stores 160 different dot-matrix character patterns, as shown in Table 1. These characters include: Arabic numerals, uppercase and lowercase English letters, common symbols, and Japanese kana. Each character has a fixed code. For example, the code for the uppercase English letter "A" is 01000001B (41H). When displayed, the module shows the dot-matrix character pattern at address 41H, so we can see the letter "A". |
|
| 54 | + |
|
| 55 | +Below is a program that displays the letter 'A' at the first character position of the second line of the LCD module: ORG 0000H |
|
| 56 | + |
|
| 57 | +- [[LCD1602-asm.asm]] |
|
| 58 | + |
|
| 59 | +## ref |
|
| 60 | + |
|
| 61 | +- [[LCD1602-dat]] |
|
| ... | ... | \ No newline at end of file |
Tech-dat/interactive-dat/display-dat/LCD-dat/LCD1602-dat/LCD1602-code/lcd1602-asm.asm
| ... | ... | @@ -0,0 +1,54 @@ |
| 1 | +; 确定具体硬件的连接方式 |
|
| 2 | +RSEQUP3.7 |
|
| 3 | +RWEQUP3.6 |
|
| 4 | +EEQUP3.5 |
|
| 5 | + |
|
| 6 | +; 初始化LCD |
|
| 7 | +MOV P1, #00000001B ; 清屏并光标复位 |
|
| 8 | +ACALL ENABLE ; 调用写入命令子程序 |
|
| 9 | + |
|
| 10 | +MOV P1, #00111000B ; 设置显示模式:8位2行5x7点阵 |
|
| 11 | +ACALL ENABLE |
|
| 12 | + |
|
| 13 | +MOV P1, #00001111B ; 显示器开、光标开、光标允许闪烁 |
|
| 14 | +ACALL ENABLE |
|
| 15 | + |
|
| 16 | +MOV P1, #00000110B ; 文字不动,光标自动右移 |
|
| 17 | +ACALL ENABLE |
|
| 18 | + |
|
| 19 | +MOV P1, #0C0H ; 写入显示起始地址(第二行第一个位置) |
|
| 20 | +ACALL ENABLE |
|
| 21 | + |
|
| 22 | +; 写入数据 |
|
| 23 | +MOV P1, #01000001B ; 字母A的代码 |
|
| 24 | +SETB RS ; RS=1 |
|
| 25 | +CLR RW ; RW=0,准备写入数据 |
|
| 26 | +CLR E ; E=0,执行显示命令 |
|
| 27 | +ACALL DELAY ; 半断液晶模块是否忙? |
|
| 28 | +SETB E ; E=1 |
|
| 29 | +AJMP $ ; 显示完成程序停车 |
|
| 30 | + |
|
| 31 | +;------------------------------- |
|
| 32 | +; 子程序部分 |
|
| 33 | +;------------------------------- |
|
| 34 | + |
|
| 35 | +ENABLE: ; 写入控制命令的子程序 |
|
| 36 | +CLR RS |
|
| 37 | +CLR RW |
|
| 38 | +CLR E |
|
| 39 | +ACALL DELAY |
|
| 40 | +SETB E |
|
| 41 | +RET |
|
| 42 | + |
|
| 43 | +DELAY: ; 判断液晶显示器是否忙的子程序 |
|
| 44 | +MOV P1, #0FFH |
|
| 45 | +CLR RS |
|
| 46 | +SETB RW |
|
| 47 | +CLR E |
|
| 48 | +NOP |
|
| 49 | +SETB E |
|
| 50 | +JB P1.7, DELAY ; 如果P1.7为高电平表示忙就循环等待 |
|
| 51 | +RET |
|
| 52 | + |
|
| 53 | +END |
|
| 54 | + |
Tech-dat/interactive-dat/display-dat/LCD-dat/LCD1602-dat/LCD1602-code/lcd1602-c-1.c
| ... | ... | @@ -0,0 +1,128 @@ |
| 1 | +// LCD1602 Control Program (Organized Version) |
|
| 2 | + |
|
| 3 | +#include <reg52.h> // Assuming 8051 MCU, modify as needed |
|
| 4 | + |
|
| 5 | +#define LCM_RW P2_0 // Define pins |
|
| 6 | +#define LCM_RS P2_1 |
|
| 7 | +#define LCM_E P2_2 |
|
| 8 | +#define LCM_Data P1 |
|
| 9 | +#define Busy 0x80 // Used to check the Busy flag in LCM status word |
|
| 10 | + |
|
| 11 | +void WriteDataLCM(unsigned char WDLCM); |
|
| 12 | +void WriteCommandLCM(unsigned char WCLCM, bit BuysC); |
|
| 13 | +unsigned char ReadDataLCM(void); |
|
| 14 | +unsigned char ReadStatusLCM(void); |
|
| 15 | +void LCMInit(void); |
|
| 16 | +void DisplayOneChar(unsigned char X, unsigned char Y, unsigned char DData); |
|
| 17 | +void DisplayListChar(unsigned char X, unsigned char Y, unsigned char code *DData); |
|
| 18 | +void Delay5Ms(void); |
|
| 19 | +void Delay400Ms(void); |
|
| 20 | + |
|
| 21 | +unsigned char code uctech[] = "uctech"; |
|
| 22 | +unsigned char code net[] = "uctech.icpcn.com"; |
|
| 23 | + |
|
| 24 | +void main(void) { |
|
| 25 | + Delay400Ms(); // Startup delay, wait for LCM to be ready |
|
| 26 | + LCMInit(); // Initialize LCM |
|
| 27 | + Delay5Ms(); // Short delay (optional) |
|
| 28 | + DisplayListChar(0, 5, uctech); |
|
| 29 | + DisplayListChar(0, 0, net); |
|
| 30 | + ReadDataLCM(); // Test statement, no actual meaning |
|
| 31 | + while (1); |
|
| 32 | +} |
|
| 33 | + |
|
| 34 | +// Write data |
|
| 35 | +void WriteDataLCM(unsigned char WDLCM) { |
|
| 36 | + ReadStatusLCM(); // Check busy |
|
| 37 | + LCM_Data = WDLCM; |
|
| 38 | + LCM_RS = 1; |
|
| 39 | + LCM_RW = 0; |
|
| 40 | + LCM_E = 1; |
|
| 41 | + LCM_E = 0; // If the crystal frequency is too high, add a small delay here |
|
| 42 | +} |
|
| 43 | + |
|
| 44 | +// Write command |
|
| 45 | +void WriteCommandLCM(unsigned char WCLCM, bit BuysC) { // If BuysC is 0, ignore busy check |
|
| 46 | + if (BuysC) ReadStatusLCM(); // Check busy as needed |
|
| 47 | + LCM_Data = WCLCM; |
|
| 48 | + LCM_RS = 0; |
|
| 49 | + LCM_RW = 0; |
|
| 50 | + LCM_E = 1; |
|
| 51 | + LCM_E = 0; |
|
| 52 | +} |
|
| 53 | + |
|
| 54 | +// Read data |
|
| 55 | +unsigned char ReadDataLCM(void) { |
|
| 56 | + LCM_RS = 1; |
|
| 57 | + LCM_RW = 1; |
|
| 58 | + LCM_E = 1; |
|
| 59 | + LCM_E = 0; |
|
| 60 | + return LCM_Data; |
|
| 61 | +} |
|
| 62 | + |
|
| 63 | +// Read status |
|
| 64 | +unsigned char ReadStatusLCM(void) { |
|
| 65 | + LCM_Data = 0xFF; |
|
| 66 | + LCM_RS = 0; |
|
| 67 | + LCM_RW = 1; |
|
| 68 | + LCM_E = 1; |
|
| 69 | + LCM_E = 0; |
|
| 70 | + while (LCM_Data & Busy); // Check busy flag |
|
| 71 | + return LCM_Data; |
|
| 72 | +} |
|
| 73 | + |
|
| 74 | +// LCM initialization |
|
| 75 | +void LCMInit(void) { |
|
| 76 | + LCM_Data = 0; |
|
| 77 | + WriteCommandLCM(0x38, 0); // Set display mode three times, do not check busy flag |
|
| 78 | + Delay5Ms(); |
|
| 79 | + WriteCommandLCM(0x38, 0); |
|
| 80 | + Delay5Ms(); |
|
| 81 | + WriteCommandLCM(0x38, 0); |
|
| 82 | + Delay5Ms(); |
|
| 83 | + WriteCommandLCM(0x38, 1); // Set display mode, start checking busy flag each time |
|
| 84 | + WriteCommandLCM(0x08, 1); // Display off |
|
| 85 | + WriteCommandLCM(0x01, 1); // Clear display |
|
| 86 | + WriteCommandLCM(0x06, 1); // Set cursor move direction |
|
| 87 | + WriteCommandLCM(0x0C, 1); // Display on and cursor setting |
|
| 88 | +} |
|
| 89 | + |
|
| 90 | +// Display a single character at specified position |
|
| 91 | +void DisplayOneChar(unsigned char X, unsigned char Y, unsigned char DData) { |
|
| 92 | + Y &= 0x1; |
|
| 93 | + X &= 0xF; // Limit X to max 15, Y to max 1 |
|
| 94 | + if (Y) X += 0x40; // If displaying on the second line, address +0x40 |
|
| 95 | + X |= 0x80; // Calculate command code |
|
| 96 | + WriteCommandLCM(X, 0); // Do not check busy flag here, send address code |
|
| 97 | + WriteDataLCM(DData); |
|
| 98 | +} |
|
| 99 | + |
|
| 100 | +// Display a string at specified position |
|
| 101 | +void DisplayListChar(unsigned char X, unsigned char Y, unsigned char code *DData) { |
|
| 102 | + unsigned char ListLength = 0; |
|
| 103 | + Y &= 0x1; |
|
| 104 | + X &= 0xF; // Limit X to max 15, Y to max 1 |
|
| 105 | + while (DData[ListLength] > 0x20) { // Exit if end of string |
|
| 106 | + if (X <= 0xF) { // X coordinate should be less than or equal to 0xF |
|
| 107 | + DisplayOneChar(X, Y, DData[ListLength]); // Display single character |
|
| 108 | + X++; |
|
| 109 | + } |
|
| 110 | + ListLength++; |
|
| 111 | + } |
|
| 112 | +} |
|
| 113 | + |
|
| 114 | +// 5ms delay |
|
| 115 | +void Delay5Ms(void) { |
|
| 116 | + unsigned int TempCyc = 5552; |
|
| 117 | + while (TempCyc--); |
|
| 118 | +} |
|
| 119 | + |
|
| 120 | +// 400ms delay |
|
| 121 | +void Delay400Ms(void) { |
|
| 122 | + unsigned char TempCycA = 5; |
|
| 123 | + unsigned int TempCycB; |
|
| 124 | + while (TempCycA--) { |
|
| 125 | + TempCycB = 7269; |
|
| 126 | + while (TempCycB--); |
|
| 127 | + } |
|
| 128 | +} |
Tech-dat/interactive-dat/display-dat/LCD-dat/LCD1602-dat/LCD1602-dat.md
| ... | ... | @@ -1,30 +1,59 @@ |
| 1 | 1 | |
| 2 | 2 | # LCD1602-dat |
| 3 | 3 | |
| 4 | +- [[LCD1602-code]] |
|
| 5 | + |
|
| 6 | +## relevant boards |
|
| 7 | + |
|
| 8 | +- [[ILC1022-dat]] |
|
| 9 | + |
|
| 10 | +- [[arduino-shields-dat]] == [[DAS1022-dat]] == [1602 LCD+Keypad Shield](https://www.electrodragon.com/product/arduino-lcd-1602-keypad-shield-for-your-arduino-project/) |
|
| 11 | + |
|
| 12 | +- [[ILC1073-dat]] == [1602 LCD USB Mini Drive Board, RPI Driver Free](https://www.electrodragon.com/product/1602-lcd-usb-mini-drive-board-rpi-driver-free/) |
|
| 13 | + |
|
| 14 | +- [[ILC1047-dat]] == [LCD1602 Parallel-IIC PCF8574 Convert Board R2](https://www.electrodragon.com/product/lcd1602-parallel-to-iic-pcf8574-convert-board-r2/) == [[PCF8574-dat]] |
|
| 15 | + |
|
| 16 | +- [[ILC1025-dat]] == [1602 LCD Parallel-IIC Converter Board](https://www.electrodragon.com/product/1602-iic-converter-board-back-light-adjustable/) |
|
| 17 | + |
|
| 18 | +- [[CCO3577-dat]] == [[Retired]10Pcs 16Pin 2.54P Break Away Pin-Header Female (For 1602 LCD)](https://www.electrodragon.com/product/10pcs-16pin-2-54pitch-pin-header-female-for-1602-lcd/) |
|
| 19 | + |
|
| 20 | +- [[2101009-dat]] == [[Retired]1602 IIC/I2C Module for Arduino](https://www.electrodragon.com/product/1602-iici2c-module-for-arduino/) |
|
| 21 | + |
|
| 22 | +- [[2102138-dat]] == [[Retired]1602 LCD I2C/SPI Back-Converter Module (for Arduino, Bare PCB)](https://www.electrodragon.com/product/1602-lcd-i2c-spi-adapter-shield-arduino-bare-pcb-board/) |
|
| 23 | + |
|
| 24 | +- [[2101010-dat]] == [[Retired] LCD1602 I2C/SPI Module (Double-Protocol)](https://www.electrodragon.com/product/i2cspi-lcd1602-module/) |
|
| 25 | + |
|
| 26 | +- [[PINS001-dat]] == [[Retired]Capacitor Inductor Meter (Kit)](https://www.electrodragon.com/product/capacitor-inductor-meter-kit/) |
|
| 27 | + |
|
| 4 | 28 | |
| 5 | 29 | ## wiring |
| 6 | 30 | |
| 7 | 31 |  |
| 8 | 32 | |
| 9 | -## demo code |
|
| 10 | 33 | |
| 11 | -code 1 |
|
| 12 | 34 | |
| 13 | - #include <Wire.h> |
|
| 14 | - #include <LiquidCrystal_I2C.h> |
|
| 15 | 35 | |
| 16 | - LiquidCrystal_I2C lcd(0x27,16,2); // set the LCD address to 0x27 for a 16 chars and 2 line display |
|
| 36 | +dimension |
|
| 37 | + |
|
| 38 | + |
|
| 39 | + |
|
| 40 | +Pin out |
|
| 41 | + |
|
| 42 | + |
|
| 43 | + |
|
| 44 | +1602采用标准的16脚接口,其中: |
|
| 45 | + |
|
| 46 | +- 第1脚:VSS为地电源 |
|
| 47 | +- 第2脚:VDD接5V正电源 |
|
| 48 | +- 第3脚:V0为液晶显示器对比度调整端,接正电源时对比度最弱,接地电源时对比度最高,对比度过高时会产生"鬼影”,使用时可以通过一个10K的电位器调整对比度 |
|
| 49 | +- 第4脚:RS为寄存器选择,高电平时选择数据寄存器、低电平时选择指令寄存器。 |
|
| 50 | +- 第5脚:R/W为读写信号线,高电平时进行读操作,低电平时进行写操作。当RS和RW共同为低电平时可以写入指合或者显示地址,当RS为低电平RW为高电平时可以读忙信号,当RS为高电平RW为低电平时可以写入数据。 |
|
| 51 | +- 第6脚:E端为使能端,当E端由高电平跳变成低电平时,液晶模块执行命合。 |
|
| 52 | +- 第7~14脚:D0~D7为8位双向数据线。 |
|
| 53 | +- 第15脚:背光电源正极 |
|
| 54 | +- 第16脚:背光电源负极 |
|
| 17 | 55 | |
| 18 | - void setup() |
|
| 19 | - { |
|
| 20 | - lcd.init(); |
|
| 21 | - // Print a message to the LCD. |
|
| 22 | - lcd.backlight(); |
|
| 23 | - lcd.print("www.electrodragon.com"); |
|
| 24 | - } |
|
| 25 | - void loop() |
|
| 26 | - { |
|
| 27 | 56 | |
| 28 | - } |
|
| 57 | +## ref |
|
| 29 | 58 | |
| 30 | - |
|
| ... | ... | \ No newline at end of file |
| 0 | +- [[LCD-dat]] |
|
| ... | ... | \ No newline at end of file |
Tech-dat/interactive-dat/interactive-dat.md
| ... | ... | @@ -1,4 +1,17 @@ |
| 1 | 1 | |
| 2 | 2 | # Interactive Dat |
| 3 | 3 | |
| 4 | -- [[joystick-dat]] |
|
| ... | ... | \ No newline at end of file |
| 0 | +- [[joystick-dat]] |
|
| 1 | + |
|
| 2 | +- [[display-dat]] - [[LCD1602-dat]] - [[oled-dat]] |
|
| 3 | + |
|
| 4 | +- [[LCD-dat]] |
|
| 5 | + |
|
| 6 | +- [[e-paper-dat]] |
|
| 7 | + |
|
| 8 | +- [[keyboard-dat]] - [[led-dat]] - [[led-strip-dat]] |
|
| 9 | + |
|
| 10 | + |
|
| 11 | +## ref |
|
| 12 | + |
|
| 13 | +- [[tech-dat]] |
|
| ... | ... | \ No newline at end of file |