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.

how the send "atd0498xxxxxxx" code from pic to GSM

Status
Not open for further replies.

memox

Newbie level 6
Joined
Mar 6, 2005
Messages
11
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,374
gsm+pic+at+command+ccs

Hi;
i want to send at command my gsm mobile with pic 16f628.
For Example;
i maked test below code with hyper terminal. Everything ok.
------------------
at<Press Enter>
OK
atd0498xxxxxxx<Press Enter>

------------------
it is ok who maked with the example.
NOW.
i want to load this code to pic16f628.
first pic c sample code .
thanks
 

how to send sms+pic+modem

Hi

Use the following :

const unsigned char TEST ="atd0498xxxxxxx\x10\x13\0";
while (TEST*)
putchar (*TEST++);


All the best

Bobi
 

gsm pic

hi. try this if you use CCS compiler:
#include <16F628.h>
#fuses NOWDT,HS, PUT, NOPROTECT, NOBROWNOUT, MCLR, NOLVP, NOCPD
#use delay(clock=20000000)
#use rs232(baud=19200,parity=N,xmit=PIN_A3,rcv=PIN_A2,bits=8)

//RS232 RX-pin A2, TX-pin A3

int16 wait_char(void) // Return 0xFFFF-timeout, 0x00 to 0xFF received char
{
long timeout;

timeout=0;
while(!kbhit()&&(++timeout<50000)) // 1/2 second
delay_us(10);
if(kbhit())
{
return(getc());
}
else
{
return(0xFFFF);

}
}

int8 wait_ok(void) // return 0-ok, 1-timeout, 2-not "OK\r"
{
long timeout;
int8 c1,c2,c3;

c1=wait_char();
if (c1==0xFFFF)
{
return(2);
}
c2=wait_char();
if (c1==0xFFFF)
{
return(2);
}
c3=wait_char();
if (c1==0xFFFF)
{
return(2);
}

if ((c1=='O') && (c1=='K') && (c1==0x13))
{
return(0);
}
else
{
return(1);
}
}

void main()
{

setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1);
setup_timer_1(T1_DISABLED);
setup_timer_2(T2_DISABLED,0,1);
setup_comparator(NC_NC_NC_NC);
setup_vref(FALSE);

printf("at\r");
if (wait_ok()==0)
{
printf("atd0498xxxxxxx\r"); // may neeed ";" after number and before "\r"
}
}

Best Regards.
 

gsm modem pic codes

hi

i'm doing the same thing but in assembler

What's the easier way: assembler or C?

thanks
 

pic send at commands

Hi. Easier way is C(CCS C cmpiler).

Best Regards.
 

ccs compiler pic+gsm codes

petarpav said:
Hi. Easier way is C(CCS C cmpiler).

Best Regards.

I hav a question in your code, how can c1 will have the same single content at the same time?

Code:
if ((c1=='O') && (c1=='K') && (c1==0x13))

Added after 6 minutes:

bobcat1 said:
Hi

Use the following :

const unsigned char TEST ="atd0498xxxxxxx\x10\x13\0";
while (TEST*)
putchar (*TEST++);


All the best

Bobi

I think TEST must be declared as an array, you are putting a string in it so it must be TEST[].
 

ccs gsm pic

Hi, glenjoy the line must be:

if ((c1=='O') && (c2=='K') && (c3==0x13))

Best Regards
 

pic c code for gsm

petarpav said:
Hi, glenjoy the line must be:

if ((c1=='O') && (c2=='K') && (c3==0x13))

Best Regards

I think it will not work,

once the system steps into the kbhit, the getchar function will return the data and "OK" and ENTER keys will cannot be stored in a single 16 bit memory allocation, for it to work you need to store it in an array, then compare the content of that array to "OK" and ENTER.
 

receive code gsm modem pic in ccs c

Hi, glenjoy. Here is another correction c1, c2 and c3 in function wait_ok must be int16:

int8 wait_ok(void) // return 0-ok, 1-timeout, 2-not "OK\r"
{
long timeout;
int16 c1,c2,c3;

The chars "O", "K" and "\r" are stored in three differnet variables(if you like more arrays, it works too), variable must be int16 because wait function return 0xFFFF if there is timeout.

Best Regards.
 

pic c code for sms

hai I think that now you got the answer.but I want to remind you that while you send atd 2323XXX send the stopping character #13 at the end .otherwise it wont work
 

gsm to pic receive code ccs c

hiii everybdy..
i m new to pic... n my proj is to send sms to serialy atachd modem ..i knw hw 2 use at commands to snd sms..i hv used it on hyperterminal to snd sms...
bt hw 2 write prog in c.... using c18 c compler.... pl guyz hlp m out...
thanx n advance...
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top