usart sending at commands to a cellular number

General discussion on mikroC.
Post Reply
Author
Message
jay_dot1989
Posts: 1
Joined: 29 Dec 2010 15:45

usart sending at commands to a cellular number

#1 Post by jay_dot1989 » 29 Dec 2010 16:21

hi im very new in using mikro C.. just want to ask for help.. i have problems with my current project right now which entails sending at commands to a cellular number..i am using pic16f877a as the microcontroller.. i have my sample program here, please can anyone try to correct it.. tnx..




void main() {

USART_init(9600);

Usart_Write('A');

Usart_Write('T');

Usart_Write('\r');
Delay_ms(1000);
Usart_Write('A');

Usart_Write('T');

Usart_Write('+');

Usart_Write('C');

Usart_Write('M');

Usart_Write('G');

Usart_Write('F');

Usart_Write('=');

Usart_Write('1');

Usart_Write('\r');
Delay_ms(1000);

while(1){


Usart_Write('A');

Usart_Write('T');
Usart_Write('+');
Usart_Write('C');
Usart_Write('M');
Usart_Write('G');
Usart_Write('S');
Usart_Write('=');
Usart_Write('"');
Usart_Write('0');
Usart_Write('9');
Usart_Write('2');
Usart_Write('2');
Usart_Write('2');
Usart_Write('7');
Usart_Write('3');
Usart_Write('5');
Usart_Write('9');
Usart_Write('6');
Usart_Write('8');
Usart_Write('"');
Usart_Write('\r');
Delay_ms(1000);
Usart_Write('H');
Usart_Write('I');
Usart_Write(0X1A);

// Usart_Write('\r');
//Delay_ms(1000);






}


}

Sobrietytest
Posts: 619
Joined: 05 Jul 2008 06:05
Location: Thailand

Re: usart sending at commands to a cellular number

#2 Post by Sobrietytest » 02 Jan 2011 11:46

What is the problem?

At a guess, most GSM modules require a Carriage Return AND a Line Feed to confirm the code, i.e...

Usart_Write("\r");
Usart_Write("\n");

Post Reply

Return to “mikroC General”