This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CCS/MSP430F5632: MSP430 running the USB example C0_SimpleSend project is not detected in device manager

Part Number: MSP430F5632
Other Parts Discussed in Thread: MSP430F5529

Tool/software: Code Composer Studio

Hi All,

I am running the C0_SimpleSend USB stack example on a custom PCB which has a MSP430F5632. I am aware that the example is made for MSP430F5529. However as explained in the Examples Guide in the USB Developers Package, I have right clicked the project, gone to properties, and selected the MSP430 variant to be MSP430F5632. I am able to flash my MSP through JTAG via my FET. Upon running the project, I open device manager, and checked the sections for both Universal Serial Bus Controllers and Ports(COM & LPT). There appears to be nothing that appear or disappear as I plug in or out, the USB of my PCB.

Something to note is, that I have a 20MHz crystal for XT2 on the board. First time I ran with the default settings on the example project that was set to 4 MHz which is suited to the LaunchPad's onboard crystal. It did not work, which was sensible. Later I went in to descriptors.h under USB_config and edited USB_XT_FREQ_VALUE 4.0 and USB_XT_FREQ USBPLL_SETCLK_4_0 as follows.

#define USB_XT_FREQ_VALUE       20
#define USB_XT_FREQ             20 

The closest definition to 20MHz for USB_XT_FREQ is USBPLL_SETCLK_19_2, which is 19.2 MHz, hence why I defined as above. Are my 2 definitions valid? The rest of the code remains unchanged.

The process to get this example running is not meant to be complicated as I read in the examples guide. I also tried a different CDC example. Swapped D+ D- and tried, and swapped back to original. Haven't had any luck. So I must be missing something. I am very new to the USB interface. Could someone advise me how I could get the device to appear in device manager please?

