Problem Using External Oscillator in High-Gain Mode?

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

Problem Using External Oscillator in High-Gain Mode?

1,557 Views
mwutley
Contributor II

   I'm using the MK20 series uC and trying to get it to run in high-gain mode. This mode was chosen based on the K20 sub-family reference manual (for my given hardware config and frequency). The load capacitance was carefully calculated, but since things are not working, I've tried a broad range of capacitance as a sanity check...still no success.

   When I try running in high-gain mode, the code continually gets stuck in the bss_init() function, which is part of the ResetISR. However, one important thing to note is that this happens after I've already entered main so before entering main I can successfully make it through bss_init().

   By putting in breakpoints, I've found that this is happening at some point during the BOARD_BootClockRUN() code, but I haven't been able to figure out exactly why or where. When the CLOCK_InitOsc0() function runs, the code successfully makes it through the while loop that is waiting for a stable oscillator, so it looks like I'm good there.

Everything runs fine in low-power mode, but I'd like to understand the issue and get it fixed. Any help is greatly appreciated!

Thanks,

Matt

Labels (1)
0 Kudos
7 Replies

1,248 Views
terence_kong
Contributor II

I have a question.  If we did not add the 1M resistor in high gain mode, but it works.  Does that mean it will not fail over time?

0 Kudos

1,248 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi terence K,

   If it is the demo, you can don't add it.

   But it is the product, I still recommend you add the 1M feedback resistor.

  BTW, if you have any questions, you can create your question post!


Have a great day,
Kerry

 

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

0 Kudos

1,248 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Matthew,

    Please also tell how your MK20 full name, as MK20 have a lot of chips.

     If you want to use the high gain mode, you must use connection 2 or connection3.

pastedImage_1.png

pastedImage_2.png

Do you add 1M Rf? This is very important.


Have a great day,
Kerry

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

0 Kudos

1,248 Views
mwutley
Contributor II

Hi Kerry,

Thanks for responding. Yes, I am using Connection 2 as well as 1M Rf. The part number is MK20DN512VLK10.

Best Regards,

Matt

0 Kudos

1,248 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Matthew,

   Run your code, at the same time, use the oscilloscope check your XTAL and EXTAL pin, whether you can find the oscillating wave or note? If you can't find the oscillating wave, it means your hardware still have problems, your hardware can't oscillate, you can change the external loader capacitor, actually, you need to check the external crystal datasheet, that datasheet will give you the recommended loader capacitor.

Wish it helps you!

If you still have question about it, please kindly let me know!


Have a great day,
Kerry

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

0 Kudos

1,248 Views
mwutley
Contributor II

Hi Kerry,

I ended up finding 2 issues related to this and now I'm up and running.

1.) I have 2 prototype boards. One had the 1M resistor removed and the other did not. I was debugging on the one that did not. I should have caught that sooner.

2.) For some reason if I enable OSCERCLK in high-gain mode the code will not run. This was enabled even though I'm not using it yet. It causes no issues in low-power mode. I'm not yet sure if I will need OSCERCLK down the road, so this may still need addressed.

Thanks,

Matt

0 Kudos

1,248 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Matt,

   Do you mean when you enable OSC_CR[ERCLKEN], the core clock is stopped?

  Do you test the clkout, and the external crystal pin wave with oscilloscope?

  When the clock is not run, whether the crystal pin have wave or not?


Have a great day,
Kerry

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

0 Kudos