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.

MSP430F5638 XT2 for USB, setting port up

Other Parts Discussed in Thread: MSP430WARE

Hello! We're bringing up our first spin boards and I hae a question about XT2 pin setup.

We have a nice 24MHz crystal wired into XT2IN and XT2OUT.  The XT2 is, from what I see, switchable between GPIO and XT2xxx.

I'm trying to set it in peripheral mode using the GPIO library:

// Pins 2 and 3 are XT2

GPIO_setAsPeripheralModuleFunctionInputPin(GPIO_PORT_P7, GPIO_PIN2);
GPIO_setAsPeripheralModuleFunctionOutputPin(GPIO_PORT_P7, GPIO_PIN3);

..and yet, there is no connection when I plug in a USB cable - just nothing at all. I've already tried different ports and cables that are known good with other 
USB devices.. no joy.

The oscillator appears to be non-functional and my hardware guy blames the GPIO pins as "They must be pulling the signal down", so before I go beat him with a floppy disk I want to make sure I'm not the stupid one, and if I am, fix it!

All assistance appreciated!

Ed Averill

  • Edward:

    Here are 2 lines from msp430f66xx_UCS_07.c (example code):

      P7SEL |= BIT2+BIT3;                       // Port select XT2
      UCSCTL6 &= ~XT2OFF;                       // Set XT2 On

    It looks like you have done the first part with driver lib, but you also need to add the call to "set XT2 on."

  • also under C:\ti\msp430\MSP430ware_1_97_00_47\driverlib\examples\MSP430F5xx_6xx\ucs, see

    ucs_ex4_XTSourcesDCOInternal.c

    //!  This program demonstrates using an external 32kHz crystal to supply ACLK,
    //!  and using a high speed crystal or resonator to supply SMCLK.
    //!  MLCK for the CPU is supplied by the internal DCO.  The 32kHz crystal
    //!  connects between pins Xin and Xout. The high frequency crystal or
    //!  resonator connects between pins XT2IN and XT2OUT.  The DCO clock is
    //!  generated internally and calibrated from the 32kHz crystal.
    //!  ACLK is brought out on pin P11.0, MCLK is brought out on P11.1,
    //!  SMCLK is brought out on P11.2.

    Hopefully, that helps...

     

  • Thanks, will try it after lunch!

    Ed Averill
  • Ok, excellent, I see a nice signal coming out of the oscillator but it's VERY low voltage compared to an identical crystal on the pother side of the boar.. sine he's out this week, I guess I get to compare the USB circuit on the (working MSP proto bard to ours.. ugh.. software dude debugging circuits, danger danger!

    Thanks everyone for the help!
  • A possible reason might be a wrong load capacitance on the crystal. If you see '20pF load capacitance' it means you need to attach 40pF (minus 2pF pin capacitance minus any trace parasitic capacitance) from each crystal pin to GND. If capacitances don't match, the oscillation is dampened and might not reach the trigger level for the digital part of the clock circuit.

**Attention** This is a public forum