MCF52221 USB "unknown device"

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

MCF52221 USB "unknown device"

992 Views
phoenix_fire
Contributor I

Hi,

I have a difficulty making USB work properly. I want to use device mode. I'm using the USB Stack with PHDC in version 3.1 and Codewarrior 7.2. I can't even run the examples like HID device which should work without any additional system drivers. The problem is that every example works the same - some USB device is detected on the bus but then system installs it as "Unknown device" (I've tried both on Windows XP and 7 with similar result).

 

I have some topics I'd like to discuss:

 

I'm using MCF52221 in 100 pin version, I can say that it's working because "hello world" program works (led is blinking). I've attached DP and DM and there are 33 ohm resistors. But 100 pin version has also external USB_DP_PDOWN, USB_DM_PDOWN, USB_PULLUP. Firstly, is it possible that it doesn't work because I didn't connect them to DP/DM lines? (my logic - pull down lines are to be used with OTG so I don't need it, USB_PULLUP seems unnecessary as CF internally pulls up lines, also I've tried pulling up DP line with 1.5k ohm resistor and it didn't solve my problem).

Secondly, as for USB_DP_PDOWN, USB_DM_PDOWN datasheet says "If these pins are not configured for USB signals, each pin should be pulled down externally using a 10 kΩ resistor.". I left them floating. Is it possible that it is making USB unworkable ? (demo board has 66 -pin version of CF where those pins aren't present, and my board is really a minimal copy of demo board).

My board has external 48 MHz crystal exactly like demo board. The CLK_SRC is set to 01 (Oscillator clock) but I've also tried to set it to 11 (System clock source) and multiplying internal clock (x6) so it would generate 48MHz system clock (also the same effect). I have this hunch that it's clock problem but that may only distract me so I don't see real problem.

 

Please, any suggestion will be useful because I don't really have any ideas. Stupid and obvious ideas are welcomed as I consider myself as a beginner and I might have make stupid mistake. 

Labels (1)
0 Kudos
Reply
3 Replies

611 Views
phoenix_fire
Contributor I

I'm gonna answer myself because I've just solved the problem. For all not-pros like myself: oscillators have more than just one parameter. So there is frequency that I was familiar with but didn't know that crystal may work on other that fundamental resonance which is quite common with high frequency crystals. Since I've used 48 MHz my operated at  third overtone. Crystal for MCF52221 (probably for other Freescales in this family) must work on fundamental resonance . Otherwise like in my case I've got only 16 MHz. This was earlier commented on this forum I've just didn't know what to look for. I've just used 24Mhz divided it by 3 to get recommended 8Mhz for PLL then multiplied it by 6 to get USB mandatory 48 MHz. Good luck with Your designes!

0 Kudos
Reply

611 Views
JCRib
Contributor II

Hello,

 

Can you tell me if 48MHz is needed for host (USB mass storage) or only in device mode?

About your problem, do you know why it didn't work with a 48MHz crystal (divided by 6 to get 8MHz and then multiplied by 6) ? 

 

 

Best regards

 

Jose

0 Kudos
Reply

611 Views
TomE
Specialist II

Some Coldfire chips do require a 48MHz fundamental mode crystal to run USB. Why? "Because the data sheet says so" is the simplest answer.

 

Are you sure you're not using a different chip? The MCF52221/52223 Data Sheet specifies a maximum crystal frequency of 25MHz, but a maximum "external clock mode" signal of 66.66MHz or 80MHz.

 

As for the USB clocking, refer to AN3577 where it says "MCF5222x/5221x USB module works on 48 MHz frequency. The 48 MHz clock can be provided by MCU clock module or feeded [sic] in from USB_ALT_CLK pin. For more information, please refer to M52223EVB from www.freescale.com.".

 

As always, the chip Evaluation Board is usually the best reference for this sort of thing. Do what it does if it does what you want.

 

Interestingly, "Table B-1. MCF52223RM Rev. 4 changes" in the reference manual docusays the manual used to say "One to 48 MHz crystal, 8 MHz on-chip relaxation oscillator, or external oscillator reference options.:, but that was changed to not state "48MHz" and there's a note stating "For crystal frequency range refer the device datasheet".

 

Tom

 

0 Kudos
Reply