Kw41z i2c setup

cancel
Showing results for 
Search instead for 
Did you mean: 

Kw41z i2c setup

940 Views
ppz
Contributor II

Hello,

I use a KW41Z board as a master and a LTC3207 LED driver as a slave device and try to set up a communication between this devices. I have checked the accelerometer example and it was relatively simple, now I use almost the same code with some modifications as changing I2C1 bus to I2C0, setting up SDA/SCL ports (I use pull-down resistor in my ports configuration in this case), addresses, etc. The SDA/SCL lines are both connected to the voltage source with two ~10k ohm resistors for each connection. No matter what I send, the ack bit is always received, even if the I2C lines are only connected to the board ports and to the voltage source. What can be possibly wrong? I had the same issue with setting up some digital temperature sensor working on One Wire protocol by using GPIO ports.

Best regards,

Petr

0 Kudos
3 Replies

688 Views
chris_brown
NXP Employee
NXP Employee

Hi ppz‌,

Your hardware setup sounds a little odd.  I wouldn't enable the pull up/down resistor in my pin configuration.  I especially don't recommend enabling the pull down resistor.  I2C needs external pull-up resistors.  10K pull ups also sound a bit high.  Not that they're not possible to use for the slower baud rates, but if you want higher baud rates you need to use a stronger pull-up.  I would recommend something around 2K - 4K. The FRDM-KW41Z uses 2.2K ohms. 

Hope this helps,

Chris  

0 Kudos

688 Views
ppz
Contributor II

Ok, I've tried to disable any internal pull-up/pull-down resistors and changed the external pull-up resistors of the I2C lines to ~4k ohms. The result remains the same.

Here is the code of the pin configuration if that helps.

 const port_pin_config_t portc_pin16_config = {
 kPORT_PullDisable,
 kPORT_FastSlewRate, 
 kPORT_PassiveFilterDisable, 
 kPORT_LowDriveStrength, 
 kPORT_MuxAlt3,
 };

0 Kudos

688 Views
chris_brown
NXP Employee
NXP Employee

Hi ppz‌,

At a brief glance, it looks fine.  Which pins are you using?  Do you have an oscilloscope trace of the I2C transaction (NOT a logic analyzer trace)?

~Chris

0 Kudos