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.

MSP430 Hangs BIOS, and then I get "Unknown Device" in device manager in Windows 7

Other Parts Discussed in Thread: MSP430F5529, MSP-TS430PN80USB, MSP-EXP430F5529LP

Hi,

I've programmed my MSP430F5529 as a CDC+HID, and every so often my computer will stay on BIOS for more than usual, and when it boots up, will report unknown device in device manager with code 43. I've tried the USB9 fix, but to no avail. I think the code I'm using for initialization, that was pulled from the USB API, already includes this fix, anyway. This is what I pulled out of USB_init():

/* If USB device is self-powered, USB_SUPPORT_SELF_POWERED = 0xc0 */
#if (USB_SUPPORT_SELF_POWERED == 0xc0)
   /* To fix USB9 enumeration issue */
   USBPWRCTL = 0;
#endif

And I changed USB_SUPPORT_SELF_POWERED to 0xc0. Originally it was 0x80.

That did not help, so I tried changing the following line:

for (j = 0; j < 2000; j++) {
   for (i = 0; i < (DelayConstant_250us); i++) {//wait some time for LDOs (5ms delay)
   _NOP();
   }
}

I changed j<2000 from j<20. Now it is 500ms. This probably won't help, but I am trying to recreate the problem to see if maybe it did. If this doesn't fix the problem, I might resort to looking for an error produced from USB initialization and restart the MSP430 if I see the error.

