K20 USB with external clock

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

K20 USB with external clock

Jump to solution
2,438 Views
Kari
Contributor III

Hi all,

Has anybody tried to use Kinetis as USB Device employing the usb_clkin (PTE26) pin and provide usb clock externally? Is it possible to maintain device enumeration when kinetis is in low power mode if you provide 48MHz clock to usb externally?

My problem is that the lowest current consumption that enables usb enumeration is about 33mA. (>150mW, from 5V supply!!)

This is achieved WAIT mode, 48MHz.

Thanks!

Kari

Labels (1)
Tags (2)
1 Solution
1,634 Views
Pepe
Contributor II

Kari,

For USB you need two valid conditions, the first one is 48Mhz clock to make the oversampling on the USB lines to get an accurate 12Mbps code/decode and you must have a minimum frequency on the system clock to make sure that the data incoming from the USB its being stored correctly on the system RAM using the integrated DMA, this frequency is 20Mhz so if you are in Low power mode and you want to use USB the best option is to use the VBUS pin to wake up the MCU and enable the clocks before you enable the USB module.. also you can take the current that you need from the VBUS line instead of your batteries or whatever you are using meanwhile you are connected to a HOST.

So, you can have the 48Mhz on the USB_CLKIN pin but you also need 20Mhz on your system clock

View solution in original post

5 Replies
1,634 Views
Kari
Contributor III

Hi Jose,

Thanks for the very precise answer. The device is actually only bus powered and continously used, but needs to be very low power, because there are multiple devices for one host. And the host is a portable, battey powered device.

We have actually tried as you suggested, but it does not work so far if the core frequency is less than 48 MHz. I dont have an explanation for that, since as you suggested it should work down to 20MHz at the core, right?

The K20 current consumption measured at 48MHz WAIT is 19mA and 48MHz run is 30mA. These are the two our lowest power states which allow USB enumeration all the time at the moment. 

Thanks,

Kari

0 Kudos
Reply
1,634 Views
Pepe
Contributor II

Hi Kari,

The USB enumeration should work if you have the core clock on 20MHz. I think you are changing the entire PLL frequency and remember that you need 48MHz on the USB clock to be able to operate it correctly. On the SIM (system integration module) there are one register where you can change the PLL freq divider that goes to the core, BUS, flash and flexBUS so you can modify the BUS, flash and core to operate slower and leave the PLL at 48MHz to operate the USB

check this figure:

CLK.png

so just modif the SIM_CLKDIV1 register and you will be running slower but USB will work.

hope this help

regards

/Jose

1,634 Views
Kari
Contributor III

Hi Jose,

It is now solved! Thanks very much for your help.

It was the RTOS clk setting procedure. The core clock needed to be set first to 24MHz (It is now from the FLL) and the USB clock 48MHz after that (PLL).

Regards,

Kari

0 Kudos
Reply
1,634 Views
Kari
Contributor III

Now, I finally was able to find this information from the datasheet. It is said in 5.2.1 Device clock specifications.

System and core clock when Full Speed USB in operation. MIN 20 MHz.

Regards,

Kari


1,635 Views
Pepe
Contributor II

Kari,

For USB you need two valid conditions, the first one is 48Mhz clock to make the oversampling on the USB lines to get an accurate 12Mbps code/decode and you must have a minimum frequency on the system clock to make sure that the data incoming from the USB its being stored correctly on the system RAM using the integrated DMA, this frequency is 20Mhz so if you are in Low power mode and you want to use USB the best option is to use the VBUS pin to wake up the MCU and enable the clocks before you enable the USB module.. also you can take the current that you need from the VBUS line instead of your batteries or whatever you are using meanwhile you are connected to a HOST.

So, you can have the 48Mhz on the USB_CLKIN pin but you also need 20Mhz on your system clock