Ralf, you can try the case select using the proper addresses (not my example). You must correct your code as per the line in black bold and comment out the line in red bold. The code compile so it should work. Longing to hear from you on the final test.
Al.
Code:
' Initialize I2C slave mode
Select case PortA
Case 1
SSPADD = 2
case 2
SSPADD = 3
case 3
SSPADD = 4
end select
SCLDIR = 1 ' SCL must be made an input before enabling interrupts
SDADIR = 1
'SSPADD = I2Caddress ' Set our address
SSPCON2.7 = 0 ' General call address disabled
SSPCON = $36 ' Set to I2C slave with 7-bit address
SSPSTAT = 0
SSPIE = 1
SSPIF = 0
RxBufferIndex = 0
TxBufferIndex = 0
'Initialization Done!
GoTo main
i2cslave: ' I2C slave subroutine
SSPIF = 0 ' Clear interrupt flag
IF R_W = 1 Then i2crd ' Read data from us
IF BF = 0 Then i2cexit ' Nothing in buffer so exit
IF D_A = 1 Then i2cwr ' Data for us (not address)
IF SSPBUF != SSPADD Then i2cexit ' Clear the address from the buffer
readcnt = 0 ' Mark as first read
GoTo i2cexit
All progress began with an idea
Bookmarks