I2C master not working

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

I2C master not working

260件の閲覧回数
francescovico
Contributor III

Hello ,

I'm trying to test I2C master on S32K324 but i'ts not working.

Actually I have no I2C slave connected to I2C master but I don't see any transition on PTD13 (LPI2C_SDA) or PTD14 (LPI2C_SCL), the two pins are ever HIGH.

I expect to see start condition like attached file.

Attached there is the project.

Regards, Francesco.

タグ(1)
0 件の賞賛
返信
5 返答(返信)

185件の閲覧回数
danielmartynek
NXP TechSupport
NXP TechSupport

Hello Francesco,

I haven't tested the code, but I see that you did not enable the LPI2C interrupt.

Add IntCtrl_Ip driver with LPI2C0_Master_Slave_IRQHandler.

And initialize the driver in the code.

 

Regards,

Daniel

 

0 件の賞賛
返信

182件の閲覧回数
francescovico
Contributor III

Hello Daniel,

Thank you, it's true I forgot to initialize interrupt.

Also with interrupt enabled the I2C it's not working.

Attached there is the project with interrupt enabled.

Do you have other suggestions?

Regards.

 

0 件の賞賛
返信

160件の閲覧回数
danielmartynek
NXP TechSupport
NXP TechSupport

Hi @francescovico,

When CM7_1 is halted, the MCU enters debug mode.
To ensure LPI2C continues functioning, either set the DBGEN bit in LPI2C_MCR to allow operation during debugging, or Keep CM7_1 running.

 

BR, Daniel

0 件の賞賛
返信

124件の閲覧回数
francescovico
Contributor III

Hello Daniel,

sorry but putting:

IP_LPI2C_0->MCR |= LPI2C_MCR_DBGEN_MASK;

The I2C still not working.

Attached my project.

Regards, Francesco.

0 件の賞賛
返信

86件の閲覧回数
danielmartynek
NXP TechSupport
NXP TechSupport

HI @francescovico,

danielmartynek_0-1756971786422.png

Enable it after the Init function.

Otherwise, the Init function will clear the bit.

 

Regards,

Daniel

Any support, information, and technology (“Materials”) provided by NXP are provided AS IS, without any warranty express or implied, and NXP disclaims all direct and indirect liability and damages in connection with the Material to the maximum extent permitted by the applicable law. NXP accepts no liability for any assistance with applications or product design. Materials may only be used in connection with NXP products. Any feedback provided to NXP regarding the Materials may be used by NXP without restriction.
0 件の賞賛
返信