|
Svet elektronike Revija za prave elektronike
|
|
Poglej prejšnjo temo :: Poglej naslednjo temo |
Avtor |
Sporočilo |
ivan Mojster
Pridružen/-a: Pon Mar 2004 18:49 Prispevkov: 45 Kraj: Cerkno
|
Objavljeno: Tor Jul 19, 2011 1:35 pm Naslov sporočila: Graficni LCD LGM12864B |
|
|
Pozdravljeni,
Nikakor mi ne uspe oživiti Grafični LCD LGM12864B, kaj delam narobe ?
Iz primerov sem kopiral program "circle.bas" pa se nič ne zgodi.
po ukazu Config Graphlcd sem naredil še en Print "Config_1" , pa se progam ustavi pri tem ukazu, če pa ta ukaz od označim in prevedem
pa lučka lepo utripa v DO zanki na koncu. Program se uspešno prevede v obeh primerih.
Koda: | '----------------------------------------------------------------
'----------------------------------------------------------------
' circle.bas
' draws a circle on a graphic display
'----------------------------------------------------------------
$regfile = "m32def.dat" ' specify the used micro
$crystal = 8000000 ' used crystal frequency
$baud = 9600 ' use baud rate
$hwstack = 32 ' default use 32 for the hardware stack
$swstack = 10 ' default use 10 for the SW stack
$framesize = 40 ' default use 40 for the frame space
Config Portd.7 = Output
Waitms 100
Reset Portd.7
Waitms 100
Set Portd.7
'some routines to control the display are in the glcdKS108.lib file
$lib "glcdKS108.lib"
Wait 1
Print "Config" ' printing will still work as only the receiver pin is disabled
'First we define that we use a graphic LCD
Config Graphlcd = 128 * 64sed , Dataport = Porta , Controlport = Portc , Ce = 0 , Ce2 = 1 , Cd = 2 , Rd = 3 , Reset = 5 , Enable = 4
Print "Config_1"
'The dataport is th e portname that is connected to the data lines of the LCD
'The controlport is the portname which pins are used to control the lcd
'CE, CD etc. are the pin number of the CONTROLPORT.
' For example CE =2 because it is connected to PORTC.2
'mode 8 gives 240 / 8 = 30 columns , mode=6 gives 240 / 6 = 40 columns
Dim I As Byte
Cls
'create a solid circle
For I = 1 To 20
Circle(40 , 40) , I , 255
Next
Do
Circle(20 , 20) , 10 , 255 'make circle
Wait 1
Circle(20 , 20) , 10 , 0 'remove circle
Wait 1
Waitms 100
Reset Portd.7
Waitms 100
Set Portd.7
Loop
End
|
V čem je problem !!
LP ivan |
|
Nazaj na vrh |
|
|
Jure Urednik
Pridružen/-a: Pon Jan 2004 12:51 Prispevkov: 2132 Kraj: Ljubljana
|
Objavljeno: Tor Jul 19, 2011 6:36 pm Naslov sporočila: |
|
|
Ivan,
ali si preveril povezavo (shemo) za ta displej?
Lp
Jure |
|
Nazaj na vrh |
|
|
|
|
Ne, ne moreš dodajati novih tem v tem forumu Ne, ne moreš odgovarjati na teme v tem forumu Ne, ne moreš urejati svojih prispevkov v tem forumu Ne, ne moreš brisati svojih prispevkov v tem forumu Ne ne moreš glasovati v anketi v tem forumu You cannot attach files in this forum You cannot download files in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|