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.

USB HID application, can the crystal be disabled when not connected?

Other Parts Discussed in Thread: MSP430F5508

Hi Experts, Does anyone have experience with disabling the crystal when the USB is not attached? The application runs with or without the USB plugged in. The target application will look like a multi-point HID (as shown in the HH1_hidDemo2hidDemo), running on a 'F5508. When the USB is attached, I'd want to turn on the external oscillator, and when the USB is removed, it should disable the oscillator. Is there any example code for this (or can someone give me an idea about how to do it or if it will even work)? Thanks!

  • Hello Mike,

    The USB requires a 60MHz clock for functional operation. When the USB is re-attached, turning on the crystal and then switching the PLL on would cause the functional clock not to be 60MHz and will affect the USB function during the re-attachment.

    Regards
    Amit
  • Hi Amit,
    I understand that it may take a second or so for the clock to stabilize. Does the host give up on the HID if it doesn't answer immediately? Or would the host continue to try to connect? HID doesn't show the user that it's connecting, so it wouldn't matter if it takes a few seconds anyway. Or does the MSP430 USB not even interrupt if the 60MHz clock is not running? My thinking is that I could get an interrupt from the USB module that says it's trying to connect (isn't that what the PUR signal is for??), and then start up the crystal and complete the connection when the clock is stable.

    Obviously, I'm new to USB applications... but I know enough that I can see that the example code isn't sufficient for what I want to do.

    thanks, Mike.
  • Mike Kaelin said:
    I understand that it may take a second or so for the clock to stabilize. Does the host give up on the HID if it doesn't answer immediately? Or would the host continue to try to connect

     It is not clear if HOST is TIVA or PC, and more...

    Mike Kaelin said:
    HID doesn't show the user that it's connecting, so it wouldn't matter if it takes a few seconds anyway. Or does the MSP430 USB not even interrupt if the 60MHz clock is not running?

     So are you using MSP430 I suppose 55xx series to do what? MSP430 has no HOST mode so is this question TIVA related?

    Mike Kaelin said:
    My thinking is that I could get an interrupt from the USB module that says it's trying to connect (isn't that what the PUR signal is for??), and then start up the crystal and complete the connection when the clock is stable.

     Ok but what processor, TIVA or MSP and what side HOST or DEVOCE USB are you speaking about?

     Again when clock is stable you wish restart connection to usb, so you can disable and reenable Device to reenter initial phase of USB. I am not so expert on USB and I don't like so much but I learned on field what is needed to get working what surround us "DE FACTO" imposed worst standard.

  • Sorry if I didn't make that clear - the application is an MSP430F5508 as a multipoint HID, with a PC as a host. I'd like to have it running something similar to the HH1_hidDemo2hidDemo in the example code, although I want it interrupt-driven instead of polled in a loop (I posted a separate question about that).
  • Hello Mike

    I think you should be posting the same to the MSP430 forum. This is TIVA Forum (TM4C)

    Regards
    Amit
  • Hello Mike,

    There are no examples that I know of that demonstrate exactly what you want but it is definitely possible. Interrupts are available for when USB is connected and disconnect, along with a Suspend/Resume command from the host. Disabling the Xtal will affect your response time for USB communication, but you will save on power. For more detailed information I would check the following sections in the MSP430x5xx and MSP430x6xx Family User's Guide :

    Section 40.2.3.3 PLL Startup Sequence

    Section 40.2.4.5 Suspend and Resume Logic

    Section 40.2.5 USB Vector Interrupts

    Section 40.2.6 Power Consumption

    Section 40.2.7 Suspend and Resume

    Regards,

    JH

**Attention** This is a public forum