Discussion in "Project Addition or Changes" started by    Ramweit    Jul 8, 2017.
Sat Jul 08 2017, 02:12 PM
#1
#include<reg51.h>
#include<stdio.h>
bit moreover,data_bit,sucess,pin,bok,bok1,gprs,gprs9,uma1,flag;
char dat1;
sbit f3locking=P2^7;
sbit f3locking1=P3^4;
sbit WaitFor = P1^4;
unsigned char dataword[48],APN[12],content[22];
unsigned char addresstemp;
unsigned char Pagetemp;

int Page,Number,Number2;
char status;
sfr T2CON=0xc8;
sfr RCAP2H=0xcb;
sfr RCAP2L=0xca;



void hari();
void LoadMessage();
void incrementD();
void GetData11();
void MessageToMob();
void tx0(unsigned char x)
;
#define attempts 3

#include "EepromDriver.c"
#include "RxDTxD.c"
#include "Initialization.c"
#include "summary.c"
#include "gprsdata.c"


main()
{
StartingDelay();
pin=ramdata;
moreover=0;
SCON=0x53;
T2CON=0x34;
RCAP2H=0xff; //ffec
RCAP2L=0xD9;


// RCAP2H=0xff; //ffec
// RCAP2L=0xB2;
moreover=0;

for(Number=1;Number<=32;Number++){WriteDataTo1024(206,Number,0x20); }
ReadDataFrom1024(205,10);
Number2=dat1;
if(Number2>=250 ||Number2<=219){Number2=220;WriteDataTo1024(205,10,220);}
Initiate();
gprs=0;
status=1;
moreover=0;
status=1;
WriteDataTo1024(202,2,0x01);
WriteDataTo1024(202,1,0x01);
WriteDataTo1024(206,1,'0');
WriteDataTo1024(205,1,1);
//ReadDataFrom1024(202,0xab);if(dat1=='1'){Initialise();}


WriteDataTo1024(206,50,'1');
while(1)
{
if(f3locking==0)
{
ModemStatus();
SimInserted();
CheckSignal();
SystemTemp();

incrementD();
moreover=0;
ReadDataFrom1024(245,90);
if(flag==0){
if(dat1=='/'){MessageToMob();}
tx0(0x1A);
flag=1;
}

bok=0;bok1=0;
moreover=0;
ReadDataFrom1024(202,0xab);
if(dat1=='1'){GPRSSend();}

moreover=0;
ReadDataFrom1024(202,0xae);
if(dat1=='1'){SendPC();}

moreover=0;
ReadDataFrom1024(202,0xa1);
if(dat1=='1'){SendGSM();}

moreover=0;
ReadDataFrom1024(202,0xa6);
if(dat1=='1'){LoadMessage();}
StartingDelay();
}
}
}

void tx0(unsigned char x) //send data to serial port 0
{
EA=0;
SBUF=x;
while(TI==0);
TI=0;
EA=1;
}

void LoadMessage()
{
SendReport();
}

void incrementD()
{
moreover=0;
for(Page=1;Page<=100;Page++)
{
Number=1;
ReadDataFrom1024(Page,Number);
if(dat1=='/'){goto outincd;}
Number=125;
ReadDataFrom1024(Page,125);
if(dat1=='/'){goto outincd;}
}
Page=1;Number=1;
WriteDataTo1024(202,221,0x20);
outincd:
moreover=0;
WriteDataTo1024(202,2,Number);
WriteDataTo1024(202,1,Page);
WriteDataTo1024(202,221,'1');
}


void MessageToMob()
{
int i;
char j=2;
ReadDataFrom1024(245,1);
if(dat1!=0x20)
{
printf("AT+CMGS=");putchar('"');printf("+91");
do{gprs=0;}while(f3locking==1);
do{
ReadDataFrom1024(245,j);
if(j>0x0f){goto mout1;}
if(dat1!='*'){putchar(dat1);}
j++;
}while(dat1!='*');
mout1:;
putchar('"');
Enter();
do{
while(RI==0){}
ACC=SBUF;
RI=0;
dat1=ACC; if(dat1=='E'){goto mout2;}
}while(dat1!='>');
GetData11();
Enter();
SendStringOnGSM("WName:");
i=0x90;
do{
ReadDataFrom1024(202,i);
if(dat1!='*'){SendCharOnGSM(dat1);}
i++;
if(i>=0x9b){dat1='*';}
}while(dat1!='*');
Enter();
SendCharOnGSM(0x1a);
WriteDataTo1024(245,1,0x20);
WriteDataTo1024(245,125,0x20);
mout2:;
}
}

