I2C Scanner using S32K146EVB-Q144

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

I2C Scanner using S32K146EVB-Q144

1,818 次查看
Nibesh
Contributor III

Hello I am developing I2C Scanner using S32K146EVB Board using S32 Design Studio.
I have develop the code using LPI2C0 and LPUART2, I am getting some problem on my code.
I have attached my code for your kind reference.

0 项奖励
回复
4 回复数

1,774 次查看
Robin_Shen
NXP TechSupport
NXP TechSupport

Hi

Seems that you configure I2C ignore NACK in LPI2C_init: LPI2C Master will treat a received NACK as if it (NACK) was an ACK

void LPI2C_init(void)
{
    PCC->PCCn[PCC_LPI2C0_INDEX] |= PCC_PCCn_PCS(2)        /* Clk src: SIRCDIV2_CLK */
                              | PCC_PCCn_CGC_MASK;    /* Enable clock for LPI2C0 */
 
 
    LPI2C0->MCFGR1 = LPI2C_MCFGR1_PRESCALE(2) /* Prescale = 4*/
|LPI2C_MCFGR1_IGNACK_MASK; /* Ignore NACK*/
 
Please modify the settings and then check the ACK.

Best Regards,
Robin
0 项奖励
回复

1,771 次查看
Nibesh
Contributor III

Hello @Robin_Shen 

Will you modify my code, as I am unable to do it.

I hope to hear you soon.

Thank You

0 项奖励
回复

1,723 次查看
Robin_Shen
NXP TechSupport
NXP TechSupport

Sorry, have you modified the IGNACK settings and tested? Will the NDF(NACK Detect Flag) be set now?

Table 52-10. Master Interrupts and DMA Requests NDF.png

Since there are many cases to be handled recently, I have not had time to modify and test your project.

0 项奖励
回复

1,785 次查看
Nibesh
Contributor III

Hello
@VaneB  @Senlent 

Will you check my this thread for I2C Scanner ??

I hope to hear from you soon!

0 项奖励
回复