Ich will ein GLCD 128x64 mit dem Controller KS0108 anschließen. Ich benutze den Source von http://www.apetech.de. Wo ich mein Problem habe ist die Pinbelegung. In der ks0108.h finde ich folgendes:
1 | // Ports |
2 | #define LCD_CMD_PORT PORTA // Command Output Register |
3 | #define LCD_CMD_DIR DDRA // Data Direction Register for Command |
4 | Port |
5 | |
6 | #define LCD_DATA_IN PINC // Data Input Register |
7 | #define LCD_DATA_OUT PORTC // Data Output Register |
8 | #define LCD_DATA_DIR DDRC // Data Direction Register for Data Port |
9 | |
10 | // Command Port Bits |
11 | #define D_I 0x00 // D/I Bit Number |
12 | #define R_W 0x01 // R/W Bit Number |
13 | #define EN 0x02 // EN Bit Number |
14 | #define CSEL1 0x03 // CS1 Bit Number |
15 | #define CSEL2 0x04 // CS2 Bit Number |
16 | |
17 | // Chips |
18 | #define CHIP1 0x00 |
19 | #define CHIP2 0x01 |
20 | |
21 | // Commands |
22 | #define LCD_ON 0x3F |
23 | #define LCD_OFF 0x3E |
24 | #define LCD_SET_ADD 0x40 |
25 | #define LCD_SET_PAGE 0xB8 |
26 | #define LCD_DISP_START 0xC0 |
DataPort ist ja klar geht von portc.0 bis portc.7 aber wie sind die Commands Belegt? Porta.0 == D_I Porta.1 == R_W Porta.2 == EN Porta.3 == CSEL1 Porta.4 == CSEL2 Ist das richtig? Warum ist aber z.B. CSEL1 0x03 und nicht 3 ??