1f325b8cdda2ebcaf9c20b9fe33924baaa0bc2e7
Board-dat/Board-DAT.md
| ... | ... | @@ -169,11 +169,12 @@ RPI LCD |
| 169 | 169 | |
| 170 | 170 | [[ILC1007-dat]] [[ILC1008-dat]] |
| 171 | 171 | |
| 172 | -[[LCD-12864-dat]] - [[ILC1016-dat]] |
|
| 172 | +- [[LCD-char-dat]] - [[ILC1040-dat]] - [[LCD2004-dat]] - [[ILC1022-dat]] - [[LCD1602-dat]] - [[LCD-12864-dat]] - [[ILC1016-dat]] - [[ILC1038-dat]] |
|
| 173 | + |
|
| 174 | +- [[LCD-char-driver-dat]] - [[ILC1073-dat]] - [[ILC1047-dat]] (out-of-stock) - [[ILC1025-dat]] |
|
| 173 | 175 | |
| 174 | -LED control - [[ILC1063-dat]] |
|
| 175 | 176 | |
| 176 | -[[ILC1022-dat]] |
|
| 177 | +LED control - [[ILC1063-dat]] |
|
| 177 | 178 | |
| 178 | 179 | - [[ILC1073-dat]] |
| 179 | 180 |
Board-dat/ILC/ILC1022-dat/ILC1022-dat.md
| ... | ... | @@ -1,6 +1,11 @@ |
| 1 | 1 | |
| 2 | 2 | # ILC1022-dat |
| 3 | 3 | |
| 4 | + |
|
| 5 | +- [[LCD-dat]] - [[ILC1040-dat]] - [[LCD2004-dat]] - [[ILC1022-dat]] - [[LCD1602-dat]] - [[LCD-12864-dat]] - [[ILC1016-dat]] - [[ILC1038-dat]] |
|
| 6 | + |
|
| 7 | + |
|
| 8 | + |
|
| 4 | 9 | ## Info |
| 5 | 10 | |
| 6 | 11 | [product url - 1602 16×2 Char LCD Module, Blue](https://www.electrodragon.com/product/1602-lcd-display-hd44780/) |
Board-dat/ILC/ILC1040-dat/ILC1040-dat.md
| ... | ... | @@ -0,0 +1,35 @@ |
| 1 | + |
|
| 2 | + |
|
| 3 | +# ILC1040-dat |
|
| 4 | + |
|
| 5 | +- [[LCD-char-dat]] - [[ILC1040-dat]] - [[LCD2004-dat]] - [[ILC1022-dat]] - [[LCD1602-dat]] - [[LCD-12864-dat]] - [[ILC1016-dat]] - [[ILC1038-dat]] |
|
| 6 | + |
|
| 7 | +- [[LCD-char-driver-dat]] - [[ILC1073-dat]] - [[ILC1047-dat]] (out-of-stock) - [[ILC1025-dat]] |
|
| 8 | + |
|
| 9 | + |
|
| 10 | +## Info |
|
| 11 | + |
|
| 12 | +[product url - 2004A 20*4 Char LCD LCM Display](https://www.electrodragon.com/product/2004a-char-lcdlcm-204-words-support-5v/) |
|
| 13 | + |
|
| 14 | +common color |
|
| 15 | + |
|
| 16 | +- yellow-green |
|
| 17 | +- blue |
|
| 18 | + |
|
| 19 | + |
|
| 20 | + |
|
| 21 | +### Board Map, Dimension, Pins, chip info, Use Guide, Setup Jumper, etc. |
|
| 22 | + |
|
| 23 | +## Applications, category, tags, etc. |
|
| 24 | + |
|
| 25 | +## Demo Code and Video |
|
| 26 | + |
|
| 27 | +- demo code == [[electrodragon-LiquidCrystal_I2C2004V1.zip]] |
|
| 28 | + |
|
| 29 | +## ref |
|
| 30 | + |
|
| 31 | +- [[ILC1040]] |
|
| 32 | + |
|
| 33 | +- legacy wiki page |
|
| 34 | + |
|
| 35 | + |
Board-dat/ILC/ILC1040-dat/electrodragon-LiquidCrystal_I2C2004V1.zip
| ... | ... | Binary files /dev/null and b/Board-dat/ILC/ILC1040-dat/electrodragon-LiquidCrystal_I2C2004V1.zip differ |
Tech-dat/interactive-dat/display-dat/LCD-dat/LCD-dat.md
| ... | ... | @@ -1,6 +1,13 @@ |
| 1 | 1 | |
| 2 | 2 | # LCD-dat |
| 3 | 3 | |
| 4 | + |
|
| 5 | +- [[LCD-char-dat]] - [[ILC1040-dat]] - [[LCD2004-dat]] - [[ILC1022-dat]] - [[LCD1602-dat]] - [[LCD-12864-dat]] - [[ILC1016-dat]] - [[ILC1038-dat]] |
|
| 6 | + |
|
| 7 | +- [[LCD-char-driver-dat]] - [[ILC1073-dat]] - [[ILC1047-dat]] (out-of-stock) - [[ILC1025-dat]] |
|
| 8 | + |
|
| 9 | + |
|
| 10 | + |
|
| 4 | 11 | - [[display-dat]] - [[LCD-driver-dat]] |
| 5 | 12 | |
| 6 | 13 | - [[RGB-LCD-dat]] |
Tech-dat/interactive-dat/display-dat/LCD-dat/LCD1602-dat/LCD1602-dat.md
| ... | ... | @@ -6,7 +6,9 @@ |
| 6 | 6 | - [[LCD1602-dat]] - [[ILC1073-dat]] |
| 7 | 7 | |
| 8 | 8 | |
| 9 | +- [[LCD-char-dat]] - [[ILC1040-dat]] - [[LCD2004-dat]] - [[ILC1022-dat]] - [[LCD1602-dat]] - [[LCD-12864-dat]] - [[ILC1016-dat]] - [[ILC1038-dat]] |
|
| 9 | 10 | |
| 11 | +- [[LCD-char-driver-dat]] - [[ILC1073-dat]] - [[ILC1047-dat]] (out-of-stock) - [[ILC1025-dat]] |
|
| 10 | 12 | |
| 11 | 13 | ## relevant boards |
| 12 | 14 |
Tech-dat/interactive-dat/display-dat/LCD-dat/LCD2004-dat/2004A-DS.pdf
| ... | ... | Binary files /dev/null and b/Tech-dat/interactive-dat/display-dat/LCD-dat/LCD2004-dat/2004A-DS.pdf differ |
Tech-dat/interactive-dat/display-dat/LCD-dat/LCD2004-dat/2026-07-07-17-21-57.png
| ... | ... | Binary files /dev/null and b/Tech-dat/interactive-dat/display-dat/LCD-dat/LCD2004-dat/2026-07-07-17-21-57.png differ |
Tech-dat/interactive-dat/display-dat/LCD-dat/LCD2004-dat/2026-07-07-17-24-50.png
| ... | ... | Binary files /dev/null and b/Tech-dat/interactive-dat/display-dat/LCD-dat/LCD2004-dat/2026-07-07-17-24-50.png differ |
Tech-dat/interactive-dat/display-dat/LCD-dat/LCD2004-dat/2026-07-07-17-25-01.png
| ... | ... | Binary files /dev/null and b/Tech-dat/interactive-dat/display-dat/LCD-dat/LCD2004-dat/2026-07-07-17-25-01.png differ |
Tech-dat/interactive-dat/display-dat/LCD-dat/LCD2004-dat/2026-07-07-17-26-03.png
| ... | ... | Binary files /dev/null and b/Tech-dat/interactive-dat/display-dat/LCD-dat/LCD2004-dat/2026-07-07-17-26-03.png differ |
Tech-dat/interactive-dat/display-dat/LCD-dat/LCD2004-dat/2026-07-07-17-26-19.png
| ... | ... | Binary files /dev/null and b/Tech-dat/interactive-dat/display-dat/LCD-dat/LCD2004-dat/2026-07-07-17-26-19.png differ |
Tech-dat/interactive-dat/display-dat/LCD-dat/LCD2004-dat/LCD2004-dat.md
| ... | ... | @@ -0,0 +1,227 @@ |
| 1 | + |
|
| 2 | + |
|
| 3 | +# LCD2004 Character LCD Module |
|
| 4 | + |
|
| 5 | + |
|
| 6 | +- [[LCD-char-dat]] - [[ILC1040-dat]] - [[LCD2004-dat]] - [[ILC1022-dat]] - [[LCD1602-dat]] - [[LCD-12864-dat]] - [[ILC1016-dat]] - [[ILC1038-dat]] |
|
| 7 | + |
|
| 8 | +- [[LCD-char-driver-dat]] - [[ILC1073-dat]] - [[ILC1047-dat]] (out-of-stock) - [[ILC1025-dat]] |
|
| 9 | + |
|
| 10 | +## spec |
|
| 11 | + |
|
| 12 | + |
|
| 13 | + |
|
| 14 | +## 1. Summary |
|
| 15 | +The J204A is an industrial-grade character LCD module. It can display 4 lines of 20 characters each (80 characters in total). |
|
| 16 | + |
|
| 17 | +## 2. Module Dimensions |
|
| 18 | + |
|
| 19 | + |
|
| 20 | + |
|
| 21 | +## 3. Pin Interface Specifications |
|
| 22 | + |
|
| 23 | +| Pin | Symbol | Description | Pin | Symbol | Description | |
|
| 24 | +| :--- | :--- | :--- | :--- | :--- | :--- | |
|
| 25 | +| 1 | VSS | Ground (0V) | 9 | D2 | Data Bit 2 | |
|
| 26 | +| 2 | VDD | Power Supply (+5V) | 10 | D3 | Data Bit 3 | |
|
| 27 | +| 3 | VL | Contrast Adjustment (Bias) | 11 | D4 | Data Bit 4 | |
|
| 28 | +| 4 | RS | Register Select (Data/Command)| 12 | D5 | Data Bit 5 | |
|
| 29 | +| 5 | R/W | Read/Write Select | 13 | D6 | Data Bit 6 | |
|
| 30 | +| 6 | E | Enable Signal | 14 | D7 | Data Bit 7 | |
|
| 31 | +| 7 | D0 | Data Bit 0 | 15 | BLA | Backlight Positive (+5V) | |
|
| 32 | +| 8 | D1 | Data Bit 1 | 16 | BLK | Backlight Negative (0V) | |
|
| 33 | + |
|
| 34 | +### Pin Details: |
|
| 35 | +- **Pin 1 (VSS):** System Ground. |
|
| 36 | +- **Pin 2 (VDD):** +5V Power Supply. |
|
| 37 | +- **Pin 3 (VL):** LCD contrast adjustment. Connecting it to VDD provides the lowest contrast, while GND provides the highest contrast. A 10K Ohm potentiometer is recommended to permit adjustment. "Ghosting" may occur if contrast is set too high. |
|
| 38 | +- **Pin 4 (RS):** Register Select. High level selects the Data Register; Low level selects the Instruction Register. |
|
| 39 | +- **Pin 5 (R/W):** Read/Write Select. High level for Read operations; Low level for Write operations. |
|
| 40 | + - When RS=Low, R/W=Low: Write Command/Instruction. |
|
| 41 | + - When RS=Low, R/W=High: Read Busy Flag and Address Counter. |
|
| 42 | + - When RS=High, R/W=Low: Write Data. |
|
| 43 | + - When RS=High, R/W=High: Read Data. |
|
| 44 | +- **Pin 6 (E):** Enable signal. A transition from High to Low (falling edge) triggers the LCD module to execute the instruction. |
|
| 45 | +- **Pins 7 to 14 (D0-D7):** 8-bit bidirectional data bus. |
|
| 46 | +- **Pin 15 (BLA):** Backlight Anode (+). |
|
| 47 | +- **Pin 16 (BLK):** Backlight Cathode (-). |
|
| 48 | + |
|
| 49 | +## 4. Control Instructions |
|
| 50 | +The J204A LCD module uses an internal controller with 11 standard instructions: |
|
| 51 | + |
|
| 52 | +| No. | Instruction | RS | R/W | D7 | D6 | D5 | D4 | D3 | D2 | D1 | D0 | |
|
| 53 | +| :-- | :--- | :--- | :--- | :--- | :--- | :--- | :--- | :--- | :--- | :--- | :--- | |
|
| 54 | +| 1 | Clear Display | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | |
|
| 55 | +| 2 | Return Home | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | * | |
|
| 56 | +| 3 | Entry Mode Set | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | I/D | S | |
|
| 57 | +| 4 | Display On/Off | 0 | 0 | 0 | 0 | 0 | 0 | 1 | D | C | B | |
|
| 58 | +| 5 | Cursor/Display Shift| 0 | 0 | 0 | 0 | 0 | 1 | S/C | R/L | * | * | |
|
| 59 | +| 6 | Function Set | 0 | 0 | 0 | 0 | 1 | DL | N | F | * | * | |
|
| 60 | +| 7 | Set CGRAM Address | 0 | 0 | 0 | 1 | A | A | A | A | A | A | |
|
| 61 | +| 8 | Set DDRAM Address | 0 | 0 | 1 | A | A | A | A | A | A | A | |
|
| 62 | +| 9 | Read Busy Flag | 0 | 1 | BF | A | A | A | A | A | A | A | |
|
| 63 | +| 10 | Write Data | 1 | 0 | D | D | D | D | D | D | D | D | |
|
| 64 | +| 11 | Read Data | 1 | 1 | D | D | D | D | D | D | D | D | |
|
| 65 | + |
|
| 66 | +*Note: A = Address bit, D = Data bit, * = Don't care.* |
|
| 67 | + |
|
| 68 | +### Instruction Details: |
|
| 69 | +1. **Clear Display (01H):** Clears the entire display and resets the cursor to address 00H. |
|
| 70 | +2. **Return Home:** Resets the cursor to address 00H without clearing the display. |
|
| 71 | +3. **Entry Mode Set:** |
|
| 72 | + - **I/D:** 1 = Increment (right), 0 = Decrement (left). |
|
| 73 | + - **S:** 1 = Shift display, 0 = No shift. |
|
| 74 | +4. **Display On/Off:** |
|
| 75 | + - **D:** 1 = Display On, 0 = Display Off. |
|
| 76 | + - **C:** 1 = Cursor On, 0 = Cursor Off. |
|
| 77 | + - **B:** 1 = Cursor Blinking, 0 = No Blinking. |
|
| 78 | +5. **Cursor/Display Shift:** |
|
| 79 | + - **S/C:** 1 = Display Shift, 0 = Cursor Move. |
|
| 80 | + - **R/L:** 1 = Shift Right, 0 = Shift Left. |
|
| 81 | +6. **Function Set:** |
|
| 82 | + - **DL:** 1 = 8-bit bus, 0 = 4-bit bus. |
|
| 83 | + - **N:** 1 = 2-line display (includes 4-line models), 0 = 1-line. |
|
| 84 | + - **F:** 1 = 5x10 dots, 0 = 5x7 dots. |
|
| 85 | +7. **Set CGRAM Address:** Sets the Character Generator RAM address. |
|
| 86 | +8. **Set DDRAM Address:** Sets the Display Data RAM address. |
|
| 87 | +9. **Read Busy Flag (BF):** BF=1 indicates the module is busy and cannot receive new commands. |
|
| 88 | +10. **Write Data:** Writes data content to RAM. |
|
| 89 | +11. **Read Data:** Reads data content from RAM. |
|
| 90 | + |
|
| 91 | + |
|
| 92 | +## 5. Timing Sequences |
|
| 93 | + |
|
| 94 | +### Read Operation Sequence |
|
| 95 | + |
|
| 96 | + |
|
| 97 | +### Write Operation Sequence |
|
| 98 | + |
|
| 99 | + |
|
| 100 | +## 6. RAM Address Mapping |
|
| 101 | +The LCD is a slow device. Before sending any instruction, ensure the Busy Flag (BF) is Low (0). To display a character, you must first specify the DDRAM address. |
|
| 102 | + |
|
| 103 | +### Internal Display Addresses (Hex) |
|
| 104 | +The J204A spans 4 lines. For example, the first character of the second line is at address `40H`. To set the cursor to this position, the command must include the high bit (D7=1). |
|
| 105 | +- **Internal Address:** `40H` (Binary: `01000000`) |
|
| 106 | +- **Command Calculation:** `40H + 80H = C0H` (Binary: `11000000`) |
|
| 107 | + |
|
| 108 | +During initialization, the display mode should be set. Usually, characters are entered with the cursor automatically moving to the right. |
|
| 109 | + |
|
| 110 | + |
|
| 111 | + |
|
| 112 | + |
|
| 113 | + |
|
| 114 | +## char table |
|
| 115 | + |
|
| 116 | + |
|
| 117 | + |
|
| 118 | + |
|
| 119 | +## 7. C51 Example Code |
|
| 120 | + |
|
| 121 | +```c |
|
| 122 | +#include <reg52.h> |
|
| 123 | + |
|
| 124 | +#define uint unsigned int |
|
| 125 | +#define uchar unsigned char |
|
| 126 | + |
|
| 127 | +#define comm 0 |
|
| 128 | +#define dat 1 |
|
| 129 | + |
|
| 130 | +sbit rs = P3^5; // Register Select: H=Data, L=Command |
|
| 131 | +sbit rw = P3^4; // Read/Write: H=Read, L=Write |
|
| 132 | +sbit e = P3^3; // Enable signal |
|
| 133 | + |
|
| 134 | +uchar code tab1[] = "Electrodragon.com TEL: 18576608994"; |
|
| 135 | + |
|
| 136 | +void delay(uint ms) { |
|
| 137 | + uint i, j; |
|
| 138 | + for(i = 0; i < ms; i++) { |
|
| 139 | + for(j = 0; j < 120; j++); |
|
| 140 | + } |
|
| 141 | +} |
|
| 142 | + |
|
| 143 | +void wr_lcd(uchar type, uchar content) { |
|
| 144 | + if(type == dat) { |
|
| 145 | + rs = 1; // Data |
|
| 146 | + rw = 0; // Write |
|
| 147 | + } else { |
|
| 148 | + rs = 0; // Command |
|
| 149 | + rw = 0; // Write |
|
| 150 | + } |
|
| 151 | + P1 = content; |
|
| 152 | + e = 1; |
|
| 153 | + delay(1); |
|
| 154 | + e = 0; |
|
| 155 | +} |
|
| 156 | + |
|
| 157 | +void init_lcd(void) { |
|
| 158 | + e = 0; |
|
| 159 | + wr_lcd(comm, 0x38); // 8-bit interface, 2-line mode (works for 4-line) |
|
| 160 | + wr_lcd(comm, 0x01); // Clear screen |
|
| 161 | + wr_lcd(comm, 0x06); // Cursor move direction (increment) |
|
| 162 | + wr_lcd(comm, 0x0c); // Display On, Cursor Off |
|
| 163 | +} |
|
| 164 | + |
|
| 165 | +void chrt_disp(uchar code *chrt) { |
|
| 166 | + uchar i, j; |
|
| 167 | + wr_lcd(comm, 0x80); // Set DDRAM address to 00H |
|
| 168 | + for(j = 0; j < 2; j++) { |
|
| 169 | + for(i = 0; i < 16; i++) { |
|
| 170 | + wr_lcd(dat, chrt[j * 16 + i]); |
|
| 171 | + } |
|
| 172 | + wr_lcd(comm, 0xc0); // Move to second line (40H) |
|
| 173 | + } |
|
| 174 | +} |
|
| 175 | + |
|
| 176 | +void cgram_wr(uchar zm_data1, uchar zm_data2) { |
|
| 177 | + uchar i, j; |
|
| 178 | + wr_lcd(comm, 0x40); // Set CGRAM address 00H |
|
| 179 | + for(j = 0; j < 8; j++) { |
|
| 180 | + for(i = 0; i < 4; i++) { |
|
| 181 | + wr_lcd(dat, zm_data1); |
|
| 182 | + wr_lcd(dat, zm_data2); |
|
| 183 | + } |
|
| 184 | + } |
|
| 185 | +} |
|
| 186 | + |
|
| 187 | +void cgram_disp(void) { |
|
| 188 | + uchar i, j; |
|
| 189 | + wr_lcd(comm, 0x80); |
|
| 190 | + for(j = 0; j < 2; j++) { |
|
| 191 | + for(i = 0; i < 8; i++) { |
|
| 192 | + wr_lcd(dat, i); |
|
| 193 | + } |
|
| 194 | + wr_lcd(comm, 0xc0); |
|
| 195 | + } |
|
| 196 | +} |
|
| 197 | + |
|
| 198 | +void main(void) { |
|
| 199 | + init_lcd(); |
|
| 200 | + while (1) { |
|
| 201 | + chrt_disp(tab1); |
|
| 202 | + delay(2000); |
|
| 203 | + |
|
| 204 | + cgram_wr(0x1f, 0x1f); |
|
| 205 | + cgram_disp(); |
|
| 206 | + delay(2000); |
|
| 207 | + |
|
| 208 | + cgram_wr(0x15, 0x15); |
|
| 209 | + cgram_disp(); |
|
| 210 | + delay(2000); |
|
| 211 | + |
|
| 212 | + cgram_wr(0x1f, 0x00); |
|
| 213 | + cgram_disp(); |
|
| 214 | + delay(2000); |
|
| 215 | + |
|
| 216 | + cgram_wr(0x15, 0x0a); |
|
| 217 | + cgram_disp(); |
|
| 218 | + delay(2000); |
|
| 219 | + } |
|
| 220 | +} |
|
| 221 | +``` |
|
| 222 | + |
|
| 223 | + |
|
| 224 | + |
|
| 225 | +## ref |
|
| 226 | + |
|
| 227 | +datasheet == [[2004A-DS.pdf]] |
|
| ... | ... | \ No newline at end of file |
Tech-dat/interactive-dat/display-dat/LCD-dat/LCD2004-dat/T2KkGzXfhaXXXXXXXX_!!724463296.jpg
| ... | ... | Binary files /dev/null and b/Tech-dat/interactive-dat/display-dat/LCD-dat/LCD2004-dat/T2KkGzXfhaXXXXXXXX_!!724463296.jpg differ |