Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Pinout:
- GND VCC V0 RS R/W E DB0 DB1 DB2 DB3 DB4 DB5 DB6 DB7 PSB NC RST VOUT BLA BLK
- - GND = 0V
- - VCC = 5V
- - RS = CS, active high
- - R/W = SID
- - E = SCLK
- - PSB = 0V
- - BLA = 3V3
- - BLK = 0V
- Init:
- - SendCmdBits(0 0 1 1 0 0 0 0) # 8-bit, basic
- - SendCmdBits(0 0 1 1 0 0 0 0) # 8-bit, basic
- - SendCmdBits(0 0 0 0 1 1 0 0) # display-on, no-cursor, no-blink
- - SendCmdBits(0 0 1 1 0 1 0 0) # 8-bit, extended
- - SendCmdBits(0 0 1 1 0 1 0 0) # 8-bit, extended
- - SendCmdBits(0 0 1 1 0 1 1 0) # 8-bit, extended, graphic
- The Address Coordinates (Y,X):
- -------------------------------Look carefully!
- (0,0) (0, 1)....(0, 7)
- (1,0) (1, 1)....(1, 7)
- .......................
- (31,0)(31, 1)...(31, 7)
- (0,8) (0,17)....(0,15)
- (1,8) (1,17)....(1,15)
- .......................
- (31,8)(31,17)...(31,15)
- Every (Y,X) is 16-bit data:
- D15 D14 D13 D12 D11 D10 D9 D8 D7 D6 D5 D4 D3 D2 D1 D0
- Goto address(Y,X):
- - SendCmdBits(1 0 Y5 Y4 Y3 Y2 Y1 Y0)
- - SendCmdBits(1 0 0 0 X3 X2 X1 X0)
- Set 16-bit data:
- - SendDataBits(D15 D14 D13 D12 D11 D10 D9 D8)
- - SendDataBits(D7 D6 D5 D4 D3 D2 D1 D0)
- - The address automatically become (Y, (X+1) MOD 16)
- SendCmdBits(D7 D6 D5 D4 D3 D2 D1 D0):
- - CS = HIGH
- - SendBits(1 1 1 1 1 0 0 0)
- - SendBits(D7 D6 D5 D4 0 0 0 0)
- - SendBits(D3 D2 D1 D0 0 0 0 0)
- - CS = LOW
- SendDataBits(D7 D6 D5 D4 D3 D2 D1 D0):
- - CS = HIGH
- - SendBits(1 1 1 1 1 0 1 0)
- - SendBits(D7 D6 D5 D4 0 0 0 0)
- - SendBits(D3 D2 D1 D0 0 0 0 0)
- - CS = LOW
- SendBits(B7 B6 B5 B4 B3 B2 B1 B0):
- - SID = B7
- - SCLK = HIGH
- - SCLK = LOW
- ............
- - SID = B0
- - SCLK = HIGH
- - SCLK = LOW
- If your microcontroller is too fast, add delay.
- If not displaying, turn the potentiometer to adjust contrast?
Add Comment
Please, Sign In to add comment