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.

Sending AT commands to SIM900 using Tiva tm4c1294xl launchpad.

Other Parts Discussed in Thread: ENERGIA

When I am sending AT commands more 12 characters long to the UART , only 12 character are send to the sim900 module . I used the UART_echo example provided by tiva ware board examples. Please suggest a method to send long strings.

  • Hello Sahan,

    Without a code, to see how the data is being sent it is not possible to know why the issue is occurring.

    Regards
    Amit
  • SahanH said:
    I used the UART_echo example provided by tiva ware board examples. Please suggest a method to send long strings.

    The UARTSend function in the TivaWare uart_echo example uses ROM_UARTCharPutNonBlocking without checking the return status, such that the UARTSend function will silently discard characters once the UART TX FIFO is full (i.e. can cause problem with long strings).

    How does your code send characters from the UART?

  • //Function for getting the respond from SIM900

    /* ================================================== */
    void SIMGet( char *Reply)

    { int i=0;

    while(ROM_UARTCharsAvail(UART7_BASE))
    {
    Reply[i] = ROM_UARTCharGet(UART7_BASE);
    i++;
    }
    // Reply[i] = '\0';
    printf(Reply);
    printf("\n");


    }

    /* ================================================== */


    //Function for sending the AT Command. This function obtain the respond and resend in case of an error.

    uint8_t ATCommand( char *_Command, char *ExpAnswer, char *ExpAnswer1, uint32_t _length )

    {

    uint32_t length=0;
    char Command[30]; // In case of an ERROR message can send the command back.
    memset(Command , '\0' , 30);
    int i=0;
    while(*_Command != '\t')
    {
    Command[i] = *_Command;
    i++;
    _Command++;
    }
    // Command[i] = '\0';
    ReSend:
    //Delayms(4000);

    length = _length;
    char Reply[30];
    memset(Reply, '\0' , 30);
    int k=0;


    while((length--))
    {
    //
    // Write the next character to the UART.
    //
    ROM_UARTCharPut(UART7_BASE, Command[k]);
    k++;

    }


    Delayms(3000);


    SIMGet(Reply);

    // printf(Reply); // Printing to the console
    // printf("\n");



    // if(strncmp(Reply, ExpAnswer1 ,4) == 0)
    // {
    // goto ReSend;
    // }

    return 0;
    }

    // Main function

    ATCommand("AT\r\n\t" , "OK\n\r" ,"ERROR\n\r" , 4); //For this command I get the reply as OK
    Delayms(5000);

    ATCommand("AT+CSTT=\"ebb\"\r\n\t" ,"OK\n\r", "ERROR\n\r" ,15 ); // This command not sending \n , so no reply
    Delayms(5000);

    ATCommand("AT+CIICR\n\r","OK\n\r\t", "ERROR\n\r" , 10);
    Delayms(5000);


    /* When I send this final command it sends me the SIM900 ERROR respond which I have no issue regarding that but the problem is only
    "AT+CIICR ERRO" is displayed on the console.
  • Hi SahanH

    I am working in the same project, this do you worked? You worked in Energia or in CCS?

    Do you could show me the code please?

    Regards
    Matias
  • Hello SahanH, I tried to connect tivaC 123g lauchpad with module sim 900A, but it does not worked, could you give me the code.
    Thank you so much.
  • You may note that SahanH's post was more than 13 months past - it is not assured he's still monitoring this thread...   Poster Matias sought his/her assistance - no response was received.

    Both Amit & Chester advised herein - you'd do well to follow their guidance - would you not?