1 =================================== 1 =================================== 2 cfag12864b LCD Driver Documentation 2 cfag12864b LCD Driver Documentation 3 =================================== 3 =================================== 4 4 5 :License: GPLv2 5 :License: GPLv2 6 :Author & Maintainer: Miguel Ojeda <ojeda@ker 6 :Author & Maintainer: Miguel Ojeda <ojeda@kernel.org> 7 :Date: 2006-10-27 7 :Date: 2006-10-27 8 8 9 9 10 10 11 .. INDEX 11 .. INDEX 12 12 13 1. DRIVER INFORMATION 13 1. DRIVER INFORMATION 14 2. DEVICE INFORMATION 14 2. DEVICE INFORMATION 15 3. WIRING 15 3. WIRING 16 4. USERSPACE PROGRAMMING 16 4. USERSPACE PROGRAMMING 17 17 18 1. Driver Information 18 1. Driver Information 19 --------------------- 19 --------------------- 20 20 21 This driver supports a cfag12864b LCD. 21 This driver supports a cfag12864b LCD. 22 22 23 23 24 2. Device Information 24 2. Device Information 25 --------------------- 25 --------------------- 26 26 27 :Manufacturer: Crystalfontz 27 :Manufacturer: Crystalfontz 28 :Device Name: Crystalfontz 12864b LCD Series 28 :Device Name: Crystalfontz 12864b LCD Series 29 :Device Code: cfag12864b 29 :Device Code: cfag12864b 30 :Webpage: http://www.crystalfontz.com 30 :Webpage: http://www.crystalfontz.com 31 :Device Webpage: http://www.crystalfontz.com/p 31 :Device Webpage: http://www.crystalfontz.com/products/12864b/ 32 :Type: LCD (Liquid Crystal Display) 32 :Type: LCD (Liquid Crystal Display) 33 :Width: 128 33 :Width: 128 34 :Height: 64 34 :Height: 64 35 :Colors: 2 (B/N) 35 :Colors: 2 (B/N) 36 :Controller: ks0108 36 :Controller: ks0108 37 :Controllers: 2 37 :Controllers: 2 38 :Pages: 8 each controller 38 :Pages: 8 each controller 39 :Addresses: 64 each page 39 :Addresses: 64 each page 40 :Data size: 1 byte each address 40 :Data size: 1 byte each address 41 :Memory size: 2 * 8 * 64 * 1 = 1024 bytes = 41 :Memory size: 2 * 8 * 64 * 1 = 1024 bytes = 1 Kbyte 42 42 43 43 44 3. Wiring 44 3. Wiring 45 --------- 45 --------- 46 46 47 The cfag12864b LCD Series don't have official 47 The cfag12864b LCD Series don't have official wiring. 48 48 49 The common wiring is done to the parallel port 49 The common wiring is done to the parallel port as shown:: 50 50 51 Parallel Port cfag1 51 Parallel Port cfag12864b 52 52 53 Name Pin# Pin# 53 Name Pin# Pin# Name 54 54 55 Strobe ( 1)------------------------------(17 55 Strobe ( 1)------------------------------(17) Enable 56 Data 0 ( 2)------------------------------( 4 56 Data 0 ( 2)------------------------------( 4) Data 0 57 Data 1 ( 3)------------------------------( 5 57 Data 1 ( 3)------------------------------( 5) Data 1 58 Data 2 ( 4)------------------------------( 6 58 Data 2 ( 4)------------------------------( 6) Data 2 59 Data 3 ( 5)------------------------------( 7 59 Data 3 ( 5)------------------------------( 7) Data 3 60 Data 4 ( 6)------------------------------( 8 60 Data 4 ( 6)------------------------------( 8) Data 4 61 Data 5 ( 7)------------------------------( 9 61 Data 5 ( 7)------------------------------( 9) Data 5 62 Data 6 ( 8)------------------------------(10 62 Data 6 ( 8)------------------------------(10) Data 6 63 Data 7 ( 9)------------------------------(11 63 Data 7 ( 9)------------------------------(11) Data 7 64 (10) [+5v]---( 1 64 (10) [+5v]---( 1) Vdd 65 (11) [GND]---( 2 65 (11) [GND]---( 2) Ground 66 (12) [+5v]---(14 66 (12) [+5v]---(14) Reset 67 (13) [GND]---(15 67 (13) [GND]---(15) Read / Write 68 Line (14)------------------------------(13 68 Line (14)------------------------------(13) Controller Select 1 69 (15) 69 (15) 70 Init (16)------------------------------(12 70 Init (16)------------------------------(12) Controller Select 2 71 Select (17)------------------------------(16 71 Select (17)------------------------------(16) Data / Instruction 72 Ground (18)---[GND] [+5v]---(19 72 Ground (18)---[GND] [+5v]---(19) LED + 73 Ground (19)---[GND] 73 Ground (19)---[GND] 74 Ground (20)---[GND] E A 74 Ground (20)---[GND] E A Values: 75 Ground (21)---[GND] [GND]---[P1]---(18 75 Ground (21)---[GND] [GND]---[P1]---(18) Vee - R = Resistor = 22 ohm 76 Ground (22)---[GND] | 76 Ground (22)---[GND] | - P1 = Preset = 10 Kohm 77 Ground (23)---[GND] ---- S ------( 3 77 Ground (23)---[GND] ---- S ------( 3) V0 - P2 = Preset = 1 Kohm 78 Ground (24)---[GND] | | 78 Ground (24)---[GND] | | 79 Ground (25)---[GND] [GND]---[P2]---[R]---(20 79 Ground (25)---[GND] [GND]---[P2]---[R]---(20) LED - 80 80 81 81 82 4. Userspace Programming 82 4. Userspace Programming 83 ------------------------ 83 ------------------------ 84 84 85 The cfag12864bfb describes a framebuffer devic 85 The cfag12864bfb describes a framebuffer device (/dev/fbX). 86 86 87 It has a size of 1024 bytes = 1 Kbyte. 87 It has a size of 1024 bytes = 1 Kbyte. 88 Each bit represents one pixel. If the bit is h 88 Each bit represents one pixel. If the bit is high, the pixel will 89 turn on. If the pixel is low, the pixel will t 89 turn on. If the pixel is low, the pixel will turn off. 90 90 91 You can use the framebuffer as a file: fopen, 91 You can use the framebuffer as a file: fopen, fwrite, fclose... 92 Although the LCD won't get updated until the n 92 Although the LCD won't get updated until the next refresh time arrives. 93 93 94 Also, you can mmap the framebuffer: open & mma 94 Also, you can mmap the framebuffer: open & mmap, munmap & close... 95 which is the best option for most uses. 95 which is the best option for most uses. 96 96 97 Check samples/auxdisplay/cfag12864b-example.c 97 Check samples/auxdisplay/cfag12864b-example.c 98 for a real working userspace complete program 98 for a real working userspace complete program with usage examples.
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.