Any other suggestions would help. 

  • Hi buckshot,

    Are you using a MSP-EXP430F5529/MSP-EXP430F5529LP, MSP-TS430RGC64USB/MSP-TS430PN80USB, or custom board? Can you share a simplified code example that re-creates the issue? I am trying to loop in a USB expert to help advise on your issue.

    Regards,
    Ryan
  • Hello,

    Can you give me some more information, if possible?  Is the CDC+HID application you are running on your device the same as the one packaged with MSP430USBDevelopersPackage or downloaded from MSPWare?  Is the MSP430F5529 on a custom board or is it the launchpad?  Also how long does it take before you see your issue - two hours, one day....?  Can you help me reproduce your issue by listing the exact steps I will need to go through to see it so I can help you resolve it?

    This could be a Windows 7 setting issue but I need to be able to reproduce it.

    Regards,

    Arthi

  • I picked pieces from different demos off the USB package to create my own program.My MSP430 emulates a keyboard and COM Port. Here is my boot up sequence:

    USB_setup(TRUE,TRUE);
    initRTC();
    initPorts();
    initUART();
    initI2C();
    Keyboard_Init();
    initADC();
    initPMM();

    __enable_interrupt();

    This is a custom board, on a custom built system. The PC the MSP is connected to runs embedded Windows 7. On boot up, if it chooses to happen, it will hang at BIOS for a little bit, but will continue to boot, eventually. Device manager then reports that there is an Unknown Device. Code 43. 

    It appears to be random. We cannot reproduce it consistently. As of now, it appears to happen once a day, in the morning when we get to work. If we power everything down and reboot after the initial boot up, it will run fine. BIOS does not hang. The system we have it on runs on a large 16 volt battery. So, the computer and my custom board run off the battery. I shut off power to everything with one switch. 

    When we were testing one day, it would do this every other boot up. Recently, its just once a day. Like I said, it appears to be very random.

    When designing the circuit card, I used the schematics from the demo board as guidance:  27 ohm in-line resistors on both USB lines, 10 pF caps, and DP attached to PUR by 1K resistor. The MSP430 is self-powered, and runs off a 3.3V regulator. DVcc1 is connected to 3.3V, with a 10uF cap, and a 100nF ceramic cap. DVcc2 is conncected to 3.3V and a 100 nF ceramic cap. 

    By the way, the 500 ms delay I put in USB_init() did not solve my problem.

  • Well, since you have so many variations here with custom code, custom board and the issue is random, is it possbile to narrow the failure down to either hardware or software? You could try these things to see if hardware or software is the problem:
    1) Run one of the packaged HID + CDC example code on your custom board
    2) Run only the HID keyboard example
    3) Run only one of the CDC examples
    4) Run your custom software on either the MSP430F5529 Launchpd or the F5529 EVM board powered in the configuration you have on your custom board.

    Regards,
    Arthi
  • Yea, I might have to run through those scenarios.

    Can you take a look at this code I have for setting up the clocks:
    setVcoreLevel(0x01);
    setVcoreLevel(0x02);
    setVcoreLevel(0x03);

    UCSCTL3 = SELREF_2; // Set DCO FLL reference = REFO
    UCSCTL4 |= SELA_2; // Set ACLK = REFO

    // Begin changing clock to 20 MHz
    __bis_SR_register(SCG0);
    UCSCTL0 = 0x0000;
    UCSCTL1 = DCORSEL_7; // 50MHz operation
    UCSCTL2 = FLLD_0 + 610; // (N + 1) * FLLRef = Fdco, (610 + 1) * 32768 = 20MHz, FLL Div = fDCOCLK/2
    __bic_SR_register(SCG0);
    __delay_cycles(630000); // 32 x 32 x 20 MHz / 32,768 Hz ~ 625k MCLK cycles for DCO to settle

    do {
    UCSCTL7 &= ~(XT2OFFG + XT1LFOFFG + DCOFFG); // Wait until the clocks have settled to continue
    SFRIFG1 &= ~OFIFG;
    } while (SFRIFG1 & OFIFG);

    Would I have a problem with USB by setting the clock this way?

    I know in the USB examples, it uses the function "initClocks(uint32_t mclkFreq)" to set mclk frequency to 8 MHz
  • I have a 4 MHz crystal resonator on my custom board connected to XT2. I believe its the same one used in the development board.

    How does Windows come up with a Code 43 anyway? Does the MSP430 tell Windows it had a problem, or does Windows figures it out? That might point me in the right direction in where to look in my code.
  • Well according to various blog sites, Code 43 is generated by Windoes when the device reports to Windows that it is having some sort of problem. To rectify this most people un-install and then re-install the driver. In the MSP430 case, the only driver that is included as part of the Developers Package is for the CDC device.

    I would assume that this is not a MSP430 software issue since the application works most of the time (So all your crystal setting and clock setting is correct). I think that this is probably a hardware issue. Maybe a capactitor that is holding charge for too long and does not discharge properly. You do say that in the first boot up of the day, everything works correctly however when you choose to do a re-boot then the issue occurs sometimes.


    Regards,
    Arthi
  • The picture below shows how I have my microcontroller set up. Does this look alright?

  • I see a couple of items that are different from what is shown on Figure 8 of SLAA457A.pdf document. These items might need to be looked over and verified:
    1) 100nF capacitor off of VBUS in your design. I don't see this in SLAA457A
    2) PUR has 1.4K ohm resistor connected to it in SLAA457A. In your design, it looks like it is 1K resistor.
    3) Also the way the PUR design looks, it seems like the 1M is connected to PUR instead of D+ line (not sure about this one)
    4) The two 10pF capacitors off of D+ and D- lines should be before the 27 ohm resistors.

    Regards,
    Arthi
  • 1) Yea I added that 100nF ceramic capacitor. I can try removing it.

    2) I can try replacing my resistor with a 1.4 kohm resistor.

    3) This one is odd; I went off the design files for the experiment board. I'll attach a picture of what they did below. The design files are different from SLAA457A.

    4) I'm not sure I can do much about this...  I can  see the electrical differences by moving the capacitors. Are the 10pF just for noise? I guess they could send reflections back to the PC...

    My boards have been finalized, so there's very little I can do about hardware at this point, except to make these changes to design and if we make another lot, to incorporate the changes.

    Could each one of these issues cause my problem of the MSP430 reporting a problem with USB? Number 1 looks like it can. What would a 1K resistor do on the PUR line, instead of 1.4K? Numbers 3 and 4 also look questionable.

  • Your problem is unusual becuase USB is working for you but you see occassional problems when you boot up. The one way you can be sure that the above listed items are not causing the issue you are seeing is to follow the specification in SLAA457a and the EVM board designs. Since you pointed out that item 3 is seen in the EVM specification, you can leave the layout for PUR the way it is. The other items might be worth re-working.

    If after the re-work the issue still exists then your hardware investigation has to go beyond USB layout to other items on your board.

    Section 4.4 in SLAA457A talks about the use of the 1.4k resistor on PUR.

    Regards,
    Arthi

**Attention** This is a public forum