K10 HOW configure PTA19(XTAL0) AS GPIO

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

K10 HOW configure PTA19(XTAL0) AS GPIO

727 Views
chengdong
Contributor I

hi,all

      The MCU is MK10DX128VFM5, when I use the external clock and configure  PORTA->PCR[19]= PORT_PCR_MUX(1), this GPIO alternate function is configured GPIO(0x01),but this pin is still output clock signal。it can't output 1 or 0.

     when I use the internal clock, this pin can use as a GPIO.

     so I would know how to configure  PTA19 as a GPIO.

    微信图片_20190609233856.png

0 Kudos
5 Replies

643 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi cheng dong,

  Do you debug the code, and check the PORTA_PCR19?

  Whether the MUX is really modified to 1 or not?


Have a great day,
Kerry

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

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos

643 Views
chengdong
Contributor I

Hi Kerry,

I confirm  MUX is really modified to 1.

I putout the value of this register(PORTA_PCR19),the value is 0x0100.

I can also configure PE and PS to 1, but this pin still can't work normally. 

0 Kudos

643 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi cheng dong,

  After you configure the PTA19 as GPIO pin, do you configure the GPIOA_PDDR |= 1<<19;? Just configure the PTA19 as output pin, then control the PDOR register to output the according data.

  If you don't set the direction register, after you configure the PTA19 as GPIO function, it will be the input pin.


Have a great day,
Kerry

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

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos

643 Views
chengdong
Contributor I

Hi  kerry,

I think PTA19 is configured correctly,i has checked the correlative register.

now this pin output a 16M clock signal same as the external clock. when i switch to internal clock, this pin can work normally, so i think the problem is OSC and MCG.

thank you

cheng dong

0 Kudos

643 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi cheng dong,

   OK, if you are using the external clock, when you debug your code, you will find this problem, the debugger will stop at the point which you swith the clock mode from FEI to FEE or PEE.

  Your problem is in the external clock configuration.


Have a great day,
Kerry

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

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos