Jump to content
43oh

Am I frying my crystals?


Recommended Posts

Up until now, I haven't needed the 32kHz crystal on the LP, so I haven't mounted them. I need them now (for VFD clock), and I can't get them to work.

 

I've tried 2 brand-new v1.5 LaunchPads, and 3 crystals (the small ones that come with LPs). None have worked. At @oPossum's suggestion, I even tried removing the 0R 0805 jumpers (R28, R29), with no change.

 

Can anyone help?

 

I've been running the code below from TI to test, and I always get the rapid flash (1Hz flash means crystal is working).

//******************************************************************************
//  MSP430G2xx3 Demo - LFXT1 Oscillator Fault Detection
//
//  Description: System runs normally in LPM3 with WDT timer clocked by
//  32kHz ACLK with a 1x4 second interrupt. P1.0 is normally pulsed every
//  second inside WDT interrupt. If an LFXT1 oscillator fault occurs,
//  NMI is requested forcing exit from LPM3. P1.0 is toggled rapidly by software
//  as long as LFXT1 oscillator fault is present. Assumed only LFXT1 as NMI
//  source - code does not check for other NMI sources.
//  ACLK = LFXT1 = 32768, MCLK = SMCLK = Default DCO
//
//  //*External watch crystal on XIN XOUT is required for ACLK*//
//
//
//		   MSP430G2xx3
//		 ---------------
//	 /|\|		    XIN|-
//	  | |			   | 32kHz
//	  --|RST	    XOUT|-
//	    |			   |
//	    |		   P1.0|-->LED
//
//  D. Dang
//  Texas Instruments Inc.
//  December 2010
//   Built with CCS Version 4.2.0 and IAR Embedded Workbench Version: 5.10
//******************************************************************************
#include <msp430g2553.h>
volatile unsigned int i;
void main(void)
{
 WDTCTL = WDT_ADLY_1000;				   // WDT 1s interval timer
 IE1 |= WDTIE;							 // Enable WDT interrupt
 P1DIR = 0xFF;							 // All P1.x outputs
 P1OUT = 0;							    // All P1.x reset
 P2DIR = 0xFF;							 // All P2.x outputs
 P2OUT = 0;							    // All P2.x reset
// An immedate Osc Fault will occur next
 IE1 |= OFIE;							  // Enable Osc Fault
 while(1)
 {
  P1OUT ^= 0x01;						   // Toggle P1.0 using exclusive-OR
 _BIS_SR(LPM3_bits + GIE);				 // Enter LPM3 w/interrupt
 }
}
#pragma vector=WDT_VECTOR
__interrupt void watchdog_timer (void)
{
   _BIC_SR_IRQ(LPM3_bits);				 // Clear LPM3 bits from 0(SR)
}
#pragma vector=NMI_VECTOR
__interrupt void nmi_ (void)
{
 do
 {
   IFG1 &= ~OFIFG;						 // Clear OSCFault flag
   for (i = 0xFFF; i > 0; i--);		    // Time for flag to set
   P1OUT ^= 0x01;						  // Toggle P1.0 using exclusive-OR
 }
 while (IFG1 & OFIFG);					 // OSCFault flag still set?
 IE1 |= OFIE;							  // Enable Osc Fault
}

Link to post
Share on other sites

I put the crystal on one of my LP's (just so one had it and the other didn't) and the code above works for me. :-(

Any chance you're just not getting a good solder joint?

I put a dab of solder down before laying the legs of the crystal down and that seemed to work well. I also soldered the body of the crystal to the pad on the board.

I can post a pic if you'd like.

Link to post
Share on other sites
You shouldn't use P2DIR |= BIT6 + BIT7 when using them as crystal pins, instead, use P2SEL |= BIT6 + BIT7. This sets these pins in crystal operating mode.

 

The code is straight from TI, so it should be correct. Cubeberg posted it as the test he uses, and abecedarian posted above that it works for him. No harm in trying your chsnges, though. I'll give it a shot.

 

What soldering iron are you using? Temp controlled?

 

I am using an older temp controlled iron, but I probably have it set too high most of the time (noob). I lowered it to about 350 on the slider for the second LP attempt, and tried to be quick (2-3sec for body, maybe 1sec for leads).

 

Sent from my Galaxy Note 2 using Tapatalk 2

 

EDIT: Here's my iron:

post-18-0-04738100-1353857441_thumb.jpg

Link to post
Share on other sites

You shouldn't use P2DIR |= BIT6 + BIT7 when using them as crystal pins, instead, use P2SEL |= BIT6 + BIT7. This sets these pins in crystal operating mode.

 

On 2xx series MCUs, the PUC value for P2SEL is 0xC0, so the crystal function (always on these pins) is always enabled by default. You need to explicitly clear the bits on 2xx chips if you want to use P2.6/P2.7 for anything else (e.g., Anaren radios).

 

This is different from most other MSP430 families, where the XIN/XOUT functions can be on different pins and must be explicitly selected. In many of those cases, the peripheral function bits associated with the XOUT pin are irrelevant: it's the setting for the XIN pin that matters (and controls both).

Link to post
Share on other sites

The code is straight from TI, so it should be correct. Cubeberg posted it as the test he uses, and abecedarian posted above that it works for him. No harm in trying your chsnges, though. I'll give it a shot.

I can mail you my LP with crystal and g2553 with the above code loaded if it would help.
Link to post
Share on other sites

I can mail you my LP with crystal and g2553 with the above code loaded if it would help.

 

Very generous, but I'd like to figure this out so I don't have this problem in the future...

 

Can I replace the crystal with a 2-pin cylindrical like these?

post-18-0-83636000-1353862019_thumb.jpg

They might be easier to solder.

Link to post
Share on other sites

Tried off a straight 5V USB AC adapter with a power-only cable and 5V straight to test points with a bench supply. No Joy.

Strange!

 

Are you soldering the launchpad with any ground/neutral connected to it?

 

I ask because I've seen soldering guns that leak mains A/C onto the tip and if yours was doing this, it would surely blow the LP if the LP is grounded. If you want to test, just put a DMM lead on ground and another on the TIP of your soldering gun and see what you read. Highly unlikely this is the problem but you never know!

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...