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 Oct 13 2019, 07:32 AM
Aline Hutchinson
Hey there,
ExperimenterUK
Sun Oct 13 2019, 03:53 AM
Log in.. then post your code in the 8051 forum
Sat Oct 12 2019, 03:48 PM
Bhadra Sajikumar
i am doing a countdown timer with 8051 for my project, unfortunately our professor had to take a leave of absence before he could teach us most of it.. can someone explain the .asm code of it for me?
Mon Sep 23 2019, 01:07 PM
Nathaniel
I am doing a project for my schools wireless security system with cameras,sensors and spot lights using 8051 micro controller, could you help me out with the design and its source code.
Thu Sep 19 2019, 02:18 AM
Caryn Kover
Thank you for your time,
ExperimenterUK
Tue Aug 06 2019, 12:39 AM
@Ismail ..post in forum, give details
Mon Aug 05 2019, 10:03 PM
Ismail balghmi
Hello. Please I won't download
ExperimenterUK
Wed Jul 24 2019, 06:17 AM
@BUSTER123 Please post in the forum
Tue Jul 23 2019, 11:43 PM
BUSTER123
hello! newbie here. i am kind of a guy who hates using ready - made existing libraries, so this helped a lot as i was trying to control and write to a character lcd display. however, i can't figure out how to set the cursor position. for example, i want to set it to the 5th column in the first row, so position 5. so according to the table, i am sending 10000101 on the 8 data lines of the lcd (register select pulled low). the cursor does not move there however. and i cant move the cursor left or right too. is it something wrong that i am doing? thank you.
ExperimenterUK
Fri Jul 12 2019, 01:25 AM
@ramos https://www.theengineeringprojects.com/2017/09/l298-motor-driver-library-proteus.html

Downloads

Comments

ilylily07
Tue Oct 15 2019, 04:32 PM
hientran123
Tue Oct 15 2019, 02:27 AM
Sat Oct 05 2019, 02:38 PM
zexalo
Thu Oct 03 2019, 09:53 AM
thanhle12345
Thu Oct 03 2019, 07:37 AM
ramon_vsc
Fri Sep 20 2019, 04:53 PM
youssoufba
Thu Sep 19 2019, 11:57 AM
Taiphan000
Tue Sep 17 2019, 04:21 AM

Online

Guests: 62, Members: 0 ...

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

Members: 38097
Newest member: ilylily07
Forum Activity
s_dinesh40@yahoo.com Avatar
Posted By [email protected]
Thu Oct 17 2019, 09:38 PM
ExperimenterUK Avatar
Posted By ExperimenterUK
Thu Oct 17 2019, 08:35 PM
Do you understand how this code works?If so, addin...
s_dinesh40@yahoo.com Avatar
Posted By [email protected]
Thu Oct 17 2019, 09:30 AM
i want to scroll message more than 2 dot matrix di...
ExperimenterUK Avatar
Posted By ExperimenterUK
Wed Oct 16 2019, 09:58 PM
What do you mean by "message scroll vertically" ?...
s_dinesh40@yahoo.com Avatar
Posted By [email protected]
Wed Oct 16 2019, 07:38 AM
s_dinesh40@yahoo.com Avatar
Posted By [email protected]
Wed Oct 16 2019, 07:13 AM
message scroll vertically, please share code.
ExperimenterUK Avatar
Posted By ExperimenterUK
Wed Oct 16 2019, 01:10 AM
Which camera ?What do you want the micro to do ?
ilylily07 Avatar
Posted By ilylily07
Tue Oct 15 2019, 04:43 PM
i need help.i don't know how to do it.is it possib...
ExperimenterUK Avatar
Posted By ExperimenterUK
Sun Oct 13 2019, 06:10 PM
This code does some scrolling.You will need to fin...
ExperimenterUK Avatar
Posted By ExperimenterUK
Sat Oct 12 2019, 10:19 PM
This code does not scroll, that will be complicate...