Normal GPIO simulates I2C as slave communication

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

Normal GPIO simulates I2C as slave communication

530 Views
Hrohn
Contributor II

I used the PB9 and PB10 of the S32K146 as SCL and SDA to simulate the I2C. It involves the SDA pin needing to switch between the input edge interrupt mode and the output mode. What API functions are needed? What should I pay attention to when switching?

0 Kudos
Reply
1 Reply

505 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi,

pin interrupt and function is selected using PORT.PCRn register. The pin direction is then set by GPIO PDDR register. See more in chapters 12 Port Control and Interrupts (PORT) and 13
General-Purpose Input/Output (GPIO) of teh device Reference Manual.
Anyway I2C pins should be bidirectional with open-drain output, which is not possible to set on normal GPIO pins of this MCU.

BR, Petr

0 Kudos
Reply