INFO - FAQ - CC2-Forum - CCPro-Forum |
|
Hallo Kollegen, ich habe zwei Programme geschrieben: 1. 4 Zahlen ins EEPROM schreiben 2. 4 Zahlen aus dem EEPROM lesen und im Display anzeigen (ich möchte diese Funktionen natürlich dann in ein größeres Programm integrieren) Innerhalb eines Programmes kann ich ohne Probleme lesen und schreiben und es kommen immer die richtigen Werte. Spiele ich aber das read-Programm auf, so wird mir aber das hier ausgegeben: 7686 -1 -1 -1 Ich habe übrigens die C-Control I, Station 2.0 - konnte ich oben nicht anhaken. Kann mir da jemand weiterhelfen? Schöne Grüße Markus PROGRAMM1 ++++++++++++++++++++++++++++++++++++++++++++++++ '-------------------------- '------ I/O PORTS --------- '-------------------------- define SDA as port[9] define SCL as port[10] define EXTPORT as byteport[4] define BPORT1 as byteport[1] define LIGHT as port[16] '-------------------------- '---- SYSTEM MEMORY ------- '-------------------------- define STATION_IO as byte[3] {BYTEOFFSET 3} '-- BEGINN USERVARIABLEN ----- define i as byte define gesamt as word define today as word define gesamt2 as word define today2 as word import "....\LIB\SHOW_BINARY.BAS" import "....\LIB\PULLUP1_ENABLE.BAS" import "....\LIB\GET_KEY.BAS" PULLUP1_ENABLE() LIGHT=off LCD.INIT SDA=on SCL=on #start gesamt2 = 22 gesamt = 1111 today2 = 33 today = 4444 schreiben end function schreiben() EEPROM.WRITE gesamt2, gesamt, today2, today 'EEPROM.CLOSE #show_werte PRINT"#CLR"; LCD.POS 1,1 LCD.PRINT "write gesamt - today" LCD.POS 2,1 LCD.PRINT gesamt2 & " " & gesamt & " " & today2 & " " & today end function PROGRAMM2 ++++++++++++++++++++++++++++++++++++++++++++++++ '-------------------------- '------ I/O PORTS --------- '-------------------------- define SDA as port[9] define SCL as port[10] define EXTPORT as byteport[4] define BPORT1 as byteport[1] define LIGHT as port[16] '-------------------------- '---- SYSTEM MEMORY ------- '-------------------------- define STATION_IO as byte[3] {BYTEOFFSET 3} '-- BEGINN USERVARIABLEN ----- define i as byte define gesamt as word define today as word define gesamt2 as word define today2 as word import "....\LIB\SHOW_BINARY.BAS" import "....\LIB\PULLUP1_ENABLE.BAS" import "....\LIB\GET_KEY.BAS" PULLUP1_ENABLE() LIGHT=off LCD.INIT SDA=on SCL=on EEPROM.READ gesamt2, gesamt, today2, today 'EEPROM.CLOSE #show_werte PRINT"#CLR"; LCD.POS 1,1 LCD.PRINT "read gesamt - today" LCD.POS 2,1 LCD.PRINT gesamt2 & " " & gesamt & " " & today2 & " " & today end |
Antwort schreiben |