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.

Reader Demo TRF7970A

Other Parts Discussed in Thread: TRF7970A, MSP430G2553

Hi everyone,

What does this line do?

while((IRQ_PORT & IRQ_PIN) == IRQ_PIN);

  • Hello Neil,

    This is checking to see if the IRQ pin on the TRF7970A has been fired. The code you post is part of a Do-While loop so it will execute for as long as the IRQ pin remains high. The Trf797xISR function will handle the TRF7970A request as long as the part is correctly configured, and when it does so this will cause the IRQ pin to de-assert and the Do-While loop to exit.
  • Thank you Ralph! So the IRQ will occur when the line goes high.

    Ralph, just below the do while loop there is this line:

    __bic_SR_register_on_exit(LPM0_bits); <---- what is this? where is this found in the MSP430?

    Thank you.
  • Hello Neil,

    This is an MSP430 directive which will pull the device out of the Low Power Mode (LPM) specified. After a quick review though, it looks like that line of code actually isn't really needed as we don't enter any LPM's with the current example, so all it really is doing is using up a couple of clock cycles unnecessarily.

    You can find out more details about LPM's in the MSP430G2553 datasheet.

  • Thank Ralph. It's kind of difficult to translate from one processor to the other, but slowly and surely I'll make it happen.
    Thank you for your excellent support.