void GetData11()
{
int j;
char h=1;
j=90+1;
if(f3locking==0)
{
moreover=0;
selection(h);h++;
do{
ReadDataFrom1024(245,j);

if(dat1=='/')
{
goto cdm;
}
if(dat1!='|')
{SendCharOnGSM(dat1);}
else{SendCharOnGSM(0x0a);SendCharOnGSM(0x0d);selection(h);h++;
}
j++;
}while(dat1!='/');
cdm:; }
}

Mon Jul 10 2017, 06:09 PM
#2
@Ramweit
What is it you want to know ?
Tue Jul 11 2017, 02:37 PM
#3
From this code gsm modem sending SMS to mobiles multiple times to avoid that am trying to give flag for sent SMS, if flag value is 1 have to stop sending SMS repeatedly.....
Tue Jul 11 2017, 04:20 PM
#4
After the SMS is sent the modem should respond
+CMGS: xx
OK

Just wait a few seconds for the reply.
If you get "OK" stop sending.

Of course is the message was not sent the first time
it probably will not be sent at all.


Which modem are you using ?


[ Edited Tue Jul 11 2017, 04:32 PM ]
Thu Jul 13 2017, 06:58 AM
#5
Thank you for response,

Sim300 gsm Modem am using here...

Get Social

Information

Powered by e107 Forum System

Conversation

Sun May 20 2018, 10:01 AM
justinb
how to write and execute a program that read the keypad button and display the number on 7 segment on intel8051 at89s52 in assembly language?
Thu May 17 2018, 06:36 AM
HAMZA TAJ
sir iwant to ask about controller of three phase supply by using back to back thyristor instead of triac....will u give me some guideline?
Sat Apr 28 2018, 12:54 PM
ashutosh jain
IR Remote Switch using TV remote (RC5 Protocol) is not working properly. opp1 & opp2 is in problem.plz help
ExperimenterUK
Fri Apr 27 2018, 08:09 PM
@kaiserslautern Post in forum
Wed Apr 25 2018, 07:09 AM
kaiserslautern
Hello everyone, using software uart is a very good idea for a second serial port. Thank you so much. I would kindly like to know how to connect this port to the PC?
ExperimenterUK
Sat Apr 21 2018, 07:50 PM
This is a community site. Feel free to help anyone needing advice
hareeshchamiyar
Thu Mar 29 2018, 10:47 AM
please help me for the configuration bits for dspic30f2010
hareeshchamiyar
Thu Mar 29 2018, 10:45 AM
can any one using dspic30f2010.
Thu Mar 29 2018, 06:03 AM
Neena
can anybody give solar tracking in 8051 using proteus and keil to mail [email protected]
ExperimenterUK
Mon Mar 19 2018, 07:33 PM
sorry bedo.. maybe next time

Downloads

Comments

bdmehta
Tue May 22 2018, 02:30 AM
kmag1953
Sun Apr 29 2018, 07:09 PM
udiwonder
Sat Apr 28 2018, 12:41 PM
pirpiri
Sat Apr 21 2018, 03:35 PM
Pater
Fri Apr 20 2018, 02:38 PM
jamiel
Sat Apr 14 2018, 12:47 AM
akrepkral76
Wed Apr 04 2018, 07:51 PM
samanthaeaves
Mon Apr 02 2018, 06:27 AM

Online

Guests: 63, Members: 0 ...

most ever online: 182184
(Members: , Guests: 182184) on 06 Aug 2010: 05:37 AM

Members: 37998
Newest member: bdmehta
Forum Activity
ExperimenterUK Avatar
Posted By ExperimenterUK
Sat Jun 16 2018, 11:33 PM
hi sir sorry for the late reply sir can we control...
LAMBO Avatar
Posted By LAMBO
Sat Jun 16 2018, 07:15 AM
hi sir sorry for the late reply sir can we control...
ExperimenterUK Avatar
Posted By ExperimenterUK
Mon May 14 2018, 10:17 PM
So the main problem is that I am not getting Analo...
ExperimenterUK Avatar
Posted By ExperimenterUK
Mon May 14 2018, 09:40 PM
Hi sir after checking all the connection i...
Pater Avatar
Posted By Pater
Mon May 14 2018, 05:36 PM
Basically my project is based on Data Acquisition ...
LAMBO Avatar
Posted By LAMBO
Sun May 13 2018, 02:13 PM
Hi sir after checking all the connection i...
ExperimenterUK Avatar
Posted By ExperimenterUK
Mon May 07 2018, 07:27 PM
This design should be fine.Choose a frequency betw...
Pater Avatar
Posted By Pater
Mon May 07 2018, 01:28 PM
Sorry for late reply as exams were on,Based on my ...
ExperimenterUK Avatar
Posted By ExperimenterUK
Thu May 03 2018, 03:32 PM
If the circuit works with a light bulb, the probl...
LAMBO Avatar
Posted By LAMBO
Thu May 03 2018, 08:04 AM
Hi sir as u mentioned above everthing is working...