S32K116>PTC5 as GPIO

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

S32K116>PTC5 as GPIO

Jump to solution
2,966 Views
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 Kudos
1 Solution
2,871 Views
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!
-----------------------------------------------------------------------------------------------------------------------

View solution in original post

0 Kudos
4 Replies
2,871 Views
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 Kudos
2,871 Views
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 Kudos
2,872 Views
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 Kudos
2,871 Views
vishal_roy
Contributor II

Thanks Robin!! Was solved.

0 Kudos