This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Problem in GSM modem response handling using interrupt method of LPC2148 UART0

Actually i am getting problem while trying to receive the incoming sms from gsm modem to micro controller

controller-lpc2148
Uart- UART0 //Cpu clock-60 Mhz (using PLL 12Mhz*5=60Mhz)
VPB -15mhz //9600 baud rate ,8 bit data,1 stop bit,no parity
Enabled interrupt-Rx0

Parents
  • Sorry for the last post sir,

    //Once gsm got any sms it will sent to the uC,have to receive that and show it in the 16x2 LCD

    char s1[28], s2[28],DATA0_RECEIVED;//DATA0_RECEIved is flag

    void myUart0_ISR(void)__irq

    {

    long int regVal;

    regVal = U0IIR; // read the current value in U0's Interrupt Register

    if((U0IIR&RDA))

    {

    unsigned char dataa;

    dataa=U0RBR;

    if(dataa!=0x0A)

    {

    s1[count++]=dataa; }

    else

    {

    s1[count++]='\0';

    count=0;

    for(i=0; s1[i]!='\0';i++)

    {

    s2[i]=s1[i];

    }

    s2[i]='\0';

    DATA0_RECEIVED=1;

    }

    VICVectAddr = 0x00; // The ISR has finished!

    } }

    void UART0_INIT() {

    PINSEL0 |= 0x00000005; //p0.15 and p0.7 as GPIO P0.1=RXD P0.0=TXD

    U0LCR=0x83;//data,stop,parity bit as well DLAB=1 befor do calc Bdrte

    U0DLL=97;//15mhz -BDrte

    U0DLM=0;

    //U0FDR=(MULVAL<<4)|DIVADDVAL;//Fraction for Prescale her it is no need

    U0LCR&=~(1<<7);//DLAB=0 before enable uart interrupt as well for U0RBR,U0THR buffers

    U0FCR = 0x01; //clear the buffer

    U0IER=0x1; //Uart Rx itrpt Enable

    VICIntSelect=0x00;//selct as IRQ

    VICVectCntl0=6|(1<<5);//IRqslot enable(5,)interrupt no 4,//slot0 has high and slot 15 has low priority

    VICVectAddr0=(unsigned)myUart0_ISR;

    VICIntEnable=(1<<6);

    }

Reply
  • Sorry for the last post sir,

    //Once gsm got any sms it will sent to the uC,have to receive that and show it in the 16x2 LCD

    char s1[28], s2[28],DATA0_RECEIVED;//DATA0_RECEIved is flag

    void myUart0_ISR(void)__irq

    {

    long int regVal;

    regVal = U0IIR; // read the current value in U0's Interrupt Register

    if((U0IIR&RDA))

    {

    unsigned char dataa;

    dataa=U0RBR;

    if(dataa!=0x0A)

    {

    s1[count++]=dataa; }

    else

    {

    s1[count++]='\0';

    count=0;

    for(i=0; s1[i]!='\0';i++)

    {

    s2[i]=s1[i];

    }

    s2[i]='\0';

    DATA0_RECEIVED=1;

    }

    VICVectAddr = 0x00; // The ISR has finished!

    } }

    void UART0_INIT() {

    PINSEL0 |= 0x00000005; //p0.15 and p0.7 as GPIO P0.1=RXD P0.0=TXD

    U0LCR=0x83;//data,stop,parity bit as well DLAB=1 befor do calc Bdrte

    U0DLL=97;//15mhz -BDrte

    U0DLM=0;

    //U0FDR=(MULVAL<<4)|DIVADDVAL;//Fraction for Prescale her it is no need

    U0LCR&=~(1<<7);//DLAB=0 before enable uart interrupt as well for U0RBR,U0THR buffers

    U0FCR = 0x01; //clear the buffer

    U0IER=0x1; //Uart Rx itrpt Enable

    VICIntSelect=0x00;//selct as IRQ

    VICVectCntl0=6|(1<<5);//IRqslot enable(5,)interrupt no 4,//slot0 has high and slot 15 has low priority

    VICVectAddr0=(unsigned)myUart0_ISR;

    VICIntEnable=(1<<6);

    }

Children