📄 3510i_stefan03.bas
字号:
'Controller D15G14E_14_030526
Declare Sub Lcd_command(byval Lcommand As Byte)
Declare Sub Lcd_parameter(byval Lparameter As Byte)
'Display Pin 1 Reset => AVR Pin A0->C5
' 2 CS A1->C4
' 3 GND GND
' 4 Sdata A2->B4
' 5 Sclk A3->B5
' 6 Vdigital Vdd (3 Volt)
' 7 Vbooster Vdd
' 8 Vlcd
'Config Spi = Hard , Data Order = Msb , Master = Yes , Polarity = Low , Phase = 0 , Clockrate = 16 , Noss = 1
'Config Spi = Hard , Data Order = Msb , Master = Yes , Polarity = Low , Phase = 0 , Clockrate = 16 , Noss = 1
Config Spi = Soft , Din = Pinb.3 , Dout = Portb.4 , Ss = None , Clock = Portb.5
Dim R As Integer
Dim A As Byte
Ddrb = &B11111111
Ddrc = &B11111111 'Port A als Output
'Initialisierung Reset
Portc.5 = 0
Waitms 5
Portc.5 = 1
Portc.4 = 1
Portb.4 = 1
Portb.5 = 1
'Software Reset
Call Lcd_command(&H01)
Gosub Cs
Waitms 5
'INIESC
'Call Lcd_command(&Hc6)
'Gosub Cs
'***************************************************************************
' <Display setup 1>
'REFSET
'Call Lcd_command(&Hb9)
'A = 185
'Gosub Parameter
'Gosub Cs
'Display Control DISCTL
'Call Lcd_command(&Hb6)
'Call Lcd_parameter(128) '128 number of clocks, willk黵liche Zahl '128no N line inversion (ungerade Zeilenanzahl)
'Call Lcd_parameter(127) '129 2 divisions in idle mode, bias 1/9
'Call Lcd_parameter(20)
'Call Lcd_parameter(84)
'Call Lcd_parameter(69)
'Call Lcd_parameter(82)
'Call Lcd_parameter(67)
'Gosub Cs
'Gray Scale Position
'Bei DISCTL wurden 128 clock numbers pro Zeile eingestellt
'Auf diese 128 Cyclen werden die 16 (4 bit) Graustufen verteilt (willk黵lich, Werte m黶sen aber kleiner als 128 sein)
'Die Graustufen gelten f黵 alle Farben 'GCPSET0
'Call Lcd_command(&Hb3)
'Call Lcd_parameter(1)
'Call Lcd_parameter(2)
'Call Lcd_parameter(4)
'Call Lcd_parameter(8)
'Call Lcd_parameter(16)
'Call Lcd_parameter(30)
'Call Lcd_parameter(40)
'Call Lcd_parameter(50)
'Call Lcd_parameter(60)
'Call Lcd_parameter(70)
'Call Lcd_parameter(80)
'Call Lcd_parameter(90)
'Call Lcd_parameter(100)
'Call Lcd_parameter(110)
'Call Lcd_parameter(127)
'Gosub Cs
'Gamma curve set
'Call Lcd_command(&Hb5) 'GCPSET0
'Call Lcd_parameter(1)
'Gosub Cs
'Common driver output select
'Call Lcd_command(&Hbd)
'Call Lcd_parameter(0)
'Gosub Cs
'************************************************************************
' <Power supply setup>
'Power control PWRCTL
'Call Lcd_command(&Hbe) 'boosting clock half display clock, internal resistance, high power mode
'Call Lcd_parameter(4)
'Gosub Cs
'Sleep out
Call Lcd_command(&H11)
Gosub Cs
'Voltage control
Call Lcd_command(&Hba) 'Voltage 127 - 63
Call Lcd_parameter(127)
Call Lcd_parameter(3)
'Gosub Cs
'Contrast
Call Lcd_command(&H25) 'Voltage
Call Lcd_parameter(63) '63
'Gosub Cs
'Temperature gradient set
'Call Lcd_command(&Hb7)
'For R = 1 To 14 'nur erster Wert relevant, restliche 13 Werte auf 0 setzen
'Call Lcd_parameter(0)
'Next R
'Gosub Cs
'Display ON
Call Lcd_command(&H29)
Gosub Cs
'Booster voltage ON
Call Lcd_command(&H03)
Gosub Cs
Waitms 40 'Booster voltage stabilizing
'**************************************************************************
' <Display setup2>
'Inversion control 'Off, normal
Call Lcd_command(&H20)
Gosub Cs
'andere Einstellung per Reset definiert
'*************************************************************************
' <Display setup3>
'Interface pixel format
'8 bit
Call Lcd_command(&H3a)
Call Lcd_parameter(2)
Gosub Cs
'Colour set
'nur f黵 8 bit relevant
Call Lcd_command(&H2d)
'rot
Call Lcd_parameter(&H0)
Call Lcd_parameter(&H2)
Call Lcd_parameter(&H3)
Call Lcd_parameter(&H4)
Call Lcd_parameter(&H5)
Call Lcd_parameter(&H6)
Call Lcd_parameter(&H8)
Call Lcd_parameter(&Hf)
'gr黱
Call Lcd_parameter(&H0)
Call Lcd_parameter(&H2)
Call Lcd_parameter(&H3)
Call Lcd_parameter(&H4)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -