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, 11 months ago.
I2C Class on p9&p10 not working?
Hello,
My first LPC4088 QSB is now just running the blinky program with full edit-compile-program-edit-... cycle.
So my next thing is to get I2C IO-expander working (a PCF8574).
It didn't work with the standard I2C class provided by the MBED library. So I toke my old code from a previous project where there was no build-in support for I2C. Meaning that it uses GPIO to emulate I2C signals. This code is working, also without external pullups. So it means I have a functional LPC4088 QSB module and my wiring is correct.
Nevertheless the I2C build-in class is not working.
My example project for I2C-Class: http://developer.mbed.org/users/karelv/code/i2c_lpc4088/ My example project for I2C-IO-based: http://developer.mbed.org/users/karelv/code/i2c_io_lpc4088/
Does somebody has same or better experience?
Best regards, Karel.
Question relating to:
1 Answer
9 years, 11 months ago.
Hi, It works when we test it. We read the temperature from an LM75 sensor (via p9/p10). I suggest that you hook up an oscilloscope and have a look at the signal waveforms. Maybe that will give you some clues what is going on. Kind Regards, Anders @ EA
Note: Quickly checked on the other I2C port: I2C_0(p32&p31) and here both demo programs are working correctly.
So my problem seems related only to I2C_1 port on p9&p10.
posted by karel.vanroye@... 07 Dec 2014Hi,
I do not know the status for using p9/p10 but I am having a small issue with using the I2C0 port on SCL pin31-P5_3 and SDA pin32-P5_2.
The SCL pin stays down at all time while the SDA pin appears to be working fine. I see data but no clock on I2C write operations. It has to be something simple, but since I am very new with using the LPC4088 and NXP code base, someone might figure out what's causing the issue faster then I do.
I tried to removed other cpu peripherals to see if any of those where keeping the pin down, but no luck yet.
This line I use is: I2C i2c_bus(p32, p31);
posted by H. Chanon 31 Jan 2015I just figured out what is my problem and It is most likely not related to this p9/p10 issue. Apparently, Using I2C0 on p5_2 and P5_3 requires a different IOCON register bitmapping (type I) not implemented in the current mbed src. (at least those I am using)
If my schedule allows it, I'll work on something and create a pull-request.
posted by H. Chanon 01 Feb 2015Hum.. Actually the handling for the specialized I2C pins appears to be there. It is done i n pinmap_pinout() in i2c_init(). It just does not allow adjusting IOCON type I options. The IOCON value I read back after configuraiton in i2c_init for pin P5_2 and P5_3 is 0xA5 which looks ok to me.
Still, my I2C SCLK on p31 does not move. I'll start another post on this.
posted by H. Chanon 02 Feb 2015I finally fixed my I2C problem, which was of unexpected nature.
Doing some measurement, I noticed that no pull-up was measured between SCL pin and 3V3. Somehow, there was no connection between J9.p31 (SCL) and R4 pull-up. I added a jumper wire between those and it fixed my problem. Was it a cold solder or a weak PCB trace? I can't say. I'll do the check on a second EA LPC4088 board I should received soon.
posted by H. Chanon 02 Feb 2015