10 years, 7 months ago.

KL25Z I2C pinmap incomplete

Not really a question, but an observation based on some I2C testing. I believe the I2C pinmap for the KL25Z is incomplete. Port pins PTC1 and PTC2 are missing from the PinMap(s) in i2c_api.c

static const PinMap PinMap_I2C_SDA[] = { {PTE25, I2C_0, 5}, {PTC9, I2C_0, 2}, {PTE0, I2C_1, 6}, {PTB1, I2C_0, 2}, {PTB3, I2C_0, 2}, {NC , NC , 0} };

static const PinMap PinMap_I2C_SCL[] = { {PTE24, I2C_0, 5}, {PTC8, I2C_0, 2}, {PTE1, I2C_1, 6}, {PTB0, I2C_0, 2}, {PTB2, I2C_0, 2}, {NC , NC, 0} };

Addition to the Ericks answer, please always update the mbed lib to the newest revision. I assume you used older revision where not all mux options were available.

posted by Martin Kojtal 03 Apr 2014

1 Answer

10 years, 7 months ago.

I think you are looking at a really outdated version: the PinMap files have been removed from the i2c_api.c file months ago, and the missing pinmaps itself of the KL25Z have been fixed afaik something like over a year ago ;). Unless of course outside the ones fixed back then there would still be others missing, however this is from the latest mbed lib:

/************I2C***************/
const PinMap PinMap_I2C_SDA[] = {
    {PTE25, I2C_0, 5},
    {PTC9,  I2C_0, 2},
    {PTE0,  I2C_1, 6},
    {PTB1,  I2C_0, 2},
    {PTB3,  I2C_0, 2},
    {PTC11, I2C_1, 2},
    {PTC2,  I2C_1, 2},
    {PTA4,  I2C_1, 2},
    {NC  ,  NC   , 0}
};
 
const PinMap PinMap_I2C_SCL[] = {
    {PTE24, I2C_0, 5},
    {PTC8,  I2C_0, 2},
    {PTE1,  I2C_1, 6},
    {PTB0,  I2C_0, 2},
    {PTB2,  I2C_0, 2},
    {PTC10, I2C_1, 2},
    {PTC1,  I2C_1, 2},
    {NC  ,  NC,    0}
};

Including PTC1 and PTC2 as you see. Here is the latest version: http://mbed.org/users/mbed_official/code/mbed-src/

Accepted Answer

Erik, Thanks for the response. When searching mbed for issues with the KL25Z I ran across a similar problem posted for the SPI bus. I followed the link in that posting to the src code, then transversed it to the I2C API code. As you pointed out it was an old revision. My bad. I should have initiated my own search of the src code. I did some more troubleshooting using the 2 pins in question as digital outputs and found that the logic levels on PTC1 are not correct, 1.85V for logic high and 0.6V for logic low. The logic levels on PTC2 are a more resonable 3V and 0V. So this appears to be a hardware issue with my board. I do, by-the-way, update my mbed library regularly. Thanks.

posted by Bill Jump 04 Apr 2014