Hi I was wondering if anyone could give me a clue as to what's going wrong here, it's driving me nuts? Signals look ok as far as I can see, 4k7 pull ups fitted on both lines
I've got a P18f252 interfaceing with a 24LC84 eeprom, it's in HS PLL mode, the eeprom is the only device on the bus...
Any help would be appreciated.
My code is sitting in a loop with the following code...
'defines
'DEFINE OSC 40 ' Operating frequency
'DEFINE I2C_SLOW 1
'I2C_CON CON %10100000 ' Memory I2c control byte
'i2c_sda var PORTA.0 ' I2C serial data line
'i2c_scl var PORTA.1 ' I2C serial clock line
mem_off = 0;
MyWordWr = MyWordWr+1
i2cwrite i2c_sda, i2c_scl, I2C_CON, mem_off, [MyWordWr]
i2cRead i2c_sda, i2c_scl, I2C_CON, mem_off, [MyWordRd]
ram[F05_HI] = MyWordRd/256 'This register can be read over modbus
ram[F05_LO] = MyWordRd
ram[F10_HI] = MyWordWr/256 'This register can be read over modbus
ram[F10_LO] = MyWordWr
Bookmarks