How do I set a pin of S32K344 to open drain output mode

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

How do I set a pin of S32K344 to open drain output mode

跳至解决方案
1,184 次查看
SCoder41
Contributor III

How do I set a pin of S32K344 to open drain output mode.We have designed the hardware to be in an open drain output triggered mode, with a 5V pull-up,Our hardware schematic is shown in the following figure

7.png

0 项奖励
回复
1 解答
1,147 次查看
PavelL
NXP Employee
NXP Employee

Hello @SCoder41 ,

important is RTD version. If you look to the link in the first reply, there is function 

void Siul2_Port_Ip_SetPinDirection(Siul2_Port_Ip_PortType * const base, uint16 pin, Siul2_Port_Ip_PortDirectionType direction);

which can help you.

Best regards,

Pavel

在原帖中查看解决方案

0 项奖励
回复
6 回复数
1,171 次查看
PavelL
NXP Employee
NXP Employee

Hello @SCoder41 ,

there's no "true" open drain support on S32K344 (GPIO open drain? - NXP Community). But your application doesn't look like time critical (many MHz), so you can manage open drain mode easily by switching GPIO between "HighZ" mode and "ouput low" mode.

Best regards,

Pavel

0 项奖励
回复
1,154 次查看
SCoder41
Contributor III
S32DS3.5
0 项奖励
回复
1,158 次查看
SCoder41
Contributor III
How to set GPIO to "HighZ" mode
0 项奖励
回复
1,148 次查看
PavelL
NXP Employee
NXP Employee

Hello @SCoder41 ,

important is RTD version. If you look to the link in the first reply, there is function 

void Siul2_Port_Ip_SetPinDirection(Siul2_Port_Ip_PortType * const base, uint16 pin, Siul2_Port_Ip_PortDirectionType direction);

which can help you.

Best regards,

Pavel

0 项奖励
回复
1,079 次查看
SCoder41
Contributor III
Which address should the first parameter of the function 'Siu l2 Port Ip_SetPinDirection' point to?
0 项奖励
回复
1,072 次查看
PavelL
NXP Employee
NXP Employee

Hello @SCoder41 ,

here's example for PTG29:

#include "Siul2_Port_Ip.h"

Siul2_Port_Ip_SetPinDirection(PORTG_H_HALF, 29-16, SIUL2_PORT_HI_Z);

16 shall be subtracted for the upper half port numbers.

Best regards,

Pavel

0 项奖励
回复