Logo
MSP430IEC60730SWPackage
Clock_test_api

Functions

uint8_t IEC60730_OSCILLATOR_TEST_testOsc ()
 

Detailed Description

Function Documentation

uint8_t IEC60730_OSCILLATOR_TEST_testOsc ( void  )

Tests MCLK for proper operation at user defined frequency.

The following function verifies that MCLK is oscillating at the frequency specified by the MAIN_CLOCK_FREQUENCY macro. The user must define the allowed +/- percentage frequency drift using the macro PERCENT_FREQUENCY_DRIFT in "IEC60730_user_config.h". The test is passed if freqCounter is between FREQUENCY_COUNT_MAX and FREQUENCY_COUNT_MIN. TAx must be source by ACLK with a high precision clock source. To increase accuracy of oscillator measurement, it is suggested to source LF or XT1 with a 32768 Hz crystal. If the application uses a different frequency for LF or XT1, the LFXT1_FREQUENCY macro in "IEC60730_user_config.h" file must be updated with correct frequency.

NOTE: The test requires TAx to be source by ACLK, and configured in Up mode. Also, TAIE will be disable. Therefore, if the application requires TAIE to be enable, the user must set TAIE upon test completion.

Modified registers are TAxCCRO, TAxCCTL0, and TAxCTL

Returns
SIG_CLOCK_TEST .- If test is passed. TEST_FAILED. - if ADC test fail and JUMP_TO_FAILSAFE is disabled in "IEC60730_user_config.h".