0001 ===================================
0002 cfag12864b LCD Driver Documentation
0003 ===================================
0004
0005 :License: GPLv2
0006 :Author & Maintainer: Miguel Ojeda <ojeda@kernel.org>
0007 :Date: 2006-10-27
0008
0009
0010
0011 .. INDEX
0012
0013 1. DRIVER INFORMATION
0014 2. DEVICE INFORMATION
0015 3. WIRING
0016 4. USERSPACE PROGRAMMING
0017
0018 1. Driver Information
0019 ---------------------
0020
0021 This driver supports a cfag12864b LCD.
0022
0023
0024 2. Device Information
0025 ---------------------
0026
0027 :Manufacturer: Crystalfontz
0028 :Device Name: Crystalfontz 12864b LCD Series
0029 :Device Code: cfag12864b
0030 :Webpage: http://www.crystalfontz.com
0031 :Device Webpage: http://www.crystalfontz.com/products/12864b/
0032 :Type: LCD (Liquid Crystal Display)
0033 :Width: 128
0034 :Height: 64
0035 :Colors: 2 (B/N)
0036 :Controller: ks0108
0037 :Controllers: 2
0038 :Pages: 8 each controller
0039 :Addresses: 64 each page
0040 :Data size: 1 byte each address
0041 :Memory size: 2 * 8 * 64 * 1 = 1024 bytes = 1 Kbyte
0042
0043
0044 3. Wiring
0045 ---------
0046
0047 The cfag12864b LCD Series don't have official wiring.
0048
0049 The common wiring is done to the parallel port as shown::
0050
0051 Parallel Port cfag12864b
0052
0053 Name Pin# Pin# Name
0054
0055 Strobe ( 1)------------------------------(17) Enable
0056 Data 0 ( 2)------------------------------( 4) Data 0
0057 Data 1 ( 3)------------------------------( 5) Data 1
0058 Data 2 ( 4)------------------------------( 6) Data 2
0059 Data 3 ( 5)------------------------------( 7) Data 3
0060 Data 4 ( 6)------------------------------( 8) Data 4
0061 Data 5 ( 7)------------------------------( 9) Data 5
0062 Data 6 ( 8)------------------------------(10) Data 6
0063 Data 7 ( 9)------------------------------(11) Data 7
0064 (10) [+5v]---( 1) Vdd
0065 (11) [GND]---( 2) Ground
0066 (12) [+5v]---(14) Reset
0067 (13) [GND]---(15) Read / Write
0068 Line (14)------------------------------(13) Controller Select 1
0069 (15)
0070 Init (16)------------------------------(12) Controller Select 2
0071 Select (17)------------------------------(16) Data / Instruction
0072 Ground (18)---[GND] [+5v]---(19) LED +
0073 Ground (19)---[GND]
0074 Ground (20)---[GND] E A Values:
0075 Ground (21)---[GND] [GND]---[P1]---(18) Vee - R = Resistor = 22 ohm
0076 Ground (22)---[GND] | - P1 = Preset = 10 Kohm
0077 Ground (23)---[GND] ---- S ------( 3) V0 - P2 = Preset = 1 Kohm
0078 Ground (24)---[GND] | |
0079 Ground (25)---[GND] [GND]---[P2]---[R]---(20) LED -
0080
0081
0082 4. Userspace Programming
0083 ------------------------
0084
0085 The cfag12864bfb describes a framebuffer device (/dev/fbX).
0086
0087 It has a size of 1024 bytes = 1 Kbyte.
0088 Each bit represents one pixel. If the bit is high, the pixel will
0089 turn on. If the pixel is low, the pixel will turn off.
0090
0091 You can use the framebuffer as a file: fopen, fwrite, fclose...
0092 Although the LCD won't get updated until the next refresh time arrives.
0093
0094 Also, you can mmap the framebuffer: open & mmap, munmap & close...
0095 which is the best option for most uses.
0096
0097 Check samples/auxdisplay/cfag12864b-example.c
0098 for a real working userspace complete program with usage examples.