Hello all.
I just started messing around some pic24s and ran into a little problem. I am trying to use the I2C in slave mode and so far it will acknowledge the address, but it does not hold the clock line low to peform clock stretching.
Here's what I'm working with now...
I am also using the secondary pins (ASDA, ASCL)... I know that shouldn't make a difference, but who knows?
I just started messing around some pic24s and ran into a little problem. I am trying to use the I2C in slave mode and so far it will acknowledge the address, but it does not hold the clock line low to peform clock stretching.
Here's what I'm working with now...
Code:
__i2c_slave_init:
mov #0, w0
mov.b WREG, i2c_len
mov.b WREG, i2c_flags
bset I2C1CON, #I2CSIDL
bset I2C1CON, #DISSLW
bset I2C1CON, #STREN
movlf #0xff, I2C1BRG
movlf #0x22, I2C1ADD
bclr IFS1, #SI2C1IF
bset I2C1CON, #I2CEN
return
.end