Strange problem with i2c master on FRDM board

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Strange problem with i2c master on FRDM board

Jump to solution
1,393 Views
steve_fae
Senior Contributor I

Trying to see any Master i2c bus activity on the FRDM board.  I actually turned on both i2c ports [just to make sure something didn't happen to one port.

For one port, I used the I2C_LDD method, basically copied straight out of the "typical usage"


3456_3456.png

And not seeing any activity on either the clock line or data line [which has a 10K pullup resistor to 3v of course]

I used the higher level component just to send one byte on the other i2c port.  .

test:  I2C2_SendChar(0xaa);

goto test;

Problem:  I don't see any activity at all.  The clock lines are non-active.  Any ideas?


0 Kudos
1 Solution
929 Views
steve_fae
Senior Contributor I

Well I still don't have i2c fully running but I now have a clock active during Master i2c transmission.  Since I am new to Kinetis programming, I was calling the i2c master transmit from a timer interrupt routine.  Basically I am just data logging for time on.  When I moved the call outside of the interrupt routine I am now able to see the clock.  Interesting to note also is for the eeprom, Microchip only suggests using a pullup on the SDA line.  But for the FRDM board, while communicating with the accelerometer, they use a pullup on both the SDA and SCL lines.  So I added the additional pullup as well. 

View solution in original post

0 Kudos
6 Replies
929 Views
BlackNight
NXP Employee
NXP Employee

It is possible to cut off the clock from many peripherals on the KL25Z, known as 'clock gating'. But by default this should not be the case.

I suggest that you try one of my examples (e.g. Accelerometer demo) on GitHub if they work for you.

930 Views
steve_fae
Senior Contributor I

Got i2c working on the FRDM board.  Thanks for your help again Erich. 

0 Kudos
930 Views
Smiffytech
Contributor III

Just out of interest, what was your solution?

0 Kudos
930 Views
steve_fae
Senior Contributor I

Well I still don't have i2c fully running but I now have a clock active during Master i2c transmission.  Since I am new to Kinetis programming, I was calling the i2c master transmit from a timer interrupt routine.  Basically I am just data logging for time on.  When I moved the call outside of the interrupt routine I am now able to see the clock.  Interesting to note also is for the eeprom, Microchip only suggests using a pullup on the SDA line.  But for the FRDM board, while communicating with the accelerometer, they use a pullup on both the SDA and SCL lines.  So I added the additional pullup as well. 

0 Kudos
930 Views
Smiffytech
Contributor III

Weird about the pull-up on SDA only, unless there is some sort of pull-up in the Microchip part - because the electrical nature of I2C means it HAS to have pull-up resistors on both SDA and SCL. So, if you're doing I2C on pins other than the ones with the pull-ups on the Freedom board, yes, you need those resistors.

0 Kudos
929 Views
steve_fae
Senior Contributor I

Hey Erich, I ran your project and probed the signals at the pullup resistors on the FRDM board.  I see activity.  When I try to reconfigure the component and move the signals to any other i2c port pins and add some additional 5K pullups I still don't see any activity. 

There is a bit of a mystery to i2c on this lovely FRDM board. 

0 Kudos