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.
6 years, 5 months ago.
Is I2C Fast Mode Plus supported on NXP boards?
Hello,
I am working on the I2C bus of an LPC1549 and when I set the speed higher than 400kHz, the bus shows erratic behaviour.
For example:
- Setting the speed to 1MHz through I2C::frequency() results in a bus speed of 666kHz.
- As 666kHz is 2/3 of 1MHz, I called I2C::frequency() with 1.5Mhz. This gave me a bus speed of 1MHz but the data bits were delayed by one clock tick
The pins P0_23 and P0_22 that I am using support FM+ according to the LPC15XX datasheet.
When I look into TARGET_STM/i2c_api.c I see that for ST microcontrollers there is a special case defined for i2c_frequency being called with 1MHz.
There is no such case in TARGET_NXP/i2c_api.c, even though the suspicion that register I2CPADCFG needs to be modified for this case.
In conclusion, my question is: Is fast mode plus enabled for NXP devices and if it is, how do I set it up?
Happy hacking, Andrew