Inquiry Regarding I2C Example Code and Register Information for S32K312 MCU

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

Inquiry Regarding I2C Example Code and Register Information for S32K312 MCU

1,546 Views
joe9999
Contributor II

Dear NXP Support Team,

We're encountering an issue for the S32K312 MCU and would appreciate your assistance.

Our environment:

  • Compiler: S32DS3.5
  • MCU: S32K312
  • SDK: RTD4.0.0

The problem: When implementing an I2C example program, we consistently observe that both the transmitted Address and Data are read as 0x00, contrary to our settings (Address: 0x32, Data: 0x00 to 0x07). We're unsure whether the I2C function is properly transferring the Address and Data we've configured into the appropriate registers, leading to incorrect output.

Could you please provide:

  1. An I2C example program compatible with the S32K312 MCU in our environment(RTD4.0).
  2. Documentation or datasheet detailing the register locations relevant to I2C functionality for the S32K312 MCU.

We have enclosed our main.c file, elf file, pin configuration, driver settings, and the results from the logic analyzer.

Your prompt assistance in resolving this matter would be greatly appreciated. Thank you for your attention to this request. Please let us know if further information is needed.

Best regards,

Joe H

 

Tags (3)
0 Kudos
Reply
5 Replies

1,513 Views
VaneB
NXP TechSupport
NXP TechSupport

Hi @joe9999 

Could you please provide:

1- An I2C example program compatible with the S32K312 MCU in our environment(RTD4.0). As you know, S32K3 has many derivatives, so to reduce effort, in the most recent RTD releases we only provide examples for K344, K358, and K396. Examples of other derivatives can be created based on these existing examples. Also, examples for S32K312 are provided in RTD version 2.0.3.

2- Documentation or datasheet detailing the register locations relevant to I2C functionality for the S32K312 MCU. Refer to Chapter 71 (Low Power Inter-Integrated Circuit (LPI2C)) of the S32K3xx MCU Family - Reference Manual.

 

B.R.

VaneB

0 Kudos
Reply

1,484 Views
joe9999
Contributor II

Dear NXP Support Team,

Thank you for your response and guidance.

Regarding your two requests:

  1. I2C Example Program: We have been using the I2C example program for the S32K312 LPI2C under S32DS3.4 with RTD version 3, and it successfully transmitted data. However, after porting to S32DS3.5 with RTD version 4, we encountered the issue I previously described. Therefore, we require an I2C example program compatible with the S32K312 MCU and operable within the RTD 4.0 environment. I understand that currently, examples are only provided for derivatives K344, K358, and K396, while examples for S32K312 are available in RTD version 2.0.3. Is there any alternative or modification based on existing examples to address this issue?

  2. Documentation for I2C Registers: Thank you for pointing out that information regarding the I2C functionality of the S32K312 MCU can be found in Chapter 71 (Low Power Inter-Integrated Circuit (LPI2C)) of the S32K3xx MCU Family - Reference Manual. We will carefully review this chapter to determine the correct register locations and their functional descriptions.

Additionally, do you recommend any further checks or tests for us to conduct to pinpoint the root cause of the issue and resolve it?

Thank you in advance for your continued assistance.

Best regards,

Joe H

0 Kudos
Reply

1,415 Views
VaneB
NXP TechSupport
NXP TechSupport

Hi @joe9999 

Sorry for the inconvenience. As said before, we only have available example codes for examples for K344, K358, and K396. 

Additionally, we observe that you configure both of your pins as pull-down. Could you explain the reason for this? Also, if you configure it as a pull-up, did you see any change in the signal behavior? 

1,376 Views
joe9999
Contributor II

Hi VaneB,

Thank you for your response.

Previously, we only tested whether the transmitter could correctly pass messages, so We only set the transmitter pin to pull-up. We also attempted setting all pins to pull-up, but the result remained 0x00 (as shown in Figure 1).

Figure 2 demonstrates the successful transmission we achieved using S32DS3.4 with RTD version 3.

I'm attaching both successful (S32DS34+rtd3) and unsuccessful (S32DS35+rtd4) projects.

 

Figure 1: S32DS3.5 with RTD version 4 (fail)

1.png

Figure 2: S32DS3.4 with RTD version 3 (success)

2.png

Thank you for your assistance.

Best Regards,

Joe H

0 Kudos
Reply

1,273 Views
VaneB
NXP TechSupport
NXP TechSupport

Hi @joe9999 

I have reviewed your code. I saw that you have different clock configurations in both projects. Please check this part. Also, we recommend using RTD version 3.0.0 P07 because version 4.0.0 is still under testing. 

0 Kudos
Reply