Discussion in "Embedded GSM Development" started by    roshan    Dec 17, 2008.
Wed Dec 17 2008, 04:02 pm
#1
Hi Friend, I have completed message sending part using ARM7 and SIMCOM GSM/GPRS m22 Modem, also able to receive message using UART Interrupt.
My problem is that my received response and data is not getting stored in any buffer variable.
Please if anybody can help me out....thanx in advance....
Thu Dec 18 2008, 03:01 am
#2
Please paste your program here for checking..
Thu Dec 18 2008, 01:49 pm
#3
Hi Ajay, Thanx 4 ur quick, response...as my code is too large i am sending youn in short only ISR and main......please go through it.....also i am using 2 serial port
COM1 is connected between computer and LPC2148 to see response @ terminal
COM2 is connected between GSM modem and LPC2148
In short I am using both the COM Port of ARM7(LPC2148)

//=================================================
// UART1 ISR 
//=================================================
void uart1ISR (void) __attribute__ ((interrupt ("IRQ")))
{
	uint32 u32Temp ,tempcounter=0;

	while((u32Temp = U1IIR & 0x0f) != UART1_NO_INTERRUPT)
	{
		if (u32Temp == UART1_RLS_INTERRUPT)
		{
			// read U0LSR to reset the interrupt
			u32Temp = U1LSR ;
		}
		else if ((u32Temp == UART1_RDA_INTERRUPT) ||     (u32Temp == UART1_CTI_INTERRUPT))
		{
			while(U1LSR & 0x01)
			{
				UART_u8SerBuffer[UART_u32SerWrPtr] = U1RBR ;
				//==================================================
		        ////////////putchar1(UART_u8SerBuffer[UART_u32SerWrPtr]);
		        //putchar0(UART_u8SerBuffer[UART_u32SerWrPtr]);
		        mybuffer[tempcounter]=UART_u8SerBuffer[UART_u32SerWrPtr];
		        
		        UART_u32SerWrPtr++ ;
		        tempcounter++;
		        mybuffer[tempcounter]='\0';
		        
				
				//UART_u8SerBuffer[UART_u32SerWrPtr] = '\0';
				
		        //==================================================
				
				u32Temp = MAX_BUF_LEN ;
				if (UART_u32SerWrPtr >
= u32Temp)
					UART_u32SerWrPtr = 0 ;
			}
		}
		else if (u32Temp == UART1_THRE_INTERRUPT) 
		{
			if(U1LSR & 0x20)	// is this condition necessary???
			{
				UART_u32MyTi = 1 ;
			}
		}
	}

	ISR_DONE();
}

int main (void)
{   
    /*-------------UART0 Interrupt not required-----------*/
    /*                                                                               */
   /*   setupISR(1,UART0_INT,uart0ISR,IRQ_SEL);     */
    /*                                                                               */
    /*-----------------------------------------------------------*/
      setupISR(0,UART1_INT,uart1ISR,IRQ_SEL) ;    
      All_UART_Init();
      GSM_Init();
      puts1("ATE0");                //Echo off
      putchar1(CR);
      puts1("AT+CMGF=0");   //set echo off
      putchar1(CR);             
     
      puts0(UART_u8SerBuffer);  //read response and set buffer counter zero
      UART_u32SerWrPtr=0;
    
      puts1("AT+CMGR=1");        //read message at index = 1
      putchar1(CR);
     
      puts0(UART_u8SerBuffer);  //display message
      UART_u32SerWrPtr=0;
   
      return 0;
}


[ Edited Fri Dec 19 2008, 02:32 am ]
Fri Dec 19 2008, 10:28 pm
#4
okay...i have solved it....thanks.

Get Social

Information

Powered by e107 Forum System

Downloads

Comments

MnoioCoove
Tue May 21 2024, 02:06 am
PedroDug
Sun May 19 2024, 05:39 pm
JewelAmuck
Sun May 19 2024, 03:06 pm
Minniemus
Sun May 19 2024, 07:39 am
Andyhet
Sat May 18 2024, 07:28 am
BrettTibre
Fri May 17 2024, 06:14 pm
Gordonfax
Fri May 17 2024, 10:28 am
Davidspils
Fri May 17 2024, 10:19 am