user5939530
user5939530

Reputation: 51

Measuring clock frequency on pin on MSP430

Using embedded programming.

working on msp430F6779 and need to check frequency of DCO(if is 25MHz).

Idea was to pull frequency on I/O pin and measure frequency with oscilloscope.

In the datasheet there is nothing written about this opportunity.

The question is how to get frequency on pin?

Config of DCO

// FLL reference
 UCSCTL3 |= SELREF_2;       // REFO - 32 kHz

// initialize DCO - 25 MHz
__bis_SR_register(SCG0);    // Disable the FLL loop control
UCSCTL0 |= 0x0000;          // select lowest one
UCSCTL1 = DCORSEL_5;        // range suitable for 25 MHz operation, see datasheet MSP430F677x page 68
UCSCTL2 = FLLD_1 + 762;     // Set DCO Multiplier for 25 MHz
                            // (N + 1) * FLLRef = Fdco
                            // (761 + 1) * 32768 = 25MHz
                            // Set FLL Div = fDCOCLK/1
 __bic_SR_register(SCG0);   // Enable the FLL control loop

Upvotes: 1

Views: 1045

Answers (1)

CL.
CL.

Reputation: 180210

You can output clock signals (ACLK, MCLK, SMCLK) on a pin.

The DCO is a clock source.

Configure some clock signal to be sourced from the DCO (with the SELA/SELS/SELM fields in UCSCTL4), and output that.

Upvotes: 1

Related Questions