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

Tue Sep 19 2017, 08:36 PM
Ted
In a missing pulse detector using a 555 timer connected as a monostable vibrator with a PNP transistor,how does the positve input pulse turn on the PNP transistor?
Sun Sep 03 2017, 10:29 AM
martymarty
How do I connect an <NOKIA 1100 LCD > to an atmega328P ?
poojab51296
Sun Aug 20 2017, 06:23 AM
i am intending to interface sd card with STM32F4 and want to write a file in sd card using SPI protocol but using HAL only. Can anyone help me PLEASE!!!!
poojab51296
Sun Aug 20 2017, 06:22 AM
hello
rawat742
Fri Aug 18 2017, 07:37 AM
hi @ angel patel i will attach a file i hope it will be helpfull for you
ExperimenterUK
Mon Aug 14 2017, 05:57 PM
@ angel patel... just log in and post your problem
Mon Aug 14 2017, 09:45 AM
angel patel
hey any one help to make the led scrolling display
desuza6
Sat Jul 29 2017, 03:09 AM
I see the code for step motor h l 298 to rotate 45 degree, but all delay time, if I want to input sensor to h the pulses to stepmotor
rammichael
Thu Jul 27 2017, 08:05 AM
okay fine
ExperimenterUK
Wed Jul 26 2017, 03:51 PM
Please post questions in the forum, the chat box is for chat

Downloads

Comments

butt_butt
Fri Sep 08 2017, 02:58 PM
RKTJ
Fri Sep 08 2017, 01:55 PM
ahmed2016
Thu Sep 07 2017, 05:55 AM
Johnleonarduc
Sat Sep 02 2017, 01:48 AM
Suseethra
Fri Sep 01 2017, 06:31 AM
ashokreddy424
Sat Aug 26 2017, 04:02 PM
abdullah6484
Tue Aug 22 2017, 10:21 PM
crank.tp
Mon Aug 21 2017, 02:17 PM

Online

Guests: 93, Members: 0 ...

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

Members: 37888
Newest member: butt_butt
Forum Activity
ExperimenterUK Avatar
Posted By ExperimenterUK
Mon Sep 11 2017, 12:07 AM
The hardware for connecting to a PC or a modem is...
Suseethra Avatar
Posted By Suseethra
Sat Sep 09 2017, 09:43 AM
Hi,we are doing the same project(LED scrolling dis...
ExperimenterUK Avatar
Posted By ExperimenterUK
Mon Aug 28 2017, 07:21 PM
First you have to decide which version of the 8051...
rawat742 Avatar
Posted By rawat742
Sat Aug 26 2017, 12:36 PM
Dear Sir, I want to purchase progra...
ExperimenterUK Avatar
Posted By ExperimenterUK
Fri Aug 25 2017, 08:22 PM
Debuggers and programmers are different things.Whi...
rawat742 Avatar
Posted By rawat742
Thu Aug 24 2017, 04:30 PM
Dear Sir, if I am not purchase debugger then how ...
poojab51296 Avatar
Posted By poojab51296
Thu Aug 24 2017, 06:27 AM
I am using STM32 cube MX and Atollic truestudio so...
ajay_bhargav Avatar
Posted By ajay_bhargav
Wed Aug 23 2017, 01:30 PM
It will be easier to help if you can post the comp...
ajay_bhargav Avatar
Posted By ajay_bhargav
Wed Aug 23 2017, 01:24 PM
There is a company in china which makes 8051 micro...
ajay_bhargav Avatar
Posted By ajay_bhargav
Wed Aug 23 2017, 01:19 PM
Which library or driver are you using for SD card ...