9 years, 4 months ago.

I2C not working?

5 sensors I2C not working for PTE0,PTE1 but if i change and connect to PTB3, PTB2 - all sensor works.

if i use PTE0,PTE1 witch rtos - mcu not respond, if change i2c to PTB3, PTB2 works well.

Question relating to:

The FRDM-K22F is an ultra-low-cost development platform for Kinetis K Series K2x (K22F) MCUs built on ARM® Cortex™-M4 processor. Features include easy access to MCU I/O, battery-ready, low-power operation, a …

1 Answer

9 years, 4 months ago.

PTB3, PTB2 are connected to on board I2C sensors and will have pull-up Rs on the board. PTE0,PTE1 are for external I2C devices and probably require external pull-up Rs to prevent the I2C bus from being stuck and crashing. Check schematic and external circuitry.

Accepted Answer

External sensors have pullup resistors and work well with another mbed controller well.

And according to schematic FRDM-K22F both i2c (PTE0,PTE1 and PTB3,PTB2) has pull up resistor (r65,r72 and r5,r12).

For my investigation today on mbed work well only lpc1768.

posted by Dmitry Dzhafarkhanov 10 Dec 2014

OK, seems that the pull-ups are installed on both I2C ports. However, looking at the schematic is turns out that PTE0/PTE1 are not only used for I2C1 but are also used for the serial connection to the host PC. The signals UART1_RX_TGTMCU and UART1_TX_TGTMCU are on the same pins. You will loose the I2C connection when the Serial serial(USB_TX,USB_RX) is declared in your software after the I2C declaration or you will loose Serial when I2C is declared last. Perhaps there is a solution by remapping I2C1 to PTC10/PTC11. These pins also have pullups (R44/R45).

posted by Wim Huiskamp 10 Dec 2014

You are right! Working! But remapping doesn't work!

posted by Dmitry Dzhafarkhanov 12 Dec 2014