LPC54018 I2C timeout register issue

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

LPC54018 I2C timeout register issue

1,888件の閲覧回数
Renuga_AKAS
Contributor I

Hi,

    I have tried to timeout the i2c communication but failed to achieve through i2c interrupt method. First i enabled the SCLTIMEOUT and EVENTTIMEOUT bit in INTENSET register and configured the TIMEOUT register as 500, then i disconnected the clock PIN from the evk board. The EEPROM IC didn't acknowledge the slave address and it was held in a loop for long time. Can you suggest me how to achieve the timeout in i2c interrupt communication?

0 件の賞賛
返信
5 返答(返信)

1,867件の閲覧回数
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi,

Because there is pull-up resistor on both the SCL and SDA pin, if you disable SCL, the SCL pin will be high, and SDA is also high, this is idle mode, timeout mechanism does not take effect.

 For a test, during the I2C transferring process, you can connect the SCL to GND manually, then the timeout will take effect.

Hope it can help you

BR

XiangJun Rong

0 件の賞賛
返信

1,865件の閲覧回数
Renuga_AKAS
Contributor I
Hi,
    Thanks for the reply. Actually I already tried this option too by connecting the SCL PIN directly to GND still it doesn't work. And I have one more doubt if I set I2C->TIMEOUT = 5000, then set baudrate in standard mode (100kHz). While debugging I2C->TIMEOUT shown as 5007. Is any  other way to attain I2C timeout?
0 件の賞賛
返信

1,855件の閲覧回数
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi,

Pls try to post your code so that we can have a review.

BR

XiangJun Rong

0 件の賞賛
返信

1,851件の閲覧回数
Renuga_AKAS
Contributor I

Hi,

    First of all, I have initialized the I2C bus. Then send data through i2c interrupt concept. Hereby I have attached the code for your reference.

SYSCON->AHBCLKCTRLSET[1] = 1 << 12;

SYSCON->PRESETCTRLSET[1] = 1 << 12;

SYSCON

->PRESETCTRLCLR[1] = 1 << 12;

FLEXCOMM1->PSELID = 0x101073;

I2C1->CFG = 0x01;

I2C1->CLKDIV = 0x07;

I2C1->TIMEOUT = 5000;

I2C1->MSTTIME = 0x56;

I2C1->INTENCLR = (1 << 0) | (1 << 4) | (1 << 6) | (1 << 24) | (1 << 25);

    And the following i have used it while transmitting data through I2C interrupt.

I2C1->INTENCLR = (1 << 0) | (1 << 4) | (1 << 6) | (1 << 24) | (1 << 25);

I2C1->STAT = (1 << 4) | (1 << 6) | (1 << 24) | (1 << 25);

I2C1->INTENSET = (1 << 0) | (1 << 4) | (1 << 6) | (1 << 24) | (1 << 25);

I2C1->MSTDAT = I2C_Slave_addr | write_bit;

I2C1->MSTCTL = 0x02;

0 件の賞賛
返信

1,781件の閲覧回数
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi,

I have not seen the NVIC module configuration, pls try to use the instructions.

__NVIC_EnableIRQ(FLEXCOMM0_IRQ1);

__NVIC_SetPriority(FLEXCOMM0_IRQ1,0x00);

Hope it can help you

BR

XiangJun Rong

0 件の賞賛
返信