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.

UPCS0 bit in USBPLLCTL in usb.c

Other Parts Discussed in Thread: MSP430F5510, MSP430F5637

Hi All,

I have just returned to a development that I have been doing with the MSP430F5510 using USB. 

I use  Rowley Crossstudio for MSP430 to do my development, and have converted the TI USB stack so that it will compile with this development platform. Occasionally Rowley update the  support packages for the MSP430 to include new processor variants, and when I returned to my code today there was such an update. Having installed the update I attempted to re-compile the code that I had used before and found an error is the file usb.c as follows.

if (USB_PLL_XT == 2){
     USBPLLCTL = UPCS0 + UPFDEN + UPLLEN;                                                          //Select XT2 as Ref / Select PLL for USB / Discrim.
                                                                                                                                                  //on, enable PLL
} else {
     USBPLLCTL = UPFDEN + UPLLEN;                                                                            //Select XT1 as Ref / Select PLL for USB /
                                                                                                                                                   //Discrim. on, enable PLL
}

Gives me an error with an undeclared identifier 'CPCS0'

I had a look in "MSP430x5xx and MSP430x6xx Family.pdf"  to check out the bits in the USBPLLCTL register to try to see what was going wrong and CPCSO is not defined.

I then booted up my copy of CCS with the standard TI USB code and tracked back into  the header files where I find

/* USBPLLCTL Control Bits */
//#define RESERVED (0x0001) /* USB - */
//#define RESERVED (0x0002) /* USB - */
//#define RESERVED (0x0004) /* USB - */
//#define RESERVED (0x0008) /* USB - */
//#define RESERVED (0x0010) /* USB - */
//#define RESERVED (0x0020) /* USB - */
#define UCLKSEL0 (0x0040) /* USB - Module Clock Select Bit 0 */
#define UCLKSEL1 (0x0080) /* USB - Module Clock Select Bit 1 */
#define UPLLEN (0x0100) /* USB - PLL enable */
#define UPFDEN (0x0200) /* USB - Phase Freq. Discriminator enable */
//#define RESERVED (0x0400) /* USB - */
//#define RESERVED (0x0800) /* USB - */
#define UPCS0 (0x1000) /* USB - PLL Clock Select Bit 0 */
//#define RESERVED (0x2000) /* USB - */
//#define RESERVED (0x4000) /* USB - */
//#define RESERVED (0x8000) /* USB - */

This shows a definition for UPCS0 in USBPLLCTL, but it is in a position that the reference manual says is reserved.

Can anyone tell me what is going on here, is the reference manual correct or is the header file correct??

Regards

