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 help to understand a ISR problem

Other Parts Discussed in Thread: SIMPLICITI, CC2500

I am trying to write a simple receiver application for a device using simpliciti RFI and BSP sub-layer. I am using CC2500 and MSP4302618 and IAR embedded workbench for this purpose. The application scenario is that, the master  state mahine is running in a timer A continous mode, where it is transmitting a 64 byte packet at every 100 ms. The receiver which is always on and not running in timer mode but in RX ISR. For the receive purpose i am working on  Mrfi_SyncPinRxIsr() and its macro call MRFI_RxCompleteISR() which i am also calling from main and i have put LED toggle in it and my routines to store the packet in locl buffer. The MRFI_RXCompleteISR() would blink an LED when it is called from Mrfi_SyncPinISR. Currently i am encountring a problem that my receiver is unable do so  if i would try to run my system without any  infinite loop (while (1) oder for(;;).   In case if infinite loop usage, my system state machine can work and i can receive packet. , otherwise it is unable to detect anything. 

My concern is that why my system is unable to detect an interrupt in nomral mode?

Why it can only work in case of infinte loop?


extern USIGN8 RX_TEST;
extern USIGN8 RX_Receive_Test;

VOID main (VOID)

{

BSP_Init();

MRFI_Init();

Set_System_into_RX();

_Eint();

if(RX_TEST==1) // flag set in sync pin ISR if the receive packet bytes are      corrupted
{
  perform function a();
  flush RX_Fifo();
  set SYNC pin low();
  blink LED1();
  RX_Test=0;  // set the global variable again to 0;
 

}
else if (RX_Receive_Test ==1)// flag set in SYNC pin ISR if the packet is complete
{
  perform function b();
  dispatch_frame_into_another_buffer();
  flush RX_Fifo();
  blink LED2();
  RX_Receive_Test=0;
}

But if i ll put this whole code into a while(1), infinte loop i ll see my system working and LED 1 or 2 blinking, further i can stop debugging and verify the contents of the packet. could anyone please guide, do we need some kind of loops to run the system into an interrupt.

 extern USIGN8 RX_TEST;
extern USIGN8 RX_Receive_Test;

VOID main (VOID)

{

BSP_Init();

MRFI_Init();

Set_System_into_RX();

_Eint();
while(1)
{
if(RX_TEST==1) // flag set in sync pin ISR if the receive packet bytes are      corrupted
{
  perform function a();
  flush RX_Fifo();
  set SYNC pin low();
  blink LED1();
  RX_Test=0;  // set the global variable again to 0;
 

 

}
else if (RX_Receive_Test ==1)// flag set in SYNC pin ISR if the packet is complete
{
  perform function b();
  dispatch_frame_into_another_buffer(pointer_to_frame);
  flush RX_Fifo();
  blink LED2();
  RX_Receive_Test=0;

}

}

 

 

Best Regards