GE865 and PIC C18 Compiler putrsUSART problem

4 thoughts on “GE865 and PIC C18 Compiler putrsUSART problem

  1. Hello !


    I’m developing with GE865-QUAD and PIC18F26K20 (C18 COMPILER).


    I want to make a function to SEND SMS, so i’ve tried:


    char SendSMS(char *destination_number, char *message_text)
        putrsUSART ("AT+CMGS=");                 // AT CMD
        putrsUSART (destination_number);    // Destination Number
        putrsUSART ("r");                                    // Send AT CMD + Destination Number Line

        putrsUSART(text);                            // Send Text
        WriteUSART(0x1A);                         // CTRL+Z (Finish Message)


    Then i call it as SendSMS("1234567890", "test")


    But it’s not working, when i send the "AT+CMGS=""DESTINATION NUMBER" , i get an ERROR response from GE865 after the putrsUSART ("r");


    If i make

    putrsUSART ("AT+CMGS=1234567890");

    putrsUSART ("r");


    then it WORKS. The error only ocurrs when i send the AT CMD and phone number on different putrsUSART calls.


    Is there a workaound to this ?


    Is there even a reasonable explanation for this ? As the putrsUSART doesn’t send any control character like r ?


    Thank’s !

    1. Nevermind,


      The problem with the putrsUSART is that it sends a NULL character after the last byte of the string.


      The workaround is to build another function to send the string without the NULL character.

      1. Take care that C103/TXD is serial data input into module and C104/RXD is serial data output to DTE.

        Quote from Hardware User Guide:


        According to V.24, RX/TX signal names are referred to the application side, therefore
        on the GE864 side these signal are on the opposite direction: TXD on the application
        side will be connected to the receive line (here named TXD/ rx_uart ) of the  GE864
        serial port and vice versa for RX.