I2C frequency accuracy

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

I2C frequency accuracy

626 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by guillaumeL on Tue Nov 20 05:37:47 MST 2012
Hi,

  I'm developing an application using I2C interface of the LPC1769. All is working fine but it seems the I2C SCL frequency is not accurate. For example, when I want this frequency at 100kHz it is OK but if I set 400kHz the frequency is only 350 kHz.

  I use the PLL0 with Main oscillator @ 12MHz as input. The setting of the PLL is LPC_SC->PLL0CFG = 0x10018; (N= 2 & M = 25). Fcco is 300 MHz and I set LPC_SC->CCLKCFG = 0x02; to get 100MHz as system clock.

  I2C clk is equal to system clock.

  Do you know where this frequency "error" can come from?

Regards,
0 Kudos
2 Replies

596 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Harukana on Wed Apr 10 06:13:34 MST 2013

Quote: guillaumeL
Hi,

  I'm developing an application using I2C interface of the LPC1769. All is working fine but it seems the I2C SCL frequency is not accurate. For example, when I want this frequency at 100kHz it is OK but if I set 400kHz the frequency is only 350 kHz.

  I use the PLL0 with Main oscillator @ 12MHz as input. The setting of the PLL is LPC_SC->PLL0CFG = 0x10018; (N= 2 & M = 25). Fcco is 300 MHz and I set LPC_SC->CCLKCFG = 0x02; to get 100MHz as system clock.

  I2C clk is equal to system clock.

  Do you know where this frequency "error" can come from?

Regards,




dear guillaumeL, I am dealing with i2c at the moment and find it very hard to figure out some functions. Could you please offer some help as you are experienced in I2c? thanks very much
0 Kudos

596 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by NXP_USA on Wed Nov 21 14:07:29 MST 2012

Quote: guillaumeL
Hi,

  I'm developing an application using I2C interface of the LPC1769. All is working fine but it seems the I2C SCL frequency is not accurate. For example, when I want this frequency at 100kHz it is OK but if I set 400kHz the frequency is only 350 kHz.

  Do you know where this frequency "error" can come from?

Regards,



I2C doesn't operate at a fixed clock speed because the I2C master responds to something called "clock stretching" which happens when the clock is held low by a slave to request more time before the next clock. This can slow down communications. Also, having a high capacitance on the bus or having a pullup resistor that is too large a resistance can cause a similar effect by increasing the amount of time it takes for the clock to rise again.

-NXP
0 Kudos