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

ExperimenterUK
Wed Jul 26 2017, 07:51 PM
Please post questions in the forum, the chat box is for chat
msd007
Wed Jul 26 2017, 11:27 AM
i need code if any one have aduc706 interfacing lcd 16*2
msd007
Wed Jul 26 2017, 11:26 AM
pl help me how to write code of interfacing ADuc7026 controlleo lcd pl any one help me hoe to initializend configure the direction
rammichael
Wed Jul 26 2017, 06:04 AM
can you explain what is timer and how to use their modes ...
rammichael
Wed Jul 26 2017, 06:03 AM
ExperimenterUk thank you for your quick reply okay
ExperimenterUK
Wed Jul 26 2017, 01:43 AM
rammichael & Sarvn We will help,but mainly by answering questions about problems.
rammichael
Tue Jul 25 2017, 10:59 AM
i want few tips to learn to become an expert in embedded systems ...?anybody is there to help me?
Sharmi
Sun Jul 23 2017, 04:13 AM
Sir, I wants to make a digital clock with RTC using AT89C51 or AT89C2051 and seven segment led. Sir will u help me?
Sarvn
Sat Jul 22 2017, 11:42 AM
I wnt to learn embedded could anyone help me
Sarvn
Sat Jul 22 2017, 11:41 AM
Hi

Downloads

Comments

msd007
Wed Jul 26 2017, 11:23 AM
hmn16
Wed Jul 26 2017, 01:04 AM
rammichael
Tue Jul 25 2017, 07:12 AM
Rohanmore26
Tue Jul 25 2017, 04:26 AM
AlFaller
Mon Jul 24 2017, 02:31 PM
Sarvn
Sat Jul 22 2017, 11:34 AM
diablom
Fri Jul 21 2017, 01:44 PM
Alihaider.007
Thu Jul 20 2017, 03:07 PM

Online

Guests: 54, Members: 0 ...

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

Members: 37866
Newest member: msd007
Forum Activity
ExperimenterUK Avatar
Posted By ExperimenterUK
Wed Jul 26 2017, 07:35 PM
A byte such as 0xfa will not pass through the sys...
hmn16 Avatar
Posted By hmn16
Wed Jul 26 2017, 01:08 AM
Hello, I am current;y trying to send a hexadecimal...
Rohanmore26 Avatar
Posted By Rohanmore26
Tue Jul 25 2017, 04:29 AM
Hello I want to know How 3D stitching of 2 3D imag...
AlFaller Avatar
Posted By AlFaller
Mon Jul 24 2017, 02:40 PM
Here is a lot information about using virtual COM ...
ExperimenterUK Avatar
Posted By ExperimenterUK
Thu Jul 20 2017, 04:08 PM
can it be possible ?? Alihaider.007No.You will nee...
Alihaider.007 Avatar
Posted By Alihaider.007
Thu Jul 20 2017, 03:14 PM
Sir I am using AT89S8253 I have trying to use this...
Utsavi Avatar
Posted By Utsavi
Mon Jul 17 2017, 09:57 AM
Hello Ajay_Bhargav,Thanks for your reply. Yes, you...
ajay_bhargav Avatar
Posted By ajay_bhargav
Mon Jul 17 2017, 06:41 AM
I do not think it would be a good idea to kind of ...
ajay_bhargav Avatar
Posted By ajay_bhargav
Mon Jul 17 2017, 06:32 AM
Tasking EDE has linker script facility available y...
Ramweit Avatar
Posted By Ramweit
Thu Jul 13 2017, 06:58 AM
Thank you for response,Sim300 gsm Modem am using h...