Initialization of TELIT GM862 module realized with MPLAB C18 Microchip, therefore C
The PIC is connected to the GM862 through the UART, as to be able to use the function putrsUSART(); (to make reference to the C18 manual, downloadable from the microchip site).
Once turned on, send the AT command, considering that the GM862 is in autobaude for default, then disable the autobaude, setting the baude-rate that I prefer.
You can also disable the echo, in order to avoid overloading the ram during the answer therefore to have a buffer of smaller reception.
Set calling identification as active, therefore you can see the number who calls.
Enable the extensive presentation of the errors, therefore you can control the type of error through the GM862 Telit manual. Set the sms format (text or pdu), advised to be text otherwise you must make the conversion routine.
Disable the messages not demanded (unsolicited) when you receive a sms (if not use this function obviously).
Enable the SIM Card like device of memorization of the phone book, therefore use the phone book of the SIM Card
//-----------------------------------------------------------------------------------------------------------
// Telit GM862 initialize C18
//------------------------------------------------------------------------------------------------------------
setup_gm862:
gm_POWER_ON(); // turn on the module telit and verify, else reset
// autobaud
lungh = 0; // reset ram pointer
putrsUSART ((const far rom char *)"AT\r"); // AT command test
Delay10KTCYx (50); // response: AT
// set_baud
lungh = 0; //
putrsUSART ((const far rom char *)"AT+IPR=9600\r");// set_baude_rate 300,1200,2400,4800,9600,19200......
Delay10KTCYx (50); // response: OK
// disable_echo
lungh = 0;
putrsUSART ((const far rom char *)"ATE=0\r"); // Disable echo command
Delay10KTCYx (50); // response: OK
// caller_id
lungh = 0;
putrsUSART ((const far rom char *)"AT+CLIP=1\r"); // Set CALLER ID; 1=on
Delay10KTCYx (10); // response: OK
// error_code
lungh = 0;
putrsUSART ((const far rom char *)"AT+CMEE=1\r"); // Enable extended error code ; 1 =numeric
Delay10KTCYx (10); // response: OK
// sms_format
lungh = 0;
putrsUSART ((const far rom char *)"AT+CMGF=1\r"); // SMS format type; 1=text
Delay10KTCYx (10); // response: OK
// unsolecit_ind
lungh = 0;
putrsUSART ((const far rom char *)"AT+CNMI=0,0,0,0,0\r"); // DISABLE New message unsolecited indication +CMTI
Delay10KTCYx (10); // OK
// storage_set
lungh = 0;
putrsUSART ((const far rom char *)"AT+CPBS=\"SM\"\r"); // AT+CPBS="SM" set phonebook normal SIM
Delay10KTCYx (50);
//--------------------------------------------------------------------------------------------------------------
|