I’m trying to implement an I2C slave functionality using your Register level interface(polled). I first tried this with I2C0 and got everything setup just fine. But when I try to send a byte to it the whole thing hangs. I watched it on an oscilloscope and the bus seems to operate just fine, all signals are proper and the SDA gets pulled down by the micro on the last clock high and everything. Since the bus appeared to work but the processor seems to just go away I was wondering if this was because there was an interrupt handler configured for this that is hanging. I tried to set the interrupt handler register but cannot instantiate a Register object to do this as I get an argument exception.
Am I right to assume you block access to this from the Register interface?
After that I tried to use I2C1, and when I try to make a Register object for the I2C1 address register I get an argument exception again. Putting in the literal directly and getting this for example:
Register I2C1AddrReg = new Register(0xE005C00C);
I then tried it with I2C2 and I can make all the Register objects I need, but setting it up just like when I did with I2C0 it just doesn’t seem to respond to anything on the bus. I’m doing everything per the datasheet and have verified the following:
PCONP is set correctly (default values are correct anyway)
Clock is set but not necessary for slave mode
PINSEL is set to proper I2C device
PINMODE is set to no pull-up or down
Address reg is set correctly
AA and I2EN are set in the control reg
Status register is always 0xF8 (no status).
I’m trying to make a Mini the slave and sending it data with a Domino. The mini is plugged into the USB, the domino is powered from the +5v/Gnd from the mini. I have external pull-ups and the edge risetime (90%) is about 85ns so everything electrically looks good to me.
At this point I’m stuck anything I should know?