<?xml version="1.0" encoding="utf-8" standalone="no"?>
<!DOCTYPE document PUBLIC "-//CNX//DTD CNXML 0.5//EN" "http://cnx.rice.edu/cnxml/0.5/DTD/cnxml_plain.dtd">
<document xmlns="http://cnx.rice.edu/cnxml" xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" id="Module.2004-02-26.2643">
  <name xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/">Clock System on the MSP430</name>
  <metadata xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/">
  <md:version xmlns:bib="http://bibtexml.sf.net/">1.1</md:version>
  <md:created xmlns:bib="http://bibtexml.sf.net/">2004/02/26 11:26:43 US/Central</md:created>
  <md:revised xmlns:bib="http://bibtexml.sf.net/">2004/02/26 13:47:50 US/Central</md:revised>
  <md:authorlist xmlns:bib="http://bibtexml.sf.net/">
      <md:author xmlns:bib="http://bibtexml.sf.net/" id="seejaie">
      <md:firstname xmlns:bib="http://bibtexml.sf.net/">CJ</md:firstname>
      
      <md:surname xmlns:bib="http://bibtexml.sf.net/">Ganier</md:surname>
      <md:email xmlns:bib="http://bibtexml.sf.net/">seejaie@rice.edu</md:email>
    </md:author>
  </md:authorlist>

  <md:maintainerlist xmlns:bib="http://bibtexml.sf.net/">
    <md:maintainer xmlns:bib="http://bibtexml.sf.net/" id="deaniafe">
      <md:firstname xmlns:bib="http://bibtexml.sf.net/">Deania</md:firstname>
      <md:othername xmlns:bib="http://bibtexml.sf.net/">M.</md:othername>
      <md:surname xmlns:bib="http://bibtexml.sf.net/">Fernandez</md:surname>
      <md:email xmlns:bib="http://bibtexml.sf.net/">deaniafe@rice.edu</md:email>
    </md:maintainer>
    <md:maintainer xmlns:bib="http://bibtexml.sf.net/" id="seejaie">
      <md:firstname xmlns:bib="http://bibtexml.sf.net/">CJ</md:firstname>
      
      <md:surname xmlns:bib="http://bibtexml.sf.net/">Ganier</md:surname>
      <md:email xmlns:bib="http://bibtexml.sf.net/">seejaie@rice.edu</md:email>
    </md:maintainer>
    <md:maintainer xmlns:bib="http://bibtexml.sf.net/" id="adrianv">
      <md:firstname xmlns:bib="http://bibtexml.sf.net/">Adrian</md:firstname>
      
      <md:surname xmlns:bib="http://bibtexml.sf.net/">Valenzuela</md:surname>
      <md:email xmlns:bib="http://bibtexml.sf.net/">adrianv@rice.edu</md:email>
    </md:maintainer>
    <md:maintainer xmlns:bib="http://bibtexml.sf.net/" id="jpfrantz">
      <md:firstname xmlns:bib="http://bibtexml.sf.net/">Patrick</md:firstname>
      
      <md:surname xmlns:bib="http://bibtexml.sf.net/">Frantz</md:surname>
      <md:email xmlns:bib="http://bibtexml.sf.net/">jpfrantz@rice.edu</md:email>
    </md:maintainer>
  </md:maintainerlist>
  
  <md:keywordlist xmlns:bib="http://bibtexml.sf.net/">
    <md:keyword xmlns:bib="http://bibtexml.sf.net/">clock system</md:keyword>
    <md:keyword xmlns:bib="http://bibtexml.sf.net/">digital clock</md:keyword>
    <md:keyword xmlns:bib="http://bibtexml.sf.net/">msp430</md:keyword>
  </md:keywordlist>

  <md:abstract xmlns:bib="http://bibtexml.sf.net/">Describes how the clock system works on the MSP430.</md:abstract>
</metadata>

  <content xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/">
<para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" id="clock1">
The clock system on the MSP430 is designed to be flexible and low power.  The implementation of these goals is largely based on the ability to select different clocks for different parts of the chip.  By choosing the minimum clock speed necessary for a given module, power consumption is reduced and the particular synchronization needs of the module can be met. 
</para>

<para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" id="clock2">
The MSP has three clock sources for the clocking system, and three clock lines that chip systems can choose between. The clock sources are used as the basis for the clock lines, and this allows for a mix of slow and fast clocks to be used around the system.  The three clock sources are:
<list xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" id="sources" type="enumerated">
<item xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/"><term xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/">Low Frequency Crystal Clock (LFXTCLK)</term> – this signal is meant to come from a watch crystal external to the MSP itself.  The crystal connects to the XIN and XOUT pins, and the intended oscillation is 32kHz.  This is the source of the Auxiliary Clock  line (ACLK).  The primary control of this source is that it can be turned off with the OSCOFF option in the Status Register.  The source also has a high-speed mode for faster crystals.</item>
<item xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/"><term xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/">Crystal 2 Clock (XT2CLK)</term> – this signal is the second external clock source, and it is connected to the XT2IN and XT2OUT pins.  In our case, the source is connected to a 7.3MHz crystal.  In general, this signal is meant to be the high-speed clock source.  This source  can be turned off with the XT2OFF bit of the Basic Clock system control register 1 (BCSCTL1). </item>
<item xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/"><term xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/">Digitally Controlled Oscillator Clock (DCOCLK)</term> – this is the only internally generated clock input, and it is the default clock source for the master clock upon reset.  By default this clock runs at about 900kHZ, but the RSELx, MODx, and DCOx  bits allow this to be divided down or even blended to achieve a lower clock frequency on average. </item>
</list>
</para>

<para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" id="clock3">
The three clock lines are:
<list xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" id="lines" type="enumerated">
<item xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/"><term xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/">Master Clock (MCLK)</term> – This clock is the source for the MSP CPU core; this clock must be working properly for the processor to execute instructions.  This clock has the most selection for its source.  The source is selected with the SELMx bits of the Basic Clock System Control Register 2 (BCSCTL2). The divider is controlled with the DIVMx of the BCSCTL2.  Finally, the CPU can be turned off with the CPUOFF bit of the Status Register (SR), but to recover from this state an interrupt must occur.</item> 
<item xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/"><term xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/">Submaster Clock (SMCLK)</term> -  This clock is the source for most peripherals, and its source can either be the DCO or Crystal 2.  The source clock is controlled with the  SELS and SCG bits of the BCSCTL2 and SR.  The divider is controlled by the DIVSx bits of the BCSCTL2.</item>
<item xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/"><term xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/">Auxiliary Clock (ACLK)</term> -  this clock line’s source is always LFXTCLK.  It is an option for slower subsystems to use in order to conserve power.  This clock can be divided as controlled by the DIVAx bits of the Basic Clock System Control Register 1 (BCSCTL1).</item>
</list>
</para>

<para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" id="clock4">
The MSP clock system has dividers at the beginning of its clocks, and at most peripheral destinations.  This allows for each module to keep a separate timing scheme from other modules.  This is often necessary for off chip buses because these systems have to meet a variety of speed requirements from the outside.  For educational purposes the fastest clocks are usually the most useful, but power consumption is the primary cost of high speed clocks.  
</para>

<section xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" id="dividers">
<name xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/">Clock Dividers</name>
<para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" id="div1">
Throughout the MSP clocking system there are clock dividers. A clock divider reduces the frequency of an input clock and outputs this divided frequency.  The simplest dividers work on multiples of two, so the output might be a square wave of half, one quarter, or one eighth the input square wave’s frequency.  
</para>
</section>

</content>
  
</document>
