Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

MikroC help+ send AT commands to phone

Status
Not open for further replies.

amila133

Member level 4
Joined
Oct 13, 2009
Messages
72
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,288
Location
Sri Lanka
Activity points
1,746
Hi,
If u have pls send me some code example of MikroC to send AT commnds to the phone via USART

Thanks...
 

Insufficient information. What controller do you use?

Nandhu
 

    amila133

    Points: 2
    Helpful Answer Positive Rating
Hi,
pls tell me how shold I send AT commands(as ASCII) to mobile phone via RS 232 protocol.
If u have pls give me MikroC code example for that.

Thanks.....
 

just send "AT" via UART to Mobile,it will reply u "OK" if everything is ok..

MikroC might be having in-built function to send string via UART.. for example if the function available is something like printf() then

Code:
printf("AT\r\n");         //make sure carriage return is used..

it will reply "OK"... use some functions to get this... mostly u don't need to monitor this...

sending ASCII value is nothing but sending as character

if u still have doubts.. reply with UART functions available in MikroC.. i can help u further..
 

Here are some code I done

Code:
int i=0;
int j=0;


void main(){


    

     const unsigned char command1[3]="AT";
     const unsigned char dial[15]="ATD0716530115;";
      TRISB=0x00;
     Usart_Init(9600);
     PORTB=0x01;
     Delay_ms(2000);
    while(1){
    PORTB=0x00;
     for(i=0;i<3;i++)
     {
     if(command1[i]=='\0') break;
     Usart_Write(command1[i]);
     Delay_ms(100);
     }
     Usart_Write(0x0D);

     Delay_ms(5000);
     for(j=0;j<15;j++)
     {

     Usart_Write(dial[j]);
     Delay_ms(100);
     }
     Usart_Write(0x0D);
     PORTB=0x01;
     Delay_ms(1000);


     }
}


Although I was successful in dialing a phone using above program Still I was unable to send SMS using PDU format. If any one can help me please reply.

Thank You
 
  • Like
Reactions: tofigg

    tofigg

    Points: 2
    Helpful Answer Positive Rating
amila133

thank you it was useful.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top