Controlling USB speed using internal pull-ups (M5222X, M5221X)

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

Controlling USB speed using internal pull-ups (M5222X, M5221X)

2,927 Views
mjbcswitzerland
Specialist V
Hi All USB Gurus

When working with the internal USB transceiver and its pull-up / pull-downs I was thinking that it should be possible to control how the (PC-)Host detects the USB function as follows:

Test 1: (Full-speed connection)
- Pull D+ high in OTG_CTRL by setting (DP_HIGH | OTG_EN) to signal a full speed function.
The D+ line us pulled high and the host detects this as a full-speed function connect.

Test 2: (Low-speed connection)
- here I didn't find any possibility to control this.

Therefore I am wondering whether there is no advantage of being able to connect as a low-speed device?
Any ideas?


A further question I have is about the electrical connection. I am using the M52223EVB and have found that  not all hosts are communicating correctly with it. I believe that the SW is generally correctly enumerating when connected so I am thinking that it must be something to do with the electrical part.
There are my experiences:
1. PC 1 (Vista) always enumerates on 2 USB ports. I can connect and disconnect many times and each time it sees the connected device (in this case as a virtual COM port).
2. When I connect to a second PC (WinXP) the PC host doesn't recognise the device. I see that the D- line never goes above about 1V and it gives up after several seconds without any attempts to exchange data.
3. I do the same test as 2 with a USB analyser connected between to the board and the PC. Now it works 90% of the time. (I seem to have to sometimes power down the board to get it to work correctly after it has failed).
4. I do the same test as 2 but connecting to a USB2.0 4-port hub instead of directly to the PC. Now it always works correctly (100%).

This suggests to me that the transceiver setup (pull-up/down control?) may not be perfect since it is on the limit somewhere.

Has someone similar experiences or can a Guru say what I should improve?


Regards

Mark



Message Edited by mjbcswitzerland on 2008-06-17 01:34 AM
Labels (1)
0 Kudos
Reply
6 Replies

1,171 Views
RichTestardi
Senior Contributor II
Hi Mark,
 
I assume you've removed all of the manual pull-up/down jumpers on your board?  I use the M52221DEMO board and there are two jumpers (DPPD and DMPD) I have to make sure are removed and one (DPPU) I have to make sure is not installed at all.
 
Also, there are multiple registers you can use for pull up/down control.  I only use one line (for device mode):
 
    // enable usb pull ups
    MCF_USB_OTG_OTG_CTRL =
        MCF_USB_OTG_OTG_CTRL_DP_HIGH|MCF_USB_OTG_OTG_CTRL_OTG_EN;
 
I never got the USB to run Low Speed, in device mode, either, though I was able to talk to Low Speed devices when running in host mode.
 
One more question...  Are you clocking from a crystal or from the internal relaxation oscillator PLL'd up to 48MHz?  I've found on boards that I don't clean well (?), the relaxation oscillator runs too fast or slow for USB to work on some PCs...  (The USB Full Speed Spec really demands you use a crystal at 2500 ppm, but I've found the relaxation oscillator is usually fine at 20,000 ppm.)
 
-- Rich
 
0 Kudos
Reply

1,171 Views
mjbcswitzerland
Specialist V
Hi Rich

I am using the clock source from the 48MHz crystal:
USB_CTRL = USB_OSCILLATOR_CLOCK; // (0x01)

The M52223 doesn't have any configuration jumpers - it has a MAX3353 which can be used to also control such settings but I have intentionally not initialised this in these tests.

I will repeat the tests with M52221DEMO, M52210DEMO and M52211EVB to see whether there are any differences...

Regards

Mark



0 Kudos
Reply

1,171 Views
mjbcswitzerland
Specialist V
Hi Rich

I have some more info:

My M52221DEMO and M52210DEMO boards, running the same code (configured accordingly to suit chip types) don't have any connections problems. The problem with one PC only enumerating through a USB 2.0 hub is therefore restricted to my M52223EVB. Therefore I am going to ignore this for the moment since it is likely to be board releated. [Note all board running from FLASH]

I didn't check on an M52211EVB since I didn't have one handy today - if I don't add another update assume it  was also OK...

Regards

Mark

0 Kudos
Reply

1,171 Views
RichTestardi
Senior Contributor II
Hi Mark,
 
Interesting!
 
I noticed there were 15k ohm pull-somewhere resistors tying the USB D+ and D- to QSPI_CS3 and QSPI_CS2 (with alternate pin functions USB_DP_PDWN and USB_DM_PDWN!), respectively...  Are you possibly driving those as outputs?  15k ohm *should* be in the noise compared to a device pull-up, but it never hurts to check...  Otherwise, it *seems* the MAX3353 should stay out of the way until you program its registers to non-0 values...
 
-- Rich
 
0 Kudos
Reply

1,171 Views
mjbcswitzerland
Specialist V
Hi Rich

These are inputs - I double checked with a scope to be absolutely sure.
That leaves the MAX3353 as possible source.... I was originally using this to control pullups but think that I had the same issue then. I will take another look at it though.

Regards

Mark

0 Kudos
Reply

1,171 Views
mjbcswitzerland
Specialist V
Hi Rich

My results with an M52211EVB are equivalent to the M52223EVB.
This means that both EVBs do have a problem with one PC but the DEMO boards do not.
This suggests that the MAX chip is causing a difference.

Once I get the chance I will try different MAX chip configurations and possibly removing it.

Regards

Mark

0 Kudos
Reply