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.

Problem in clearing ENC bit

Other Parts Discussed in Thread: MSP430FG4618

 

Hello TI E2E Community,

           I am using MSP430FG4618 for voltage and current sensing. I am using CCSV4 for coding. I used these instructions below to clear the ENC bit in the ADC12CTL0 

register but it shows error at this line. Please suggest any documents on programming in MSP430, I am new to it.

 

1)  ADC12CTL0 &= ~ENC;

2)  ADC12CTL0_bit.ENC = 0;

3)  ADC12CTL0 ^= ENC;

 

Thanks,

Mrunal

  • Hi Mrunal,

    since you're using CCS the 1) one is the right instruction for clearing your bit (bitwise AND --> resulting in BIC instruction).

    2) you need to have the corresponding structure defined to make this work

    3) toggles ENC ( bitwise XOR)

    Rgds
    aBUGSworstnightmare 

  • mrunal kulkarni said:
    I used these instructions below to clear the ENC bit in the ADC12CTL0 register but it shows error at this line

    It would be really helpful to see which error the compiler is giving. Without this, you description is as enlightning as 'My program doesn't work. What is wrong?' without any further information.

    Best guess is that the flag is not named 'ENC' but rather 'ADC12ENC' or something like that. Or you forgot to include the (correct) header file with the register definitions. (but I think you'd see more errors then).

     

**Attention** This is a public forum