Does anyone have a clue how to make this work? I tried the spruf98v text, the spruf98v flow charts and the example given in evmam35xx_i2c.c (all which differ) and none work. I even tried using the Atmel example code (at least their example does work on their chips) by modifying the registers, et cetera.
I am trying to set up a simple polling method on I2C2 and I2C3. On initialization I set the clock loopback, F&I clocks, prescaler, low and high time for standard speed, own address, XTRSH and RTRSH to 1 then I2C_EN. Immediately, I get an access error when I set a local variable to zero. If I clear the AERR the next line of code causes it to appear again. I tried ignoring it and set the slave address << 1 and write bit (0), I2C_CNT to 1 then I2C_EN+MST+TRX+STT. I get a buss busy that never resets. Take it out of Tx mode and RRDY never sets.
The document says to "handle it" when AERR occurs. Since I have no idea why it occurs I cannot "handle it" other than resetting it. The flow chart gives start and stop sequence for Full Transfer, 2 Phase Transfer and Multiple Phase Transfer but never mentions anywhere else what these transfers mean. It also shows if no errors occur to write all the data after only checking the status once, in other words ignore any NACK between data. The initialization sequence shows setting the slave address and count. The I2C has to be set up every time the slave address or data count changes?
I am using 16 bit access and 8 bit for addresses. No operating system.