Quantcast
Channel: MSP low-power microcontroller forum - Recent Threads
Viewing all articles
Browse latest Browse all 22233

MSP430F5324: Switching between 1.5MHz and 2.0MHz on MCLK

$
0
0

Part Number:MSP430F5324

Hello there,

We are currently working with the following code on the MSP430F5324 to set up the MCLK and then change the frequency from 1.5MHz to 2.0MHz and back and fourth.

bis.w   #SCG0,SR                ; Disable the FLL control loop

            clr.w   &UCSCTL0                ; Set lowest possible DCOx, MODx

            mov.w   #DCORSEL_3,&UCSCTL1     ; 4.9 MHz nominal DCO

            mov.w   #FLLD_1 + 45,&UCSCTL2   ; Set DCO Multiplier for 2.00MHz

                                            ; (N + 1) * FLLRef = Fdco

                                            ; (45 + 1) * 38K = 2.00MHz

                                            ; Set FLL Div = fDCOCLK/2

            bic.w   #SCG0,SR                ; Enable the FLL control loop

            nop

            nop

            nop

            nop

 

            nop

            mov.w   #0x63AF,R15

delay_L3    add.w   #0xFFFF,R15

            jc      delay_L3

 

            ; Loop until XT1,XT2 & DCO stabilizes

do_while4  

            bic.w   #XT2OFFG + XT1LFOFFG  + DCOFFG,&UCSCTL7

                                            ; Clear XT2,XT1,DCO fault flags

            bic.w   #OFIFG,&SFRIFG1         ; Clear fault flags

            bit.w   #OFIFG,&SFRIFG1         ; Test oscillator fault flag

            jc      do_while4

Our question is whether or not we can just change the value '45' in the line bolded or if it is necessary to rerun the whole code loop again in order to accomplish this type of switching? Can you comment?

Thanks so much for your help!

-Amanda


Viewing all articles
Browse latest Browse all 22233

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>