Zigbee Module Examples

- Main Page
- Related Pages
- Modules
- Data Structures
- Files

- File List
- Globals

All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Functions
hal_msp430x2xxx_oscillators.c File Reference

Hardware Abstraction Layer (HAL) toolbox of utilities for configuring the oscillators in the MSP430x2xxx processors. For example, used with the MSP430F248, or MSP430F2274, or MSP430G2553. More...

`#include "hal_msp430x2xxx_oscillators.h"`

## Functions
void | dly (uint16_t delay)
int16_t | halCalibrateVlo ()
uint16_t | halMeasureAclkFrequency ()

## Detailed Description

Hardware Abstraction Layer (HAL) toolbox of utilities for configuring the oscillators in the MSP430x2xxx processors. For example, used with the MSP430F248, or MSP430F2274, or MSP430G2553.

This file contains generic utilities for using the oscillators on these processors.

Rev:
  1528

Author:
  dsmith

Date:
  2012-08-30 15:58:08 -0700 (Thu, 30 Aug 2012)

# Support

Please refer to the wiki at www.anaren.com/air-wiki-zigbee for more information. Additional support is available via email at the following addresses:

- Questions on how to use the product: AIR@a.nosp@m.nare.nosp@m.n.com
- Feature requests, comments, and improvements: featu.nosp@m.rere.nosp@m.quest.nosp@m.s@te.nosp@m.slaco.nosp@m.ntro.nosp@m.ls.co.nosp@m.m
- Consulting engagements: sales.nosp@m.@tes.nosp@m.lacon.nosp@m.trol.nosp@m.s.com

# License

Copyright (c) 2012 Tesla Controls. All rights reserved. This Software may only be used with an Anaren A2530E24AZ1, A2530E24CZ1, A2530R24AZ1, or A2530R24CZ1 module. Redistribution and use in source and binary forms, with or without modification, are subject to the Software License Agreement in the file "anaren_eula.txt"

YOU FURTHER ACKNOWLEDGE AND AGREE THAT THE SOFTWARE AND DOCUMENTATION ARE PROVIDED “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL ANAREN MICROWAVE OR TESLA CONTROLS BE LIABLE OR OBLIGATED UNDER CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSE INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.

## Function Documentation

void dly | ( | uint16_t | delay | ) |

See delayMs() in main hal file. Included again here to avoid circular dependencies.

int16_t halCalibrateVlo | ( |  | ) |

    Calibrate VLO. Once this is done, the VLO can be used semi-accurately for timers etc.

Once calibrated, VLO is within ~2% of actual when using a 1% calibrated DCO frequency and temperature and supply voltage remain unchanged.

Returns:
  VLO frequency (number of VLO counts in 1sec), or -1 if out of range

Precondition:
  SMCLK is 4MHz
  MCLK is 8MHz
  ACLK sourced by VLO (BCSCTL3 = LFXT1S_2 in MSP430F2xxx)

Note:
  Calibration is only as good as MCLK source. Obviously, if using the internal DCO (+/- 1%) then this value will only be as good as +/- 1%. YMMV.
  On MSP430F248 or MSP430F22x2 or MSP430F22x4, must use TACCR2. On MSP430F20x2, must use TACCR0. On MSP430G2553, must use CCI0B on CCR0 Check device-specific datasheet to see which module block has ACLK as a compare input. Modify TACCTLx, TACCRx, and CCIS_x accordingly For example, see page 23 of the MSP430F24x datasheet or page 17 of the MSP430F20x2 datasheet, or page 18 of the MSP430F22x4 datasheet.
  If application will require accuracy over change in temperature or supply voltage, recommend calibrating VLO more often.

Postcondition:
  Timer A settings restored to what they were beforehand except for TACCR0 which is reset.

uint16_t halMeasureAclkFrequency | ( |  | ) |

    Measure ACLK clock source frequency using main clock. Ignores ACLK Divide settings (DIVA bits in BCSCTL1)

Returns:
  ACLK frequency (number of ACLK counts in 1sec)

Precondition:
  SMCLK is 4MHz
  MCLK is 8MHz

Note:
  on MSP430F248 or MSP430F22x2 or MSP430F22x4, must use TACCR2. On MSP430F20x2, must use TACCR0. Check device-specific datasheet to see which module block has ACLK as a compare input. For example, see page 23 of the MSP430F24x datasheet or page 17 of the MSP430F20x2 datasheet, or page 18 of the MSP430F22x4 datasheet.

Postcondition:
  Timer A settings changed
  WDT disabled
  ACLK divide by 8 bit cleared