Forum: Mikrocontroller und Digitale Elektronik "glcdKS108.lbx" bascom


von klaus (Gast)


Lesenswert?

Hallo,

ich versuche eindisplay mit dem KS0108 controller anzusteuern.
Die Sample dateien von Bascom
ich verwende dafür einen atmega32. Um zu prüfen,ob der contoller 
anläuft, habe ich eine LED an einen freien Port angeschlossen...
siehe da, der controller läuft NICHT los...
sobald man den teil "Config Graphlcd = 128 * 64sed ....." ausklammert 
läuft der controller los.. also scheint er beim setzten der 
konfiguration die Probleme zu machen....

hat einer vielleicht eine ahnung oder eine lösung??

hier mein code
1
'-----------------------------------------------------------------------------------------
2
'name                     : ks108.bas
3
'copyright                : (c) 1995-2005, MCS Electronics
4
'purpose                  : demonstrates the KS108 based graphical display support
5
'micro                    : Mega323
6
'suited for demo          : no
7
'commercial addon needed  : no
8
'-----------------------------------------------------------------------------------------
9
10
$regfile = "m32def.dat"                                     ' specify the used micro
11
$crystal = 8000000                                          ' used crystal frequency
12
$baud = 19200                                               ' use baud rate
13
$hwstack = 32                                               ' default use 32 for the hardware stack
14
$swstack = 10                                               ' default use 10 for the SW stack
15
$framesize = 40                                             ' default use 40 for the frame space
16
17
18
'some routines to control the display are in the glcdKS108.lib file
19
$lib "glcdKS108.lbx"
20
21
22
Wait 2
23
24
Print "Config"                                              ' printing will still work as only the receiver pin is disabled
25
26
27
'First we define that we use a graphic LCD
28
Config Graphlcd = 128 * 64sed , Dataport = Porta , Controlport = Portc , Ce = 0 , Ce2 = 1 , Cd = 4 , Rd = 3 , Reset = 2 , Enable = 5
29
Config Portd = Output
30
Portd.6 = 1
31
32
33
'The dataport is the portname that is connected to the data lines of the LCD
34
'The controlport is the portname which pins are used to control the lcd
35
'CE =CS1  Chip select
36
'CE2=CS2  Chip select second chip
37
'CD=Data/instruction
38
'RD=Read
39
'RESET = reset
40
'ENABLE= Chip Enable
41
42
43
44
'Dim variables (y not used)
45
Dim X As Byte , Y As Byte
46
47
48
49
Print "Cls"
50
Cls
51
52
Wait 1
53
54
'specify the font we want to use
55
Setfont Font8x8
56
57
58
'You can use locate but the columns have a range from 1-128
59
'When you want to show somthing on the LCD, use the LDAT command
60
'LCDAT Y , COL, value
61
Lcdat 1 , 1 , "123"
62
63
'lcdat accepts an additional param for inversing the text
64
Lcdat 2 , 1 , "123" , 1                                     ' will inverse the text
65
66
'Now use a different font
67
'Setfont Font8x8
68
'since the 16*16 font uses 2 rows, show on row 3
69
'Lcdat 1 , 1 , "2345"
70
'Lcdat 2 , 56 , "2345656"
71
Wait 1
72
Line(0 , 0) -(127 , 64) , 1                                 'make line
73
Wait 2
74
Line(0 , 0) -(127 , 64) , 0                                 'remove line
75
76
For Y = 1 To 20
77
   Circle(30 , 30) , Y , 1
78
   Waitms 100
79
Next
80
81
Wait 1
82
Glcdcmd &H3E , 1 : Glcdcmd &H3E , 2                         ' both displays off
83
Wait 1
84
Glcdcmd &H3F , 1 : Glcdcmd &H3F , 2                         'both on
85
'GLCDCMD accepts an additional param to select the chip
86
'With multiple, GLCDCMD statements, it is best to specify the chip only the first time
87
88
89
Showpic 0 , 0 , Plaatje                                     'show a comnpressed picture
90
End                                                         'end program
91
92
93
'we need to include the font files
94
'Notice that this is a testfont with only numbers defined !
95
'$include "smallfont8x8.font"
96
$include "font8x8.font"
97
'$include "font16x16.font"
98
99
100
Plaatje:
101
'include the picture data
102
$bgf "ks108.bgf"

von spess53 (Gast)


Lesenswert?

Hi

>sobald man den teil "Config Graphlcd = 128 * 64sed ....." ausklammert

Bascom-Hilfe:
>For SED displays use 128  64sed or 120 64SED or SED180*32

Du hast aber kein SEDxxxx Display.

MfG Spess

von klaus (Gast)


Lesenswert?

Hallo,

ohne das "sed" gibt es wieder fehler zu kompilieren, das problem, ist ja 
auch, dass der controller nicht mehr weiterläuft, ab dieser zeile....

viele Grüße

von holger (Gast)


