I2C Scanner using S32K146EVB-Q144

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

I2C Scanner using S32K146EVB-Q144

639 Views
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 Kudos
Reply
4 Replies

595 Views
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 Kudos
Reply

592 Views
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 Kudos
Reply

544 Views
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 Kudos
Reply

606 Views
Nibesh
Contributor III

Hello
@VaneB  @Senlent 

Will you check my this thread for I2C Scanner ??

I hope to hear from you soon!

0 Kudos
Reply