I've been trying to get the accelerometer on the KW40Z development board to work but have had no luck. I have changed the power mode to boost at the moment since the buck and buck auto-start don't supply enough voltage to the accelerometer to turn it on. I keep getting an arbitration lost error when the master tries to communicate to the slave. The master uses the slave address 0x1d or 0x1c (I'm not sure which one when looking at the schematic so I've tried both.). I have used an oscilloscope to verify the P3V3 is at 3V to power the accelerometer which requires a voltage between 1.95V and 3.3V. I have the jumper on J8 so that P3V3 is connected to P3V3_BRD, which powers the accelerometer. The I2C1 status register shows bus busy all the time, which I believe is because the SCL and SDA lines to I2C1 are always at 0V. I have verified this with an oscilloscope attached to J4 pin 10 and 12 according the KW40Z user guide. I have gone to the code in pin_mux.c in function configure_i2c_pins that is supposed to enable the pull up resistors for SCL and SDA on pins PTC2 and PTC3. The line remains low for both SDA and SCL after the code to set pull mode to kPortPullUp has been executed. This code sets the proper registers at PORTC index 2 and 3 for pins 2 and 3. They both get set to 0x307, which enables the pull up resistor. I'm not sure what the problem is since the correct bits are set to pull the line up, but the voltage still remains at 0. I also verified that the correct mux to use is ALT3 for I2C1_SCL and I2C1_SDA on pins PTC2 and PTC3 so as far as I can tell all the correct bits are set int PORTC for pins 2 and 3.
I've attached the i2c_comm demo app that I have modified for KW40Z. I'm using master IAR.
Any help is appreciated. Thank you!
Original Attachment has been moved to: i2c_comm.zip