یه راهنمایی میخواستم در مورد شیوه پیکربندی LCD گرافیکی 128*64 با کنترلر KS108 تو بیسکام .من نسخه بیسکام که تو قسمت نرم افزار این سایت بود رو دانلود کردم و فایل glcdks108.lbx رو هم تو شاخه library داشت حالا در مورد شیوه تعریف پایه ها و اتصال اون میخواستم بدونم .
راستی این برنامه ورزن 1.11.8.7 هستش در ضمن من برنامهای که تو این ادرس بو رو چک کردم ولی در اخرین خط erorr میده
http://www.eca.ir/forum2/index.php/topic,5085.0.html
برنامه:
$regfile = "m323def.dat" ' specify the used micro
$crystal = 8000000 ' used crystal frequency
$baud = 19200 ' 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
'some routines to control the display are in the glcdKS108.lib file
$lib "glcdKS108.lib"
Wait 2
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 = 4 , Rd = 3 , Reset = 2 , Enable = 5
'The dataport is the 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 =CS1 Chip select
'CE2=CS2 Chip select second chip
'CD=Data/instruction
'RD=Read
'RESET = reset
'ENABLE= Chip Enable
'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) -(127 , 64) , 1 'make line
Wait 2
Line(0 , 0) -(127 , 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"$"
تو این خط اخری فایل ks108.bgf رو از کجا پیدا کنم
راستی این برنامه ورزن 1.11.8.7 هستش در ضمن من برنامهای که تو این ادرس بو رو چک کردم ولی در اخرین خط erorr میده
http://www.eca.ir/forum2/index.php/topic,5085.0.html
برنامه:
$regfile = "m323def.dat" ' specify the used micro
$crystal = 8000000 ' used crystal frequency
$baud = 19200 ' 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
'some routines to control the display are in the glcdKS108.lib file
$lib "glcdKS108.lib"
Wait 2
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 = 4 , Rd = 3 , Reset = 2 , Enable = 5
'The dataport is the 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 =CS1 Chip select
'CE2=CS2 Chip select second chip
'CD=Data/instruction
'RD=Read
'RESET = reset
'ENABLE= Chip Enable
'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) -(127 , 64) , 1 'make line
Wait 2
Line(0 , 0) -(127 , 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"$"
تو این خط اخری فایل ks108.bgf رو از کجا پیدا کنم
دیدگاه