Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
8 years, 2 months ago.
I2C on 32-pin KL25Z
I have an inductance to digital converter (LDC1614, Texas Instruments) connected to a KL25Z with just 32 pins. Due to some misunderstanding we connected the I2C pins of this LDC1614 to PTC4 (SCL) and PTC5 (SDA) but that generates the error "pinmap not found for peripheral". According to the datasheet of the KL25Z (p. 45) I should have used other pins (like PTB0 and PTB1) but unfortunately we did not. Is there any work around to use our original pins (PTC4 and PTC5) for the I2C communication?
Thank you very much for any advice!
1 Answer
8 years, 2 months ago.
In case these pins can not support any of the I2C hardware engines on the KL25Z platform you could use a software implementation of I2C (bit banged version of the mbed I2C lib API) using the PTC4,PTC5 pins. That is not too difficult in case the KL25Z is the I2C master. Obviously you sacrifice some performance and ease of use.
The alternative workaround could be to define the (incorrect pins) as DigitalIn (same as not using them at all) and use some jumper wires from valid I2C pins to short them with the unused PTC4,PTC5. In fact that solution is pretty much the same as modifying the PCB routing or wiring.