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.

Need a simple CC430 Radio Interrupt register.



Tx is sending small packets at about 50 Hz.

Rx acts on this data from LPM0, but the necessary loop action is quite slow (MIDI - only 31,250 Hz). Each new Rx data needs to exit this loop. 

So I'd like to break out of this slow routine when a new packet is received. Thinking a While loop (testing a flag or int) would be great in each loop.

It's like driving and only opening your eyes for a moment, then adjusting your wheel. So when you open your eyes, you have a new target and need immediate correction.

Thanks,

John 

  • Hi John,

    The existing Appnote includes detailed instructions on using an interrupt to periodically wake the radio and check for incoming packets. It should be exactly what you need including sample code. It explains the Wake-On-Radio(WOR) functionality that enables the radio to periodically wake up from SLEEP mode and listen for incoming packets with minimal CPU interaction. Please take a look at the program flow and code organization also.

    www.ti.com.cn/.../slaa459a.pdf

    Sincerely,
    Sean
  • Sean,

    Maybe I wasn't clear or I'm approaching this wrong from the start.

    My MPU needs to stay on mostly as it waits for the next packet because it's busy processing data. The task on each new packet of data received can take longer than the period of the transmitter. I transmit (one direction only) 50 Packets per second. On the Rx side, in 1/50th of a second I am typically in a loop and need to break out of that when the next packet arrives (otherwise I'm working on old data). This is real-time control of MIDI - very slow!

    Hence (I think) a radio interrupt needs to be monitored during (while) this other time consuming process, then cut it short when new data arrives from the transmitter. For now, I just limit the MPU task loops, but now I'm either getting somewhat old data or missing opportunity to continue without new data until it arrives.

    I was hoping there was an expression I could use in a while loop (just like when you send data and wait for a flag for the next byte to send in the UART). There must be a bit in the RF Interrupts... but which one as there are like 2 bytes worth of flags just in the RF IFG's.

    Thanks, John

  • Hi John,

    I would recommend using a timer interrupt to sense an incoming input on the receiver end. For example,

      // Enable timer interrupts to see if input is visible
      TA1CTL = TASSEL__SMCLK + MC_2 + TACLR;
      TA1CCTL0 = CM_3 + CCIS_1 + CAP + CCIE;
    

    then the ISR can process the newly received data as needed.

    Further RF code examples can be found below:

    http://www.ti.com/mcu/docs/litabsmultiplefilelist.tsp?sectionId=96&tabId=1502&literatureNumber=slaa465c&docCategoryId=1&familyId=3314

    Sincerely,

    Sean

  • Sean,

    This sounds like a polling of the radio status based upon the set timer. It would be OK, except I've got several timers used for something else (not sure how many I have and not familiar with that part of the code).

    This is different from testing the status of the radio within a loop which is what I believe is needed (or set a flag in the Rx interrupt that's used to check each loop and break on a change in status). An example I use on the Tx side with my UART is this line:

    while (!(UCA0IFG&UCTXIFG));

    So I was looking for a test for new radio data within the loop ;)

    Thanks,

    21

**Attention** This is a public forum