Lesenswert?

PORTC -> JTAG Fuse abschalten

von klaus (Gast)


Lesenswert?

jtag fuse ist abgeschaltet......

ich versuche nohmal das problem zu erläutern.
1
'-----------------------------------------------------------------------------------------
2
'name                     : ks108.bas
3
'copyright                : (c) 1995-2005, MCS Electronics
4
'purpose                  : demonstrates the KS108 based graphical display support
5
'micro                    : Mega323
6
'suited for demo          : no
7
'commercial addon needed  : no
8
'-----------------------------------------------------------------------------------------
9
10
$regfile = "m32def.dat"                                     ' specify the used micro
11
$crystal = 8000000                                          ' used crystal frequency
12
$baud = 19200                                               ' use baud rate
13
$hwstack = 32                                               ' default use 32 for the hardware stack
14
$swstack = 10                                               ' default use 10 for the SW stack
15
$framesize = 40                                             ' default use 40 for the frame space
16
17
18
'some routines to control the display are in the glcdKS108.lib file
19
$lib "glcdKS108.lbx"
20
21
22
Wait 2
23
24
Print "Config"                                              ' printing will still work as only the receiver pin is disabled
25
26
27
'First we define that we use a graphic LCD
28
'Config Graphlcd = 128 * 64sed , Dataport = Porta , Controlport = Portc , Ce = 0 , Ce2 = 1 , Cd = 4 , Rw = 3 , Reset = 2 , Enable = 5
29
Config Portd = Output
30
Portd.6 = 1
31
32
33
'The dataport is the portname that is connected to the data lines of the LCD
34
'The controlport is the portname which pins are used to control the lcd
35
'CE =CS1  Chip select
36
'CE2=CS2  Chip select second chip
37
'CD=Data/instruction
38
'RD=Read
39
'RESET = reset
40
'ENABLE= Chip Enable
41
42
43
44
'Dim variables (y not used)
45
Dim X As Byte , Y As Byte
46
47
48
49
Print "Cls"
50
Cls
51
52
Wait 1
53
54
'specify the font we want to use
55
'Setfont Font8x8
56
57
58
'You can use locate but the columns have a range from 1-128
59
'When you want to show somthing on the LCD, use the LDAT command
60
'LCDAT Y , COL, value
61
'Lcdat 1 , 1 , "123"

so leuchtet dei LED!!!!
1
'-----------------------------------------------------------------------------------------
2
'name                     : ks108.bas
3
'copyright                : (c) 1995-2005, MCS Electronics
4
'purpose                  : demonstrates the KS108 based graphical display support
5
'micro                    : Mega323
6
'suited for demo          : no
7
'commercial addon needed  : no
8
'-----------------------------------------------------------------------------------------
9
10
$regfile = "m32def.dat"                                     ' specify the used micro
11
$crystal = 8000000                                          ' used crystal frequency
12
$baud = 19200                                               ' use baud rate
13
$hwstack = 32                                               ' default use 32 for the hardware stack
14
$swstack = 10                                               ' default use 10 for the SW stack
15
$framesize = 40                                             ' default use 40 for the frame space
16
17
18
'some routines to control the display are in the glcdKS108.lib file
19
$lib "glcdKS108.lbx"
20
21
22
Wait 2
23
24
Print "Config"                                              ' printing will still work as only the receiver pin is disabled
25
26
27
'First we define that we use a graphic LCD
28
Config Graphlcd = 128 * 64sed , Dataport = Porta , Controlport = Portc , Ce = 0 , Ce2 = 1 , Cd = 4 , Rw = 3 , Reset = 2 , Enable = 5
29
Config Portd = Output
30
Portd.6 = 1
31
32
33
'The dataport is the portname that is connected to the data lines of the LCD
34
'The controlport is the portname which pins are used to control the lcd
35
'CE =CS1  Chip select
36
'CE2=CS2  Chip select second chip
37
'CD=Data/instruction
38
'RD=Read
39
'RESET = reset
40
'ENABLE= Chip Enable
41
42
43
44
'Dim variables (y not used)
45
Dim X As Byte , Y As Byte
46
47
48
49
Print "Cls"
50
Cls
51
52
Wait 1
53
54
'specify the font we want to use
55
'Setfont Font8x8
56
57
58
'You can use locate but the columns have a range from 1-128
59
'When you want to show somthing on the LCD, use the LDAT command
60
'LCDAT Y , COL, value
61
'Lcdat 1 , 1 , "123"

SO NICHT!

viele Grüße

von Klaus (Gast)


Lesenswert?

konnte schon einer das Problem nachvollzeihen??

Bitte melde dich an um einen Beitrag zu schreiben. Anmeldung ist kostenlos und dauert nur eine Minute.
Bestehender Account
Schon ein Account bei Google/GoogleMail? Keine Anmeldung erforderlich!
Mit Google-Account einloggen
Noch kein Account? Hier anmelden.