How do I utilize I2C0? In an existing custom design, pins 9,10 (I2C1) and 27,28 (I2C2) are already used. To add an I2C device to the design I need to use I2C0. The mbed libraries only allow the use of I2C1 & 2. Does anyone have any code that uses I2C0? or is there any way to modify the mbed library functions to use I2C0? I'm hoping I don't have to re-invent the wheel and write to the bare registers. It seems like a non-trivial state machine.
How do I utilize I2C0? In an existing custom design, pins 9,10 (I2C1) and 27,28 (I2C2) are already used. To add an I2C device to the design I need to use I2C0. The mbed libraries only allow the use of I2C1 & 2. Does anyone have any code that uses I2C0? or is there any way to modify the mbed library functions to use I2C0? I'm hoping I don't have to re-invent the wheel and write to the bare registers. It seems like a non-trivial state machine.
So you would have to fix the software and add some wiring. Don't recommend that.
See if you can modify your code to use I2C1 or I2C2 instead, or look into adding an external I2C multiplexer (nxp has several devices) or add some other device like a UART-to-I2C converter.
The problem with I2C0 is not so much the library. The problem is that the pins for I2C0 (p0.28, P0.27) are not available on any of the external mbed pins. See table on
http://mbed.org/users/Lerche/notebook/lpc1768-pin-functions/
So you would have to fix the software and add some wiring. Don't recommend that.
See if you can modify your code to use I2C1 or I2C2 instead, or look into adding an external I2C multiplexer (nxp has several devices) or add some other device like a UART-to-I2C converter.
Wouldnt recommend using a software hack for anything serious though
I recently had to write a software i2c library for the same reason, not sure about performance, but it works (at least in my test case of 1 device), <<library /users/p3p/libraries/SoftwareI2C/latest>> Wouldnt recommend using a software hack for anything serious though
Hi Ceri, Did that work on your custom board?
David.
<<quote ceri>>
I have compiled with
**I2C MyI2C (P0_27,P0_28);
but not tested functionality, yet.
Will tell you if it works on my custom board.
**Ceri.
<</quote>>
Important Information for this Arm website
This site uses cookies to store information on your computer.
By continuing to use our site, you consent to our cookies.
If you are not happy with the use of these cookies, please review our
Cookie Policy
to learn how they can be disabled.
By disabling cookies, some features of the site will not work.
Access Warning
You do not have the correct permissions to perform this operation.
How do I utilize I2C0? In an existing custom design, pins 9,10 (I2C1) and 27,28 (I2C2) are already used. To add an I2C device to the design I need to use I2C0. The mbed libraries only allow the use of I2C1 & 2. Does anyone have any code that uses I2C0? or is there any way to modify the mbed library functions to use I2C0? I'm hoping I don't have to re-invent the wheel and write to the bare registers. It seems like a non-trivial state machine.