AnsweredAssumed Answered

KL82Z Standalone SDK I2C Master Interrupts not working

Question asked by Cody Lundie on Mar 3, 2016
Latest reply on Mar 17, 2016 by Cody Lundie

I am currently upgrading a project from the FRDM-KL27Z to the new FRDM-KL82Z, which means using the standalone KL82Z SDK as it has not been integrated with KSDK 1.3 yet. I've been walking through my source files and testing the code that uses the SDK drivers such as SPI, I2C, etc. Everything I tested either worked immediately or needed minor modification until I started in on the I2C Master driver (blocking).

 

I am using the I2C1 driver to communicate with an Atmel ATECC508 CryptoAuthenticator IC. The code I built on top of the I2C driver wasn't working so I decided to start from scratch (with an SDK driver example) to see if I was missing something. I am using the i2c_blocking_master_example_frdmkl82z project as a testing ground and only made modifications necessary to use I2C1 instead of I2C0 which is the default bus.

 

These modifications included:

  1. Change hardware_init() to configure I2C1_IDX instead of I2C0_IDX
    1. PORTC10 is used for SCL
    2. PROTC11 is used for SDA
  2. Changed I2C_DRV_MasterInit to use instance number 1
  3. Commented out the demo code and replaced with a single call to I2C_DRV_MasterSendDataBlocking() using instance number 1

NOTE: My problem is very similar to the question found here: K22 I2C SDK Driver behaving strangely? (As in failing...) but the suggestions there did not help.

 

The issue I'm experiencing is that it appears the i2c master interrupt handler is not getting called when using I2C_DRV_MasterSendDataBlocking(). This is what I know:

  1. Master sends a start condition successfully (Oscope)
  2. Master sends the slave device address successfully (Oscope)
  3. Slave ACKs the device address successfully (Oscope)
  4. This is where the transaction stops and the driver returns kStatus_I2C_Timeout every time

oscope.jpg

(Above is my Oscope readout confirming the device address of 0xC0 is sent and ACK'd by slave)

 

What I've tried:

  1. The suggestions here: K22 I2C SDK Driver behaving strangely? (As in failing...)
  2. Confirming the same code works on the FRDM-KL27Z using SDK 1.3 (Yes it does)
  3. Walked through SDK calls and confirmed that I2C_HAL_SetIntCmd(baseAddr, true) is called before sending the slave address. (Enabling interrupts)
  4. I've tried re-installing the KL82Z standalone SDK and rebuilding ksdk_platform_lib_KL82Z7. No change.
  5. KL27Z uses PE Micro debugger and KL82Z uses JLink debugger (should that matter?)
    1. I've tried running the i2c driver with debug running and after a power-on-rest without debugger running. Same result.
  6. I've tried resistances from 1K to 10K for the bus pull ups. Same result)
  7. Varying baud rates

Test Conditions:

  1. I2C1 configured as open drain with 5.6K pull-up resistors (I've tried resistances from 1K to 10K. Same result)
  2. KDS 3.1.0
  3. KSDK_1.3.0_Standalone_KL82Z

 

I don't know what else to try since the device does indeed ACK its own address, but the master driver does not seem to "receive" the ACK and follow up with transmitting the byte data to the slave device, indicating that the issue lies in interrupt handler not getting called which I've confirmed with breakpoints in the handler. Please help!

Outcomes