Normal GPIO simulates I2C as slave communication

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

Normal GPIO simulates I2C as slave communication

344件の閲覧回数
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 件の賞賛
1 返信

319件の閲覧回数
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 件の賞賛