TI E2E Community (Beta)
Welcome to the TI E2E (Engineer-to-Engineer) Community! We invite you to freely and openly interact with your peer Engineers, TI Engineers, and other experts in order to ask questions, share knowledge, explore ideas, and help solve problems.
More Search Options

MSP430F2001 external crystal

rated by 0 users
Answered (Not Verified) This post has 0 verified answers | 4 Replies | 3 Followers

Not Ranked
5 Posts
Community Member
Andy posted on 16 Oct 2009 2:51 PM

Hi there,

I would like to make sure that this code is enabling the external 32.768kHz watch crystal and also I would like to know how to enable the internal 6pF load capacitors for the crystal. I'm a hardware engineer so I will pass on the info to my software engineer. Thanks!

Andy.

 

void main(void)
{
  BCSCTL1 |= XCAP_1;                        // ACLK/2
  WDTCTL = WDT_ADLY_16; //250               // WDT 1s/4 interval timer
  IE1 |= WDTIE;                             // Enable WDT interrupt
 
  P1DIR = 0xF8;                             // All P1.x outputs
  P1OUT = 0;                                // All P1.x reset
  P2DIR = 0xFF;                             // All P2.x outputs
  P2OUT = 0;                                // All P2.x reset
 
  P1OUT |= 0x08;
 
  // initilize variables
  #if MY_DEBUG
  i_error = 0;
  led_on_mask = 0x08;
  mode = TEST_MODE;

  #else
  i_error = 0;
  led_on_mask = 0;
  mode = 0;
  #endif
 
  cnt_watering_hour = 0;
  cnt_watering = 0;
  upper_limit_hour[0] = 4;
  upper_limit_hour[1] = 6;
  upper_limit_hour[2] = 12;
 

  while(1)

All Replies

Top 25 Contributor
312 Posts
Community Member

The BOR/POR automatically enables the internal 6pF load capacitors for the crystal.

The line: " BCSCTL1 |= XCAP_1;                        // ACLK/2" does not make any sense.to me

The line: " P2DIR = 0xFF;                             // All P2.x outputs" seems incorrect too, I think BIT6 should be 0

Top 10 Contributor
349 Posts
Texas Instruments Employee
Suggested by Brandon

Hi,

To add to OCY's post, see page 301 of the 2xx User's Guide, which gives bit settings for all internal cap values.

Regards,
Brandon

DCAT - MSP430 Applications
Texas Instruments

Not Ranked
5 Posts
Community Member

Hi Brandon,

I can't find the information in the datasheet where it says what the default value for the BCSCTL3 (load capacitance) register is. The crystal I'm using has a specified load capacitance of 12.5pF in the datasheet. Can you please point me to this information so that I can verify I have the correct load capacitance selected?

The problem i'm seeing is that the processor doesn't always start up when i power on the board. I've narrowed it down to either the Vcc ramp rate affecting the reset behaviour or the crystal not starting. The supply comes up in about 50-100us. The startup seems to become more reliable the slower I make the supply ramp up.

Any advice much appreciated.

Andy.

Top 10 Contributor
1,180 Posts
Texas Instruments Employee

Andy:

I can't find the information in the datasheet where it says what the default value for the BCSCTL3 (load capacitance) register is. The crystal I'm using has a specified load capacitance of 12.5pF in the datasheet. Can you please point me to this information so that I can verify I have the correct load capacitance selected?

Section 5.3 of the MSP430x2xx Family User's Guide (SLAU144) has the reset value of the BCSCTL3 in Table 5-1.  This value is 0x05.  Furthermore, the register definition for BCSCTL3 has the reset value of each bit field under the illustration.  A XCAPx=01b equates to 6pF.

 

Brandon

Page 1 of 1 (5 items) |

ALL CONTENT AND MATERIALS ON THIS SITE ARE PROVIDED "AS IS". TI AND ITS RESPECTIVE SUPPLIERS MAKE NO REPRESENTATIONS ABOUT THE SUITABILITY OF THESE MATERIALS FOR ANY PURPOSE AND DISCLAIM ALL WARRANTIES AND CONDITIONS WITH REGARD TO THESE MATERIALS, INCLUDING BUT NOT LIMITED TO, ALL IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT OF ANY THIRD PARTY INTELLECTUAL PROPERTY RIGHT. NO LICENSE, EITHER EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, IS GRANTED BY TI. USE OF THE INFORMATION ON THIS SITE MAY REQUIRE A LICENSE FROM A THIRD PARTY, OR A LICENSE FROM TI.

Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms of Use of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms of Use of this site. TI and its suppliers reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.