PDA

View Full Version : Interfacing PIC 16F628A to a modem



TeleStudent
- 30th September 2011, 06:10
Hello everybody, i would like some help in doing my project and it is basically a PIC ( 16F628A) interfaced to a GSM modem (WAVECOM FASTRACK M1306B ) where i will use the AT commands to send (only) a simple SMS to a phone number.

the problem is that i can not seem to get the AT commands to be sent from the PIC to the GSM modem and in order to identify the problem i did the following steps:

1- Check the connections and voltage drop in every important pin and everything turned out fine.

2- Test the GSM modem by connecting it the PC using hyperTerminal and i was able to send SMS to my phone.

3- After programming my PIC to send the AT commands i connected my circuit to my computer ( PIC 16F628A + MAX232) using hyperTerminal and it showed everything as expected.

and below is the schematic and the code of my project.

NOTE:my GSM modem has a VGA port so the person that provided me the GSM modem gave me a cable that converts the VGA connection to a RS232 DB 9 (Female) connection.

(I am using MikroC Compiler )




void main(){CMCON = 7; //Disable Comparators
UART1_init(9600); //Initiate baud rate to 9600
Delay_ms(100); //Delay
UART1_Write_Text("AT+CMGF=1"); //Write "AT+CMGF=1"
UART1_Write(0x0D); //<cr> mean (ENTER)
Delay_ms(100); //Delay
UART1_Write_Text("AT+CMGS="); //Write "AT+CMGS="
UART1_Write(0x22); //Write (")
UART1_Write_Text("xxxxxxxxxxxx"); //Number SMS send to
UART1_Write(0x22); //Write (")
UART1_Write(0x0D); //<cr> mean (ENTER)
Delay_ms(100); //Delay
UART1_Write_Text("hi"); //Words to be sent
UART1_Write(26); //Write "ctrl+z"
Delay_ms(100); //Delay}
</cr></cr>

mackrackit
- 30th September 2011, 07:42
(I am using MikroC Compiler )

This forum is for Pic Basic. You will have better luck asking questions about MikroC on a MikroC forum.

TeleStudent
- 30th September 2011, 11:24
So sorry ....this is really embarrassing...i guess i rushed into it without taking good look at the website's name and i guess it is because there are a lot of topics regarding GSM modem interfacing... :)