Kind regards,
Guyan

  • The USB module requires a clock of 48 MHz with a tolerance of at most 2500 ppm. Using the 19.2 MHz dividers with a 20 MHz crystal would result in a deviation of 52632 ppm.

    There is no divider value that would work with 20 MHz. You cannot use this crystal.
  • Thank you Clemens. That's a precise answer. I have told the people designing the PCBs to get the next batch with a 24MHz XT2. As I can see in the family user guide, It has suitable UPQB and UPMB values to work with a 24 MHz crystal. Could you confirm please?
    I appreciate your guidance.
  • Yes; the table labelled "Register Settings to Generate 48 MHz" indeed contains register settings to generate 48 MHz.
  • Guyan Jayaratne said:
    I have told the people designing the PCBs to get the next batch with a 24MHz XT2. As I can see in the family user guide, It has suitable UPQB and UPMB values to work with a 24 MHz crystal. Could you confirm please?

    Yes, but in this case your device will not be able to use directly XT2 as MCLK source, because it is limited per datasheet to max 20 MHz. Here is attached calculator that can help you to find (some standard crystal) value close to 20 MHz in case that you want to use directly XT2 also as MCLK source.

    0552.MSP430USBCalc.rar

  • Thanks for confirming Clemens.

    Thanks zrno too. I opened the calculator. Pretty cool. So the best way to use this calculator is to get a list of suitable crystals in the market, type in, and see if the PLLCLK field can output 48000000Hz +/- ~2500 ppm which Clemens suggested. So then I get my settings for USBPLLDIVB's UPQB and UPMB too from the calculator. Correct me if I'm wrong.

    Cheers all!
  • your device will not be able to use directly XT2 as MCLK source, because it is limited per datasheet to max 20 MHz

    That would be 32 MHz:

    So the best way to use this calculator is to get a list of suitable crystals in the market, type in, and see if the PLLCLK field can output 48000000Hz +/- ~2500 ppm

    The caluculator is helpful when you already have a crystal, but not for searching a crystal. The table in the datasheet already shows common crystal values; this is the same table with all possible frequencies that can be used to get a perfect 48 MHz:

     1.500000 MHz: UPQB=0 UPMB=31 DIVQ= 1 DIVM=32 CLKLOOP=1.500
     1.548387 MHz: UPQB=0 UPMB=30 DIVQ= 1 DIVM=31 CLKLOOP=1.548
     1.600000 MHz: UPQB=0 UPMB=29 DIVQ= 1 DIVM=30 CLKLOOP=1.600
     1.655172 MHz: UPQB=0 UPMB=28 DIVQ= 1 DIVM=29 CLKLOOP=1.655
     1.714286 MHz: UPQB=0 UPMB=27 DIVQ= 1 DIVM=28 CLKLOOP=1.714
     1.777778 MHz: UPQB=0 UPMB=26 DIVQ= 1 DIVM=27 CLKLOOP=1.778
     1.846154 MHz: UPQB=0 UPMB=25 DIVQ= 1 DIVM=26 CLKLOOP=1.846
     1.920000 MHz: UPQB=0 UPMB=24 DIVQ= 1 DIVM=25 CLKLOOP=1.920
     2.000000 MHz: UPQB=0 UPMB=23 DIVQ= 1 DIVM=24 CLKLOOP=2.000
     2.086957 MHz: UPQB=0 UPMB=22 DIVQ= 1 DIVM=23 CLKLOOP=2.087
     2.181818 MHz: UPQB=0 UPMB=21 DIVQ= 1 DIVM=22 CLKLOOP=2.182
     2.285714 MHz: UPQB=0 UPMB=20 DIVQ= 1 DIVM=21 CLKLOOP=2.286
     2.400000 MHz: UPQB=0 UPMB=19 DIVQ= 1 DIVM=20 CLKLOOP=2.400
     2.526316 MHz: UPQB=0 UPMB=18 DIVQ= 1 DIVM=19 CLKLOOP=2.526
     2.666667 MHz: UPQB=0 UPMB=17 DIVQ= 1 DIVM=18 CLKLOOP=2.667
     2.823529 MHz: UPQB=0 UPMB=16 DIVQ= 1 DIVM=17 CLKLOOP=2.824
     3.000000 MHz: UPQB=0 UPMB=15 DIVQ= 1 DIVM=16 CLKLOOP=3.000
     3.096774 MHz: UPQB=1 UPMB=30 DIVQ= 2 DIVM=31 CLKLOOP=1.548
     3.200000 MHz: UPQB=1 UPMB=29 DIVQ= 2 DIVM=30 CLKLOOP=1.600
     3.310345 MHz: UPQB=1 UPMB=28 DIVQ= 2 DIVM=29 CLKLOOP=1.655
     3.428571 MHz: UPQB=1 UPMB=27 DIVQ= 2 DIVM=28 CLKLOOP=1.714
     3.555556 MHz: UPQB=1 UPMB=26 DIVQ= 2 DIVM=27 CLKLOOP=1.778
     3.692308 MHz: UPQB=1 UPMB=25 DIVQ= 2 DIVM=26 CLKLOOP=1.846
     3.840000 MHz: UPQB=1 UPMB=24 DIVQ= 2 DIVM=25 CLKLOOP=1.920
     4.000000 MHz: UPQB=1 UPMB=23 DIVQ= 2 DIVM=24 CLKLOOP=2.000
     4.173913 MHz: UPQB=1 UPMB=22 DIVQ= 2 DIVM=23 CLKLOOP=2.087
     4.363636 MHz: UPQB=1 UPMB=21 DIVQ= 2 DIVM=22 CLKLOOP=2.182
     4.500000 MHz: UPQB=2 UPMB=31 DIVQ= 3 DIVM=32 CLKLOOP=1.500
     4.571429 MHz: UPQB=1 UPMB=20 DIVQ= 2 DIVM=21 CLKLOOP=2.286
     4.645161 MHz: UPQB=2 UPMB=30 DIVQ= 3 DIVM=31 CLKLOOP=1.548
     4.800000 MHz: UPQB=1 UPMB=19 DIVQ= 2 DIVM=20 CLKLOOP=2.400
     4.965517 MHz: UPQB=2 UPMB=28 DIVQ= 3 DIVM=29 CLKLOOP=1.655
     5.052632 MHz: UPQB=1 UPMB=18 DIVQ= 2 DIVM=19 CLKLOOP=2.526
     5.142857 MHz: UPQB=2 UPMB=27 DIVQ= 3 DIVM=28 CLKLOOP=1.714
     5.333333 MHz: UPQB=1 UPMB=17 DIVQ= 2 DIVM=18 CLKLOOP=2.667
     5.538462 MHz: UPQB=2 UPMB=25 DIVQ= 3 DIVM=26 CLKLOOP=1.846
     5.647059 MHz: UPQB=1 UPMB=16 DIVQ= 2 DIVM=17 CLKLOOP=2.824
     5.760000 MHz: UPQB=2 UPMB=24 DIVQ= 3 DIVM=25 CLKLOOP=1.920
     6.000000 MHz: UPQB=1 UPMB=15 DIVQ= 2 DIVM=16 CLKLOOP=3.000
     6.193548 MHz: UPQB=3 UPMB=30 DIVQ= 4 DIVM=31 CLKLOOP=1.548
     6.260870 MHz: UPQB=2 UPMB=22 DIVQ= 3 DIVM=23 CLKLOOP=2.087
     6.400000 MHz: UPQB=3 UPMB=29 DIVQ= 4 DIVM=30 CLKLOOP=1.600
     6.545455 MHz: UPQB=2 UPMB=21 DIVQ= 3 DIVM=22 CLKLOOP=2.182
     6.620690 MHz: UPQB=3 UPMB=28 DIVQ= 4 DIVM=29 CLKLOOP=1.655
     6.857143 MHz: UPQB=2 UPMB=20 DIVQ= 3 DIVM=21 CLKLOOP=2.286
     7.111111 MHz: UPQB=3 UPMB=26 DIVQ= 4 DIVM=27 CLKLOOP=1.778
     7.200000 MHz: UPQB=2 UPMB=19 DIVQ= 3 DIVM=20 CLKLOOP=2.400
     7.384615 MHz: UPQB=3 UPMB=25 DIVQ= 4 DIVM=26 CLKLOOP=1.846
     7.578947 MHz: UPQB=2 UPMB=18 DIVQ= 3 DIVM=19 CLKLOOP=2.526
     7.680000 MHz: UPQB=3 UPMB=24 DIVQ= 4 DIVM=25 CLKLOOP=1.920
     8.000000 MHz: UPQB=2 UPMB=17 DIVQ= 3 DIVM=18 CLKLOOP=2.667
     8.347826 MHz: UPQB=3 UPMB=22 DIVQ= 4 DIVM=23 CLKLOOP=2.087
     8.470588 MHz: UPQB=2 UPMB=16 DIVQ= 3 DIVM=17 CLKLOOP=2.824
     8.727273 MHz: UPQB=3 UPMB=21 DIVQ= 4 DIVM=22 CLKLOOP=2.182
     9.000000 MHz: UPQB=2 UPMB=15 DIVQ= 3 DIVM=16 CLKLOOP=3.000
     9.142857 MHz: UPQB=3 UPMB=20 DIVQ= 4 DIVM=21 CLKLOOP=2.286
     9.290323 MHz: UPQB=4 UPMB=30 DIVQ= 6 DIVM=31 CLKLOOP=1.548
     9.600000 MHz: UPQB=3 UPMB=19 DIVQ= 4 DIVM=20 CLKLOOP=2.400
     9.931034 MHz: UPQB=4 UPMB=28 DIVQ= 6 DIVM=29 CLKLOOP=1.655
    10.105263 MHz: UPQB=3 UPMB=18 DIVQ= 4 DIVM=19 CLKLOOP=2.526
    10.285714 MHz: UPQB=4 UPMB=27 DIVQ= 6 DIVM=28 CLKLOOP=1.714
    10.666667 MHz: UPQB=3 UPMB=17 DIVQ= 4 DIVM=18 CLKLOOP=2.667
    11.076923 MHz: UPQB=4 UPMB=25 DIVQ= 6 DIVM=26 CLKLOOP=1.846
    11.294118 MHz: UPQB=3 UPMB=16 DIVQ= 4 DIVM=17 CLKLOOP=2.824
    11.520000 MHz: UPQB=4 UPMB=24 DIVQ= 6 DIVM=25 CLKLOOP=1.920
    12.000000 MHz: UPQB=3 UPMB=15 DIVQ= 4 DIVM=16 CLKLOOP=3.000
    12.387097 MHz: UPQB=5 UPMB=30 DIVQ= 8 DIVM=31 CLKLOOP=1.548
    12.521739 MHz: UPQB=4 UPMB=22 DIVQ= 6 DIVM=23 CLKLOOP=2.087
    12.800000 MHz: UPQB=5 UPMB=29 DIVQ= 8 DIVM=30 CLKLOOP=1.600
    13.090909 MHz: UPQB=4 UPMB=21 DIVQ= 6 DIVM=22 CLKLOOP=2.182
    13.241379 MHz: UPQB=5 UPMB=28 DIVQ= 8 DIVM=29 CLKLOOP=1.655
    13.714286 MHz: UPQB=4 UPMB=20 DIVQ= 6 DIVM=21 CLKLOOP=2.286
    14.222222 MHz: UPQB=5 UPMB=26 DIVQ= 8 DIVM=27 CLKLOOP=1.778
    14.400000 MHz: UPQB=4 UPMB=19 DIVQ= 6 DIVM=20 CLKLOOP=2.400
    14.769231 MHz: UPQB=5 UPMB=25 DIVQ= 8 DIVM=26 CLKLOOP=1.846
    15.157895 MHz: UPQB=4 UPMB=18 DIVQ= 6 DIVM=19 CLKLOOP=2.526
    15.360000 MHz: UPQB=5 UPMB=24 DIVQ= 8 DIVM=25 CLKLOOP=1.920
    16.000000 MHz: UPQB=4 UPMB=17 DIVQ= 6 DIVM=18 CLKLOOP=2.667
    16.695652 MHz: UPQB=5 UPMB=22 DIVQ= 8 DIVM=23 CLKLOOP=2.087
    16.941176 MHz: UPQB=4 UPMB=16 DIVQ= 6 DIVM=17 CLKLOOP=2.824
    17.454545 MHz: UPQB=5 UPMB=21 DIVQ= 8 DIVM=22 CLKLOOP=2.182
    18.000000 MHz: UPQB=4 UPMB=15 DIVQ= 6 DIVM=16 CLKLOOP=3.000
    18.285714 MHz: UPQB=5 UPMB=20 DIVQ= 8 DIVM=21 CLKLOOP=2.286
    19.200000 MHz: UPQB=5 UPMB=19 DIVQ= 8 DIVM=20 CLKLOOP=2.400
    19.500000 MHz: UPQB=6 UPMB=31 DIVQ=13 DIVM=32 CLKLOOP=1.500
    20.129032 MHz: UPQB=6 UPMB=30 DIVQ=13 DIVM=31 CLKLOOP=1.548
    20.210526 MHz: UPQB=5 UPMB=18 DIVQ= 8 DIVM=19 CLKLOOP=2.526
    20.800000 MHz: UPQB=6 UPMB=29 DIVQ=13 DIVM=30 CLKLOOP=1.600
    21.333333 MHz: UPQB=5 UPMB=17 DIVQ= 8 DIVM=18 CLKLOOP=2.667
    21.517241 MHz: UPQB=6 UPMB=28 DIVQ=13 DIVM=29 CLKLOOP=1.655
    22.285714 MHz: UPQB=6 UPMB=27 DIVQ=13 DIVM=28 CLKLOOP=1.714
    22.588235 MHz: UPQB=5 UPMB=16 DIVQ= 8 DIVM=17 CLKLOOP=2.824
    23.111111 MHz: UPQB=6 UPMB=26 DIVQ=13 DIVM=27 CLKLOOP=1.778
    24.000000 MHz: UPQB=5 UPMB=15 DIVQ= 8 DIVM=16 CLKLOOP=3.000
    24.774194 MHz: UPQB=7 UPMB=30 DIVQ=16 DIVM=31 CLKLOOP=1.548
    24.960000 MHz: UPQB=6 UPMB=24 DIVQ=13 DIVM=25 CLKLOOP=1.920
    25.600000 MHz: UPQB=7 UPMB=29 DIVQ=16 DIVM=30 CLKLOOP=1.600
    26.000000 MHz: UPQB=6 UPMB=23 DIVQ=13 DIVM=24 CLKLOOP=2.000
    26.482759 MHz: UPQB=7 UPMB=28 DIVQ=16 DIVM=29 CLKLOOP=1.655
    27.130435 MHz: UPQB=6 UPMB=22 DIVQ=13 DIVM=23 CLKLOOP=2.087
    27.428571 MHz: UPQB=7 UPMB=27 DIVQ=16 DIVM=28 CLKLOOP=1.714
    28.363636 MHz: UPQB=6 UPMB=21 DIVQ=13 DIVM=22 CLKLOOP=2.182
    28.444444 MHz: UPQB=7 UPMB=26 DIVQ=16 DIVM=27 CLKLOOP=1.778
    29.538462 MHz: UPQB=7 UPMB=25 DIVQ=16 DIVM=26 CLKLOOP=1.846
    29.714286 MHz: UPQB=6 UPMB=20 DIVQ=13 DIVM=21 CLKLOOP=2.286
    30.720000 MHz: UPQB=7 UPMB=24 DIVQ=16 DIVM=25 CLKLOOP=1.920
    31.200000 MHz: UPQB=6 UPMB=19 DIVQ=13 DIVM=20 CLKLOOP=2.400
    32.000000 MHz: UPQB=7 UPMB=23 DIVQ=16 DIVM=24 CLKLOOP=2.000
    32.842105 MHz: UPQB=6 UPMB=18 DIVQ=13 DIVM=19 CLKLOOP=2.526
    33.391304 MHz: UPQB=7 UPMB=22 DIVQ=16 DIVM=23 CLKLOOP=2.087
    34.666667 MHz: UPQB=6 UPMB=17 DIVQ=13 DIVM=18 CLKLOOP=2.667
    34.909091 MHz: UPQB=7 UPMB=21 DIVQ=16 DIVM=22 CLKLOOP=2.182
    36.571429 MHz: UPQB=7 UPMB=20 DIVQ=16 DIVM=21 CLKLOOP=2.286
    36.705882 MHz: UPQB=6 UPMB=16 DIVQ=13 DIVM=17 CLKLOOP=2.824
    38.400000 MHz: UPQB=7 UPMB=19 DIVQ=16 DIVM=20 CLKLOOP=2.400
    39.000000 MHz: UPQB=6 UPMB=15 DIVQ=13 DIVM=16 CLKLOOP=3.000
    40.421053 MHz: UPQB=7 UPMB=18 DIVQ=16 DIVM=19 CLKLOOP=2.526
    42.666667 MHz: UPQB=7 UPMB=17 DIVQ=16 DIVM=18 CLKLOOP=2.667
    45.176471 MHz: UPQB=7 UPMB=16 DIVQ=16 DIVM=17 CLKLOOP=2.824
    48.000000 MHz: UPQB=7 UPMB=15 DIVQ=16 DIVM=16 CLKLOOP=3.000

    (Generated with a script that enumerates all valid Q/M values. Not all of those frequencies are available as crystals.)

  • Clemens Ladisch said:

    That would be 32 MHz:

    No, I was not thinking on max supported value for XT2, but for max XT2 as direct MCLK source. With 32 MHz XT2 max MCLK will be 32/2=16 MHz, and this is not what I want.

    Guyan, to this post is attached txt document (generated by calculator) with all possible XT2 values for USB, from 18 Mhz til 22 Mhz with 1 kHz resolution, so you can check by yourself, but I think (as already noted by Clemens) that 19.2 Mhz (standard value) will be perfect for your device.

    xt2.rar

  • Thanks to both of you. You've both been very helpful. 19.2 it is then.

**Attention** This is a public forum