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 with interrupt handler....

After sending some data by the ROM_UARTCharPutNonBlocking() function to the UART, agian the same data is displayed  in the interrupt handler... WHY?.....please give me a replay if u know.I am big confusion with this ...

clear cut:

*when i send the command AT\r\n to the gsm modem it has to give the reply "OK" this  ok i kept in a buffer..after that i compared this buffer with my predefined buffer....here the problem is after sending the the command AT  generally interrupt has raised...at that time in place of"ok" again the "AT" will be stores in side the buffer in the handler.....

 

ex:

unsigned char ok[]="OK\r\n";

 while(1)

{

do

   {

         datasend("AT\r\n");

         SysCtlDelay(1000);

          SysCtlDelay(1000);

         SysCtlDelay(1000);

   }while((strcmp(ok,n))!=0);

void datasend(unsigned char *p)

{

ROM_UARTCharPutNonBlocking(UART0_BASE, *p);

*p++;

}

void
UART0IntHandler(void)
{

uint32_t ui32Status;

 ui32Status = ROM_UARTIntStatus(UART0_BASE, true);

ROM_UARTIntClear(UART0_BASE, ui32Status);
ROM_UARTIntDisable(UART0_BASE, UART_INT_RX | UART_INT_RT);

while(ROM_UARTCharsAvail(UART0_BASE))
{

m[count]=ROM_UARTCharGetNonBlocking(UART0_BASE);

n[count]= m[count];

ROM_UARTCharPutNonBlocking(UART0_BASE,n[count]);

*after this function "OK" has to print...but in place of "ok" "AT" is printing......y so? please suggest me


count++;
if(count==6)
count=0;

}

ROM_UARTIntClear(UART0_BASE, ui32Status);

}

                                                                                                             

  • Hello Radhika

    I see quite a fundamental issue with the code. First of all the count is not being reset before the while loop is executed, it is not a good coding practice.

    Secondly, did you inspect the variables m, n (why do you need two variables) for the content?

    Regards

    Amit