Operating LPC824 as I2C Slave

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Operating LPC824 as I2C Slave

964 Views
grahamsewell
Contributor I

I am operating the LPC824 as an I2C slave and have used the example code along with various other source from the support pages.  My problem relates to the first ACK to the slave address.  I have created a master using an LPC4088 board (which was available) and I have tested this with a known I2C peripheral.  It sends a slave address and two command bytes.  Connecting this to my LPC824 fails after transmission of the Slave address as the 824 is not pulling SDA low.  However, it seems to go to a half Vcc level which is seen by the 4088 as NAK.  I initially tried using interrupt mode but am now using the code at the end of the UM10800 data sheet.  This is in a tight loop so SLVCONTINUE is being set as soon as the slave address is received.  I can see that the address is correct and that a match is found to the 824 configuration.  Sometimes I am also seeing a half Vcc level on the 9th (ACK) clock from the master (SCL).  I am using the internal system clock; is the I2C divider crucial when running only in slave mode?  Any ideas anybody, please?

0 Kudos
1 Reply

487 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Graham Sewell,

    Thank you for your interest in NXP LPC product, I would like to provide service for you!

   Now, please check these points.

1. Add external pull up resistor(2K to 10K) in the SCL and SDA pin.

2. in LPC824, please try to use I2C0, pin PIO0_10 and PIO0_11 as the slave.

3. Please refer to the LPC824 datasheet, check the Dynamic characteristic is meet the LPC824 demand, what the SCL clock from your master? You can try to decrease the SCL clock, and test it at first. Take an example, use 20Khz.

4. If you didn't use the same power system in your master and slave, you need to connect the GND together, and make sure the slave already in receive mode before your master send the data.

Please check these points at first, if you still have problem, please also attached the oscilloscope communication wave, especially the half VCC level on the 9th clock.

You can also attach the LPC824 slave I2C code.


Have a great day,
Kerry

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos