Hakko zusammen,
ich bin seit kurzem in die Welt der Atmega´s eingestiegen, Also bitte nicht gleich mit dem Hammer drauf hauen. Ich habe seit einigen Tagen mein Display zum laufen versucht, ausser ein hell beleuchteter Bildschirm kommt nichts. Nach einer gewissen Zeit zuckt mein Amperemter an der Spannungsversorgung, und dann geht alles aus, und meine Spannungsversorgung meldet Überlast ?!?
Ich habe meine Verdrahtung nochmasl genau nachgeschaut und habe auch mein Display auf der Rückseite mit Isolierband mal abgeklebt. Sor ichtig weisss ich jetzt aber auch nicht mehr weiter.
Da ich mir nicht ganz sicher war mit dem programmieren, habe ich mir das Beispiel von Bascom angepasst.
Ich hoffe ihr könnt mir helfen ....
Den Code den ich übertragen habe, ist folgender:
CodeBox BASCOM
ich bin seit kurzem in die Welt der Atmega´s eingestiegen, Also bitte nicht gleich mit dem Hammer drauf hauen. Ich habe seit einigen Tagen mein Display zum laufen versucht, ausser ein hell beleuchteter Bildschirm kommt nichts. Nach einer gewissen Zeit zuckt mein Amperemter an der Spannungsversorgung, und dann geht alles aus, und meine Spannungsversorgung meldet Überlast ?!?
Ich habe meine Verdrahtung nochmasl genau nachgeschaut und habe auch mein Display auf der Rückseite mit Isolierband mal abgeklebt. Sor ichtig weisss ich jetzt aber auch nicht mehr weiter.
Da ich mir nicht ganz sicher war mit dem programmieren, habe ich mir das Beispiel von Bascom angepasst.
Ich hoffe ihr könnt mir helfen ....
Den Code den ich übertragen habe, ist folgender:
CodeBox BASCOM
'-----------------------------------------------------------------------------------------
'name : ks108.bas
'copyright : (c) 1995-2005, MCS Electronics
'purpose : demonstrates the KS108 based graphical display support
'micro : Mega323
'suited for demo : no
'commercial addon needed : no
'-----------------------------------------------------------------------------------------
$regfile = "m32def.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 = 2 , Ce2 = 3 , Cd = 4 , Rd = 5 , Reset = 6 , Enable = 7
'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"