Roy

  • (SEE COMMENT FURTHER DOWN, THIS SUGGESTION IS INCORRECT ~Brian) Modify the source code to use UCLKSEL0 and UCLKSEL1 defines. They match the User's Guide.

    Not sure where the UPCS0 came from, that may have been a bug in the source code originally. Sometimes these packages are developed in parallel with the chips before the silicon is complete, and things move. Not saying that is the case here, but just one suspicion.

  • UPCS0 is not documented in family datasheet, but maybe TI knows for what it is used (if it is used). MSP430F5510 USB will work with UPCS0 or without in USBPLLCTL definition, no difference.

    BTW, I have for TI question regarding UCLKSEL. Are the UCLKSEL reserved input lines (01, 10, 11) connected to something, or if there is possibility to drive USB directly from 48 MHz XT2 without using PLL.

  • zrno soli said:
    or if there is possibility to drive USB directly from 48 MHz XT2 without using PLL.

    Figure 40-5 on page 1081 of SLAU208M.PDF kind of says it all. See also Table 40-2 for limits on input to PLL.

  • Brian Boorman said:

    Figure 40-5 on page 1081 of SLAU208M.PDF kind of says it all. See also Table 40-2 for limits on input to PLL.

    I know, and my question is related to Figure 40-5, if the reserved lines are connected to something (bypassing PLL). I also know for PLL input limits, my question is not related to this.

    BTW, here is my calculator for USB PLL http://forum.43oh.com/topic/3904-usb-pll-configurator

  • zrno soli said:
    or if there is possibility to drive USB directly from 48 MHz XT2 without using PLL.

    Besides the fact that the device we are talking about has a max input frequency of 32 MHz on the XT2 input? (Bypass and Mode 3).

    See table on Page 54 of SLAS645G

  • Brian Boorman said:

    Besides the fact that the device we are talking about has a max input frequency of 32 MHz on the XT2 input? (Bypass and Mode 3).

    See table on Page 54 of SLAS645G

    My question is not related to datasheet fact of max 32 MHz XT2. I am using 48 MHz for XT2, and want to know if there is undocumented possibility to bypass USB PLL (UCLKSEL).

  • Hey so I ran into this problem as well.  I changed UPCS0 to  UCLKSEL0, but I'm still unclear on this.  Is UPCS0 a mistake in the USB code and it really should be UCLKSEL0.  

    Also, I've got a board which I'm able to program with a launchpad (it has a MSP430F5637 on it), but when I plug it into my computer it just pops up in windows as an unkown device no matter what USB example I program into it.  I'm trying the HID examples and I expected it to pop up and be recognized as a HID device.  Am I missing something or is do I have to do something else to get it to work.  I thought, especially the HID examples, you could just program the MSP430 with the launchpad which works and then just plug it in and the example code should be recognized and running.  Any ideas?

  • Robbie Valentine said:
    Hey so I ran into this problem as well.  I changed UPCS0 to  UCLKSEL0, but I'm still unclear on this.  Is UPCS0 a mistake in the USB code and it really should be UCLKSEL0.

    Changing UPCS0 to UCLKSEL0 will not do the same thing, as these two constants are define to be different values.

    #define UCLKSEL0 (0x0040) /* USB - Module Clock Select Bit 0 */

    #define UPCS0 (0x1000) /* USB - PLL Clock Select Bit 0 */

    From the Family reference manual definition of UCLKSEL

    USB module clock select. Must always be written with 00.
    00b = PLLCLK (default)
    01b = Reserved
    10b = Reserved
    11b = Reserved

    Simply deleting UPCS0 should work.

    XT2_Start(XT2DRIVE_3);
    USBPLLDIVB = USB_XT_FREQ;         //Settings desired frequency

    if (USB_PLL_XT == 2){
            USBPLLCTL = UPFDEN + UPLLEN;         //Select XT2 as Ref / Select PLL for USB / Discrim.//on, enable PLL
    } else {
            USBPLLCTL = UPFDEN + UPLLEN;         //Select XT1 as Ref / Select PLL for USB//Discrim. on, enable PLL
    }

    This is the code that I am using. My code is based on the standard TI HID example, and works reliably.

    Roy

  • AHH!!!!  Thank you so much for this post. I finally got my board working.  This was the problem.  I read initially to replace UPCS0 with UCLKSEL0 so I did.  I followed your advice and removed it and now my board is up and running and installs as a hid device no problem!!!  Thanks again I've been working on this for about two weeks now!  Really appreciate the help.

    I guess I was setting the 0 bit in the two bit field of UCLKSEL and in the datasheet on page 1100 it shows that you can only select the PLL clock so both bits are required to be 0's end of story.  

    Rob

  • Hey all, 

    I have a problem that related to this, I hope someone knows how to solve it.
    So i previously have same error with UPCS0, then I followed the solution that explained above. 
    when I compiled it, there is another error which is written like this:

    Fatal Error[e89]: Too much object code produced (more than 0x2000 bytes) for this package

    I thought this error because the IAR IDE that I used doesn't support bigger file.
    I am using stand alone license- IAR embedded workbench for TI MSP430, 4K kickstart edition 5.60.
    I tried to solve this problem by checking the override default in the debug option, but it still stays in the same error.
    So I wonder if anyone knows what to do?
    or if it is required to downgrade my license from kickstart to something else (30-days trial perhaps), how should i do it?

    Thank you in advance!

    looking forward for your responds.


    Best Regards, 



    Stella 

**Attention** This is a public forum