I2C_MSR register not updating properly in s32k322

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

I2C_MSR register not updating properly in s32k322

626件の閲覧回数
vignesh3
Contributor II

I2C->MTDR = 0x1 << 8;// | (ack ? 0 : 1);
while (!(I2C->MSR & (1 << 1)));
// Wait until data is received
byt = (uint8_t)(I2C->MRDR & 0xff);

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

576件の閲覧回数
Robin_Shen
NXP TechSupport
NXP TechSupport

Hi

I sent you the bare-metal example lpi2c_test1 via private message.

By the way, we recommend using Real-Time Drivers (RTD) instead of bare-metal.


Best Regards,
Robin
-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "ACCEPT AS SOLUTION" button. Thank you!

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 件の賞賛
返信

623件の閲覧回数
vignesh3
Contributor II
sometimes that reception bit of msr register not setting so the code is struck in one place
this is my initialization.
I2C->MCR = 0;
I2C->SCR = 0;
I2C->MIER = 0;//disable all the interrupt
I2C->MDER = 0;//disable all DMA requests

I2C->MCFGR0 = 0;
I2C->MCFGR1 = 0x07;//select prescaler devided by 64
I2C->MCFGR1 |= (1 << 10);
//I2C->MCFGR1 |= (1 << 26);

I2C->MCFGR2 = 0;
I2C->MCFGR3 = 0;

// I2C->MCCR0 = (1 << 5);
// I2C->MCCR0 |= (1 << 13);
// I2C->MCCR0 |= (1 << 24);
I2C->MCCR0 = 3;
I2C->MCCR0 |= (1 << 8);
I2C->MCCR0 |= (2 << 24);

I2C->MCCR1 = 3;
I2C->MCCR1 |= (1 << 8);
I2C->MCCR1 |= (1 << 16);
I2C->MCCR1 |= (2 << 24);

I2C->MFCR = 0;

I2C->MCR |= (1 << 0)|(1 << 3);//enable lpi2c module
0 件の賞賛
返信