Forum: Mikrocontroller und Digitale Elektronik KS0073 EA DIP204B-4NLW Bascom Frage


von gast (Gast)


Lesenswert?

Ich habe ein Problem mit der Zeichen Darstellung am KS0073 über einen 
PCF8574AP

Angeschlossen ist das Diplay wie Folgt
PCF |  DISPL.
______
P0  | DB4
P1  | DB5
P2  | DB6
P3  | DB7
P4  | RS
P5  |
P6  |
P7  | E

Quelcode
$regfile = "m8def.dat"                                      ' 
Atmega8,88,168,32
$crystal = 16000000                                         ' Externer 
Quarz
$baud = 9600
$hwstack = 64
$swstack = 8
$framesize = 32
$lib "Lcd_i2c.lib"
$lib "Key_i2c.lib"
' ###########################
' ###  I2C Konfiguration  ###
' ###########################
Config Pinc.2 = Output                                      'I²C2
Config Pinc.3 = Output                                      'I²C2
Config Scl = Portc.3                                        'I²C2 SCL
Config Sda = Portc.2                                        'I²C2 SDA
' ###########################
' ###  LCD Konfiguration  ###
' ###########################
Const Pcf8574_lcd = &H70
'delay = 2 bei max. 2,5m Kabel, bei 4m Kabel delay = 3 oder höher !!
Config I2cdelay = 3                          'PCF Adresse für LCD war 5
Config Lcd = 20 * 4a , Chipset = Ks0073                     'configure 
lcd screen
'Config Lcdbus = 4
Const Lcdrows = 4
Const Lcdcols = 20
Dim _lcd_e As Byte                                          'Needed to 
control 4 line LCD
_lcd_e = 128
'Cursor Off Noblink
Const Menumaxlines = 10
Lcd "Zeile1==========1==="
Locate 2 , 1
Lcd "Zeile2==========2==="
Locate 3 , 1
Lcd "Zeile3==========3==="
Locate 4 , 1
Lcd "Zeile4==========4==="

Die Zeilen werden schon Korekt erkannt aber der erste Pixel ist um eins 
versetz so das gerade mal die letzten Zahlen noch auf dem Dips sind.

von gast (Gast)


Angehängte Dateien:

Lesenswert?

hier noch die lib fürs LCD
ich denke mal das an der init liegt.
sind die pins d0-d4 auf GND dann zeigt er zwar die zeiche korekt an, 
jedoch alles verschoben (nicht nur zeilen vertauscht)

von gast (Gast)


Lesenswert?

hat keiner eine  idee wie das problem zu lösen ist? habe schon viele 
beiträge hier dazu gelesen, aber keine der beiträge hat zu einer lösung 
geführt, schätze mal das es an der LCD_i2c.lib liegt. direkt am atmega 
ohne diese lib geht alles ohne problem

von bascom (Gast)


Lesenswert?


von gast (Gast)


Lesenswert?

Hatte ich auch schon drin
hab auch die positionen mal vertauscht hat alles nichts gebracht leider.
auch mit Zeiten gespielt, naja meist habe ich gelesen das man teilweise 
mis 300ms warten soll auch 5s bringen da nichts
1
' ###########################
2
' ### Grund Konfiguration ###
3
' ###########################
4
$regfile = "m168def.dat"                                    ' Atmega8,88,168,32
5
$crystal = 1000000
6
$baud = 9600
7
$hwstack = 64
8
$swstack = 8
9
$framesize = 32
10
$lib "Lcd_i2c.lib"
11
' ###########################
12
' ###  I2C Konfiguration  ###
13
' ###########################
14
Config Pinc.2 = Output                                      'I²C2
15
Config Pinc.3 = Output                                      'I²C2
16
Config Scl = Portc.3                                        'I²C2 SCL
17
Config Sda = Portc.2                                        'I²C2 SDA
18
' ###########################
19
' ###  LCD Konfiguration  ###
20
' ###########################
21
Const Pcf8574_lcd = &H70
22
Dim _lcd_e As Byte                                          'Needed to control 4 line LCD
23
_lcd_e = 128
24
Wait 5
25
Initlcd
26
Config I2cdelay = 3                                         'PCF Adresse für LCD war 5
27
Config Lcd = 20 * 4                                         'configure lcd screen
28
Config Lcdbus = 4
29
Const Lcdrows = 4
30
Const Lcdcols = 20
31
32
'Cursor Off Noblink
33
Const Menumaxlines = 10
34
35
36
37
Do
38
Cls
39
Locate 1 , 1
40
Lcd "Zeile17890123"
41
Locate 2 , 1
42
Lcd "ZEILE2222222"
43
Locate 3 , 1
44
Lcd "ZEILE3333333"
45
Locate 4 , 1
46
Lcd "ZEILE4444444"
47
Wait 2
48
Cls
49
Waitms 100
50
loop

von gast (Gast)


Lesenswert?

so schaut es aktuell aus

Locate 1 , 1
Lcd "Zeile17890123"
Locate 2 , 1
Lcd "ZEILE2222222"
Locate 3 , 1
Lcd "ZEILE3333333"
Locate 4 , 1
Lcd "ZEILE4444444"
das Display
---------------------------
|Zeile17890123            |
|            ZEILE3333333|
|ZEILE2222222            |
|            ZEILE4444444|
---------------------------
 wenn
Locate 1 , 1
Lcd "Zeile178901234567890"
Locate 2 , 1
Lcd "ZEILE2222222"
Locate 3 , 1
Lcd "ZEILE3333333"
Locate 4 , 1
Lcd "ZEILE4444444"

dann
---------------------------
|Zeile178901234567890|
|34567890ZEILE3333333|
|ZEILE2222222            |
|            ZEILE4444444|
---------------------------

ab der 3 Steht alles von zeile 1 am anfang der zeile 2 bessergesagt dort 
wo locate 3 dargestellt wird.

von gast (Gast)


Angehängte Dateien:

Lesenswert?

HAllo,
auch wenn mir in diesem forum leider keiner hhelfen konnte, habe ich 
eine lösung bekommen.
diese ist jetzt in der lib im anhang mit drin.

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.