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.

USI interrupt flag

Hello, 

i am trying to use serial communication (SPI) in my project. 

what i have noticed is that for some reason USIIFG i.e. interrupt flag is by default set which is causing unnecessary transfer of control to USI Interrupt routine.

I tried to clear the flag by giving the instruction

USICTL0 = ~USIIFG;

but this is not working.(eventhough USIIFGCC=1)

Any suggestions on how to clear the flag..?

  • Hi,

    i think there is a mistake in the code. You should do:

    USICTL1 &= ~USIIFG;

    as far as i can see in the users guide, USIIFG is part of the USICTL1 register instead of USICLT1. Without the and sign, you will also probably make other failure since you will not only set the bit, but also set the other bits which previously reset as 0.

  • hello leo,

    yup, that was a typing error..i had written the same instruction you have mentioned only..but that doesn't seem to work..

    I am also curious as to why the flag is by set by default..

    thanks.!

**Attention** This is a public forum