Moin.
Hab an einem ATMega8 das Problem, dass ich über den I2C-Bus keine Bytes senden kann. Die Startbedingung wird noch korrekt gesetzt, das Nachfolgende Byte wird jedoch nicht mehr gesendet.
Pullups sind je 2x 2,2K.
Hier die betreffende SUB:
Über RS232 wird "c" noch ausgegeben, danach steht das Programm.Code:Sub FormatEEPROM '............................................................................. ' Format EEPROM (all bytes to 0xFF) '............................................................................. Config SCL = PORTC.5 Config SDA = PortC.4 tmpWord = 0 LED_EEPROM = Led_On BarOff 'LED-Bargraph off Bar10 = LED_ON 'Last LED on Bargraph on Print #1 , "F-" Pages = EEPROMSIZE / PAGESIZE 'EEPROMSIZE = 8192, PAGESIZE = 32 For w2 = 1 to pages Print "W2:" ; w2 INCR tmpword If tmpWord = 10 Then tmpWord = 0 Toggle Bar10 EndIf Print "a"; EEAddress = PAGESIZE * w2 EEAddress = EEAddress - PAGESIZE Print "b"; I2CStart Print "c"; I2CWByte SID_EEPROMW Print "d"; I2CWByte EEAddressH Print "e"; I2CWByte EEAddressL Print "f"; For w1 = 1 to PAGESIZE Print "W1:" ; w1 Print "g"; ' I2CWByte CTRL_EMPTY next I2CStop waitms 1 Print "e"; next PRINT #1 , "F!" LED_EEPROM = Led_Of Bar10 = LED_OFF End Sub
Sieht da jemand nen Fehler?
Lesezeichen