This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

msp430fr4133: Clock configuration

Part Number: MSP430FR4133
Other Parts Discussed in Thread: MSP430FR4133, MSP430G2553

i have tried various codes to configure the clock for msp430fr4133 as i only know how to do it in msp430g2553. Can you guide me on this.

   //------------------- Configure the Clocks -------------------//
   // Set DCO Clock = 1MHz                                       //

   if (CALBC1_1MHZ==0xFF || CALDCO_1MHZ==0xFF)   // If calibration constant erased
     
       while(1);            // do not load, trap CPU!!
   
 BCSCTL1 = CALBC1_8MHZ;   // Set range
 DCOCTL  = CALDCO_8MHZ;   // Set DCO step + modulation

  • See the msp430fr413x_CS_* examples in the example code package.
  • Hi,

    Can you please give some details what you exactly want to achieve?
    Which clock do you want to configure?
    Are you using external crystal?
    What is your target frequency?

    best regards
    Lukas
  • if i use the above file suggested it gives me an error in IAR software for some reason regarding driverlib I'm unable to figure that out atm.
  • heres my code
    /**************************************************
    * Project Code
    *
    * Copyright 2016 PPS
    *
    * Arooj Shabbir
    **************************************************/

    //Clock is 16MHz
    //One cycle is 62.5ns

    #include <msp430.h>
    #include <driverlib.h>
    #include "msp430fr4133.h"

    void delay(int j)
    {
    int i;
    for(j=0;j<10;j++)
    for(i=0;i<0xFFFF;i++);
    }

    float measure_distance(void)
    {
    //Pin 1.4 is used for sensor control.
    P1SEL0 |= BIT4;
    P1DIR |= BIT4;
    //Generate 10us pulse to start measurement
    P1OUT |= BIT4;
    __delay_cycles(160);
    P1OUT &= BIT4;

    }

    //Motor controller is attached to pin 1.2
    //First floor 3cm
    //Second floor 13cm
    //Third floor 23cm

    void main(void)
    {
    int floor_no;
    int reached_floor=0;
    WDTCTL = WDTPW + WDTHOLD; //Stop the WDT

    //------------------- Configure the Clocks -------------------//
    // Set DCO Clock = 1MHz //
    // if (CALBC1_1MHZ==0xFF || CALDCO_1MHZ==0xFF) // If calibration constant erased
    //
    // while(1); // do not load, trap CPU!!
    //
    //// BCSCTL1 = CALBC1_8MHZ; // Set range
    // DCOCTL = CALDCO_8MHZ; // Set DCO step + modulation


    //PWM output
    P1SEL0 |= GPIO_PIN7; // connect to timer
    P1DIR |= GPIO_PIN7; // set as input



    //Buttons to call elevator
    P1SEL0 &= BIT0;
    P1SEL0 &= BIT1;
    P1SEL0 &= BIT3;

    P1DIR &= BIT0; //First floor
    P1DIR &= BIT1; //Second floor
    P1DIR &= BIT3; //Third floor


    TA0CCR0 |= 200 - 1;
    TA0CCTL1 |= OUTMOD_7;
    TA0CCR1 |= 100;
    TA0CTL |= TASSEL_2 + MC_1;

    while(1)
    {
    //Figure out to which floor we will be going
    if ((P1IN&BIT0)==1)
    {
    floor_no=1;
    }
    else if((P1IN&BIT1)==1)
    {
    floor_no=2;
    }
    else if ((P1IN&BIT3)==1)
    {
    floor_no=3;
    }
    }

    }

    I'm using h-bridge to drive 2 dc mototrs using PWM.

**Attention** This is a public forum