4 thoughts on “GE865 and PIC C18 Compiler putrsUSART problem”
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 !
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.
Hello.
I need help.
as
I can connect to gc864 16f8440 Packed connected to USART This is my scheme.
thanks
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:
*NOTE: 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.
We use cookies to enhance your browsing experience and help us improve our websites. To improve our website, we carefully select third parties that use cookies to allow us to serve specific content and achieve the purposes set out in our cookie policy. For more information on how to make adjustments through your browser to the cookies being used on your device, please click Find Out More link. By closing this banner or continuing to browse our website, you agree to our use of such cookies. FIND OUT MORE
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 !
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.
Hello.
I need help.
as
I can connect to gc864 16f8440 Packed connected to USART
This is my scheme.
thanks
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: