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.
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:
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.
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 10 Dec 2014OK, 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 10 Dec 2014