Вы находитесь на странице: 1из 2

Page 270

The graphic LCDs that are compatible with Proton are the Samsung KS0108, and the
Toshiba T6963. The Samsung display has a pixel resolution of 64 x 128. The 64 being
the Y axis, made up of 8 lines each having 8-bits. The 128 being the X axis, made up of
128 positions.
Device = 18F452
Xtal = 20
Declare LCD_Type = Graphic
Declare LCD_CS1Pin = PORTC.0
Declare LCD_CS2Pin = PORTC.1
Declare LCD_RSPin = PORTC.2
Declare LCD_RWPin = PORTC.3
Declare LCD_ENPin = PORTC.4
Declare LCD_DTPort = PORTD
'Output PORTC
'Output PORTD
'main:
Dim Xpos As Byte
Cls ' Clear the LCD
For Xpos = 0 To 120 ' Create a loop of 128
LCDWrite 0, Xpos, [%10100001] ' Write to the LCD's top line
DelayMS 100
Next
Stop
'GoTo main
End

Device = 18F452
Xtal = 20
Declare LCD_Type = Graphic ' Use a Graphic LCD
'Declare Internal_Font = oN' Use an external chr set
'Declare Font_Addr = 0

Declare LCD_CS1Pin = PORTC.0


Declare LCD_CS2Pin = PORTC.1
Declare LCD_RSPin = PORTC.2
Declare LCD_RWPin = PORTC.3
Declare LCD_ENPin = PORTC.4
'Declare SDA_Pin = PORTC.5
'Declare SCL_Pin = PORTC.6
Declare LCD_DTPort = PORTD
Output PORTC
Output PORTD
Dim Xpos As Byte
Cls ' Clear the LCD
LCDWrite 0, Xpos, [0x7F,0x08,0x08,0x08,0x7F,0x00,0x7F,0x49,0x49,0x49, 0x41,
0x00,0x7F, 0x40, 0x40, 0x40, 0x40, 0x00,0x3E, 0x41, 0x41, 0x41, 0x3E,
0x00,0x3F, 0x40, 0x38, 0x40, 0x3F, 0x00,0x7F, 0x09, 0x19, 0x29, 0x46,
0x00,0x7F, 0x41, 0x41, 0x22, 0x1C, 0x00]
DelayMS 100
Stop
End

Вам также может понравиться