I2C driver is working with LPC1224 but same driver is not working with LPC1225, why?

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

I2C driver is working with LPC1224 but same driver is not working with LPC1225, why?

1,134 次查看
santoshkatke
Contributor I

Greetings,

 

Below is the attached I2C.c source file for I2C module of LPC122x series MCUs to communicate with EEPROM IC. Its working fine with LPC1224 but the same source file is not working with LPC1225. These ICs i have tried on the same board but failed to communicate with EEPROM by using LPC1225.

Thanks in advance.

Original Attachment has been moved to: I2C.c.zip

0 项奖励
回复
3 回复数

998 次查看
santoshkatke
Contributor I

Thanks Mr. Kerry for your valuable reply,

I have gone through your mentioned points(1,2,3) and i am sure that there is no problem with the I2C code/hardware since this hardware is already working with LPC1224 MCU.

As far as system clock is concerned i have tried for 24MHz and 48MHz clock as well for LPC1225.

But when i checked wave forms on DSO i found that amplitude of SCL is around 1.1 Volts and that could be the problem of LPC1225 MCU itself, i think. 

0 项奖励
回复

998 次查看
kerryzhou
NXP TechSupport
NXP TechSupport

Hello Santosh Katke,

   Please attached your I2C wave for my analysis.

   Thank you!


Have a great day,
Kerry

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

0 项奖励
回复

998 次查看
kerryzhou
NXP TechSupport
NXP TechSupport

Hello Santosh Katke,

     The I2C module in LPC1224 and LPC1225 is the same.

     I think you can check these points:

1. the system clock

  As you know, the I2C module clock I2C_PCLK is provided by the system clock, so you need to check whether your LPC1225 system clock is the same as LPC1224.

2. Hardware.

  I2C pin PIO0_10 and PIO0_11 need to add the external pull up resitor.

3. PIO code configuration.

   Check register LPC_IOCON->PIO0_10 and LPC_IOCON->PIO0_11, whether the function is 0X02.

pastedImage_1.png

Because your code is:

      LPC_IOCON->PIO0_10 |= 0x02;        /* I2C SCL */
      LPC_IOCON->PIO0_11 |= 0x02;        /* I2C SDA */

If your register is 0X01 before your run the above code, then you will make the FUNC =0x3.

Please double check it.

 4.You can check the I2C wave with the Logic Analyzer or the oscillator both in LPC1224 and LPC1225.

   Check i2c bus wave, just to find the root problem, whether the clock baudrate is the same, where the I2C is stopping.

Please check it at first.

Any updated information, please let me know!


Have a great day,
Kerry

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