S32K116>PTC5 as GPIO

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 
3,145件の閲覧回数
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,050件の閲覧回数
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,050件の閲覧回数
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,050件の閲覧回数
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,051件の閲覧回数
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,050件の閲覧回数
vishal_roy
Contributor II

Thanks Robin!! Was solved.

0 件の賞賛