patti16
03.12.2011, 20:50
Hallo,
habe ein Problem mit dem Pollin Grafik LCD TG12864B und zwar zeigt das Display mir fast alle Pixel an( Contrast gedimmt). Zwischen den Pixel sieht man wie eine Linie wandert, Schrift wird allerdings gar nicht an gezeigt.
Mit Hello World
'some routines to control the display are in the glcdKS108.lib file
$lib "glcdKS108.lib"
$regfile = "m8def.dat"
'$crystal = 7372800
$baud = 9600
$lib "glcdKS108.lbx"
'First we define that we use a graphic LCD
Config Graphlcd = 128 * 64sed , Dataport = Portd , Controlport = Portc , Ce = 2, Ce2 = 1 , Cd = 5 , Rd = 4 , Reset = 0 , Enable = 3
Cls
Lcdat 1 , 1 , "Hello World"
Do
Nop 'mache nichts
Loop
Beispiel von MCS
'--------------------------------------------------------------------
' KS108.BAS
' demonstrates the KS108 based graphical display support
'--------------------------------------------------------------------
'some routines to control the display are in the glcdKS108.lib file
$lib "glcdKS108.lib"
$regfile = "m8def.dat"
$crystal = 7372800
$baud = 19200
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 = Portd , Controlport = Portc , Ce = 1 , Ce2 = 2 , Cd = 5 , Rd = 4 , Reset = 0 , Enable = 3
'Dim variables (y not used)
Dim X As Byte , Y As Byte
Print "Cls"
Cls
Wait 1
'specify the font we want to use
Setfont Font8x8
'You can use locate but the columns have a range from 1-128
'When you want to show somthing on the LCD, use the LDAT command
'LCDAT Y , COL, value
Lcdat 1 , 1 , "123"
'lcdat accepts an additional param for inversing the text
Lcdat 2 , 1 , "123" , 1 ' will inverse the text
'Now use a different font
'Setfont Font8x8
'since the 16*16 font uses 2 rows, show on row 3
'Lcdat 1 , 1 , "2345"
'Lcdat 2 , 56 , "2345656"
Wait 1
Line(0 , 0) -(128 , 64) , 1 'make line
Wait 2
Line(0 , 0) -(128 , 64) , 0 'remove line
For Y = 1 To 20
Circle(30 , 30) , Y , 1
Waitms 100
Next
Wait 1
Glcdcmd &H3E , 1 : Glcdcmd &H3E , 2 ' both displays off
Wait 1
Glcdcmd &H3F , 1 : Glcdcmd &H3F , 2 'both on
'GLCDCMD accepts an additional param to select the chip
'With multiple, GLCDCMD statements, it is best to specify the chip only the first time
Showpic 0 , 0 , Plaatje 'show a comnpressed picture
End 'end program
'we need to include the font files
'Notice that this is a testfont with only numbers defined !
'$include "smallfont8x8.font"
$include "font8x8.font"
'$include "font16x16.font"
Plaatje:
'include the picture data
$bgf "ks108.bgf"
Habe auch schon bei Google geschaut, aber leider nichts gefunden!
Hoffe ihr habt ein paar Ideen!
Gruß
habe ein Problem mit dem Pollin Grafik LCD TG12864B und zwar zeigt das Display mir fast alle Pixel an( Contrast gedimmt). Zwischen den Pixel sieht man wie eine Linie wandert, Schrift wird allerdings gar nicht an gezeigt.
Mit Hello World
'some routines to control the display are in the glcdKS108.lib file
$lib "glcdKS108.lib"
$regfile = "m8def.dat"
'$crystal = 7372800
$baud = 9600
$lib "glcdKS108.lbx"
'First we define that we use a graphic LCD
Config Graphlcd = 128 * 64sed , Dataport = Portd , Controlport = Portc , Ce = 2, Ce2 = 1 , Cd = 5 , Rd = 4 , Reset = 0 , Enable = 3
Cls
Lcdat 1 , 1 , "Hello World"
Do
Nop 'mache nichts
Loop
Beispiel von MCS
'--------------------------------------------------------------------
' KS108.BAS
' demonstrates the KS108 based graphical display support
'--------------------------------------------------------------------
'some routines to control the display are in the glcdKS108.lib file
$lib "glcdKS108.lib"
$regfile = "m8def.dat"
$crystal = 7372800
$baud = 19200
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 = Portd , Controlport = Portc , Ce = 1 , Ce2 = 2 , Cd = 5 , Rd = 4 , Reset = 0 , Enable = 3
'Dim variables (y not used)
Dim X As Byte , Y As Byte
Print "Cls"
Cls
Wait 1
'specify the font we want to use
Setfont Font8x8
'You can use locate but the columns have a range from 1-128
'When you want to show somthing on the LCD, use the LDAT command
'LCDAT Y , COL, value
Lcdat 1 , 1 , "123"
'lcdat accepts an additional param for inversing the text
Lcdat 2 , 1 , "123" , 1 ' will inverse the text
'Now use a different font
'Setfont Font8x8
'since the 16*16 font uses 2 rows, show on row 3
'Lcdat 1 , 1 , "2345"
'Lcdat 2 , 56 , "2345656"
Wait 1
Line(0 , 0) -(128 , 64) , 1 'make line
Wait 2
Line(0 , 0) -(128 , 64) , 0 'remove line
For Y = 1 To 20
Circle(30 , 30) , Y , 1
Waitms 100
Next
Wait 1
Glcdcmd &H3E , 1 : Glcdcmd &H3E , 2 ' both displays off
Wait 1
Glcdcmd &H3F , 1 : Glcdcmd &H3F , 2 'both on
'GLCDCMD accepts an additional param to select the chip
'With multiple, GLCDCMD statements, it is best to specify the chip only the first time
Showpic 0 , 0 , Plaatje 'show a comnpressed picture
End 'end program
'we need to include the font files
'Notice that this is a testfont with only numbers defined !
'$include "smallfont8x8.font"
$include "font8x8.font"
'$include "font16x16.font"
Plaatje:
'include the picture data
$bgf "ks108.bgf"
Habe auch schon bei Google geschaut, aber leider nichts gefunden!
Hoffe ihr habt ein paar Ideen!
Gruß