How to configure clock on MK22FN128 for USB device operation?

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

How to configure clock on MK22FN128 for USB device operation?

Jump to solution
1,942 Views
alexfeinman
Contributor III

There doesn't seem to be a combination of clock settings that would produce 48MHz. Best I could get is 47.97 (which should be good enough for device although not for host). However when I set this up in PE window (I am using KDS studio PE project), when generating PE code I get an error message:

Generator failure. Unexpected status of script Doxygen\Common\DoxyGenComponentProg.prg. Please contact Freescale support.

Not sure if the error message has to do with the warning about the USB clock not being exactly 48 MHz though

On MK22F512 there are two extra choices fro MCG settings that are not on MK22F128. I wonder if there are some limitations with MK22F128FN with regard to USB that do not exist for MK22F512

0 Kudos
Reply
1 Solution
1,437 Views
mjbcswitzerland
Specialist V

Kan

The K22FN128 doesn't have a PLL (only FLL) and so I suppose the tool is right in not allowing it to be set up.

As noted, the FLL has high jitter and will not allow passing USB certification.

Regards

Mark

http://www.utasker.com/kinetis.html

View solution in original post

0 Kudos
Reply
8 Replies
1,437 Views
mjbcswitzerland
Specialist V

Alex

What is the frequency of the crystal that you are using?

Regards

Mark

0 Kudos
Reply
1,437 Views
alexfeinman
Contributor III

External crystal (XTAL/EXTAL) is 24 MHz. There is also 32KHz oscillator on XTAL32 pin. The specific part number I am using is MK22FN128VMP10

0 Kudos
Reply
1,437 Views
Kan_Li
NXP TechSupport
NXP TechSupport

Hi Alex,

I agree Mark, you might use the FLL instead to generate the USB ref clock, and I also made a KDS project according to your requirement, and looks like no problem during the compiling, please kindly refer to the following for details.

usb1.png

usb.png

Please kindly refer to the attached KDS project for more details.

Hope that helps,


Have a great day,
Kan

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

0 Kudos
Reply
1,437 Views
Kan_Li
NXP TechSupport
NXP TechSupport

Hi Alex,

I am sorry, seems I used the wrong device, and when I tried to use the device of MK22FN128VMP10, I found  the MCG can not be set in PEE mode, I am thinking it might be a KDS issue, alejandrolozano, would you please look into this issue? Thanks in advance!

usb.png


Have a great day,
Kan

0 Kudos
Reply
1,437 Views
alexfeinman
Contributor III

Kan,

It appears on the low-end devices such as MKF22128VMP10 I am using the only reasonable option for USB operation is the internal 48MHz clock (IRC48). It can be selected as the USB clock source in Advanced mode. This works for higher-end SKUs as well. I was able to get the system configured and partially work, although I ran into another problem that I will post about separately.

0 Kudos
Reply
1,437 Views
adriancano
NXP Employee
NXP Employee

Hi Alex,

You will find useful this Application Note AN4905


Hope this information can help you.

Best Regards,
Adrian Sanchez Cano
Technical Support Engineer
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

1,438 Views
mjbcswitzerland
Specialist V

Kan

The K22FN128 doesn't have a PLL (only FLL) and so I suppose the tool is right in not allowing it to be set up.

As noted, the FLL has high jitter and will not allow passing USB certification.

Regards

Mark

http://www.utasker.com/kinetis.html

0 Kudos
Reply
1,437 Views
mjbcswitzerland
Specialist V

Alex

For USB device mode the IRC48MHz clock can be used with its crystal-less operation.

I suppose the 49.97Mhz is derived from the FLL 1464 multiplication from the 32.768kHz crystal. It is not only inaccurate but the FLL doesn't meet the specifications for USB certification and so the only way for host operation on the K22FN128 is to supply a 48MHz oscillator for its USB_CLKIN.

The other K22 parts have also a PLL (MCGPLLCLK) which is suitable for USB host certification but the K22FN128 tends to be "optimised" for lower-cost device-only use.

Regards

Mark

0 Kudos
Reply