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.

Ultra-Low Pwr UART 9600 Echo ISR, 32kHz ACLK

Other Parts Discussed in Thread: MSP430F149

Dear friends,

Could anyone help with the following?

Iam trying to run at my MSP430F149 a program referred to Ultra-Low Pwr UART 9600 Echo ISR, 32kHz ACLK as presented at the exaples of slac014 zip.file.

Some of the remarks of this examples is:

1) USART RX ISR at high speed used with ultra low power technics.

2) Configure DCO that is used for USART baud rate generation

3) ISR must make sure that DCO clock remains enable for the UART to receive full character

4) TXign TEST

5) RXing test

Regarding the above, i started run program, but this stucked after sentence CALL #SET_DCO which corresponds to a subroutine which Sets DCO to selected frequency based on Delta.

More clearly stucked the time the:

 Test_DCO    bit.w   #CCIFG,&CCTL2           ; Test capture flag
            jz      Test_DCO                ;

when this try to test if capture interrupt occured showing that CAPTURE doesnt occured.

I have made all possible changes to run but nothing. If someone can help me pass this problem, i would greatfull. 

Thanks,

regards Nick.

  •  Do you have a 32kHz crystal? If not, or if it is not oscillating, there is nothing to capture and the capture flag will never set.

  • Hello again,

    Yes i have 32Khz watch crystal and i have made all neccessary actions. Please see below regarding 32KHz:

    SetupBC     bis.b   #DIVA_3,&BCSCTL1        ; ACLK = LFXT1CLK/8

    Also i have used as a referrence the: f_ref       SET     32768  .

    I just made a change on program regarding DCO_SET and seems at least that the interrupt capture is working. I  enable the interrupt by my own including bis.w   #CCIFG,&CCTL2  (SEE BELOW). Cature enabled, is making the test, it is set , after it's reset and start making the adjustements. The problem is that CCR2 has not any content, the comparison is being made and INCDCO proceedure starts, without in the end, DCO to be callibrated.

    I would be gratefull if you could help me.

                              clr.w   R15                     ;       
    Setup_CC2   mov.w   #CM_1+CCIS_1,&CCTL2   ; CAP, ACLK
    Setup_TA       mov.w   #TASSEL_2+MC_2+TACLR,&TACTL   ; SMCLK, ContMode, clr
    Test_DCO    bis.w   #CCIFG,&CCTL2          ; Test capture flag
                            jz      Test_DCO                ;
                            bic.w   #CCIFG,&CCTL2           ; Clear capture flag

    djDCO      mov.w   &CCR2,R14               ; R14 = captured SMCLK
                       sub.w   R15,R14                 ; R14 = capture difference
                     mov.w   &CCR2,R15               ; R15 = captured SMCLK
                    cmp.w   #Delta,R14              ; Delta = SMCLK/(32768/8)
                    jlo     IncDCO                  ;
                    jeq     DoneDCO                 ;
    DecDCO      dec.b   &DCOCTL                 ; Slow DCO with DCO and MOD
                jc      Test_DCO                ; Slower?
                cmp.b   #XT2OFF+DIVA_3,&BCSCTL1 ; Can RSEL.x be decremented?
                jz      DoneDCO                 ; jmp>DCO at slowest setting
                dec.b   &BCSCTL1                ; Decrement RSEL.x
                jmp     Test_DCO                ;
    IncDCO      inc.b   &DCOCTL                 ; Speed DCO with DCO and MOD
                jnc     Test_DCO                ; Faster?
                cmp.b   #XT2OFF+DIVA_3+07h,&BCSCTL1 ; Can RSEL.x be increased?
                jz      DoneDCO                 ; jmp> DCO at fastest setting
                inc.b   &BCSCTL1                ; Increment RSEL.x
                jmp     Test_DCO                ;
    DoneDCO     clr.w   &CCTL2                  ; Stop CCR2
                clr.w   &TACTL                  ; Stop timer_A
                ret                             ; Return from subroutine

**Attention** This is a public forum