S32K116>PTC5 as GPIO

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

S32K116>PTC5 as GPIO

跳至解决方案
3,112 次查看
vishal_roy
Contributor II

PTC5 has a dual role of GPIO + JTAG. By default it is a JTAG pin I would like to know the procedure /registers to configure to set it up as a GPIO.

#GPIO #s32k116

0 项奖励
1 解答
3,017 次查看
Robin_Shen
NXP TechSupport
NXP TechSupport

Hi Vishal Roy,

 

The default value of PTC5 MUX = 111 Alternative 7 (JTAG_TDI).

PTC5 SSS.png
PORTC->PCR[5] |= PORT_PCR_MUX(1) will not set MUX=001, it will be still 111 due to the default value.
Please refer the method in Processor Expert.

PINS_DRV_Init.png

Best Regards,

Robin

 

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

在原帖中查看解决方案

0 项奖励
4 回复数
3,017 次查看
Robin_Shen
NXP TechSupport
NXP TechSupport

Hi Vishal Roy,

The default pad configurations out of reset are as follows. You need to reconfigure it according to your needs.

4.4 Default pad state.png
PORTC_PCR5[MUX] should reconfigure to 001: Alternative 1 (GPIO)

4.5 Signal Multiplexing sheet.png

12.5.1 Pin Control Register n (PORT_PCRn).png

You can also use the Processor Expert to configure it.

configure GPIO Processor Expert.png

Best Regards,

Robin

 

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 项奖励
3,017 次查看
vishal_roy
Contributor II

I have set as below

PORTC->PCR[5] |= PORT_PCR_MUX(1) /* Port C5: MUX = GPIO */

PTC->PDDR |= 1u <<5u;     // Port C5: Data Direction= output    1b - Pin is configured as general-purpose output, for the GPIO function.
PTC->PCOR |= 1u <<5u; //Port Clear Output Register (PCOR)  1b - Corresponding bit in PDORn is cleared to logic 0.

But with no toggle on GPIO line

Do i have to set the Lock Bit as well to  "0"

Do let me know if I  am missing any other configuration as this line is MuX with JTAG line and by default is a JTAG pin

0 项奖励
3,018 次查看
Robin_Shen
NXP TechSupport
NXP TechSupport

Hi Vishal Roy,

 

The default value of PTC5 MUX = 111 Alternative 7 (JTAG_TDI).

PTC5 SSS.png
PORTC->PCR[5] |= PORT_PCR_MUX(1) will not set MUX=001, it will be still 111 due to the default value.
Please refer the method in Processor Expert.

PINS_DRV_Init.png

Best Regards,

Robin

 

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 项奖励
3,017 次查看
vishal_roy
Contributor II

Thanks Robin!! Was solved.

0 项奖励