Discussion in "Embedded GSM Development" started by    Alvanbert    Feb 10, 2012.
Fri Feb 24 2012, 12:57 PM
#21
hi guyz... Me too interested in dis project... I want to ask that is it possible to use proteus's Virtual hyperterminal for getting input from my real hardware GSM modem and simulate using it? Thnx
Mon Feb 27 2012, 03:43 AM
#22
Yes u can use proteus Virtual terminal
Mon Feb 27 2012, 07:48 AM
#23
continued in a seperate post : http://www.8051projects.net/forum-t52973-last.html
help me in dat..
Mon Feb 27 2012, 06:12 PM
#24
Hi guys. Am trying to display my messages on the lcd in moving format. Pliz guys help me out. How can this be done.
Tue Feb 28 2012, 09:07 AM
#25
First have u succeeded with SMS Reception and display the same on LCD.
Tue Feb 28 2012, 09:42 AM
#26
Yes kiran. Sorry i didnt tell u that. I can display the sms on lcd. Problem is if msg is a bit long. It gets cut off. So i thout displaying it in a moving format wud solve problem. If nt pliz give me some alternatives. Thanx
Tue Feb 28 2012, 05:04 PM
#27
I am sorry that i might be wrong, but this code worked for me :

for(int i=0; i<40; i++) 
{               
   LCDCmd(0x80);
  LCDWriteString("HELLO:");
  LCDCmd(0xC0);
  LCDWriteString("This is Feroz,Testing LCD scrolling CODE");	// Maximum 40 chars
  LCDCmd(0x1C);
  _delay_ms(200);
}//END For


[ Edited Tue Feb 28 2012, 05:05 PM ]
Wed Feb 29 2012, 11:51 AM
#28
@ firoz3321
u can take it as a reference

Wed Feb 29 2012, 05:42 PM
#29
Hi Guys, Below i have attached the code. it can read from address 1 t0 5 while displaying the message. But it can only display message in the first line of lcd. Can i mek it display same message in all lines i.e if its long.

Thanx Majoka AND Froz3321 for the code for ur help. The messages can scroll one at a time but not one after the other, i thout this was better. If u get the idea pliz help me edit this code accordingly. Thanks

#include <REGX52.H>


#define LCD P1
#define LCD_EN		0x80
#define LCD_RS		0x20
                     
//LCD Commands        

#define LCD_SETMODE		   0x04
#define LCD_SETVISIBLE	   0x08
#define LCD_SETFUNCTION	   0x28
#define LCD_SETDDADDR	   0x80

void delayms(unsigned char);
void delayus(unsigned char);
void lcd_init();
void lcd_reset();
void lcd_cmd (char);
void lcd_data(unsigned char);
void lcd_str (unsigned char *);
void clear(void);
void tx0(unsigned char);
void delay_sms (unsigned int);
void SMSString(char*text) ;
void init();
void read_text(unsigned char *);
unsigned int var,i,n;
unsigned char j,abc;
unsigned char idata msg1[150];
unsigned char rec_no[20];
unsigned char time_date[20];
void gsm_loop(unsigned int);

void serial () interrupt 4
{
msg1[abc]=SBUF;
abc++;
RI=0;
}

void main (void)
{

n=0x35;

gsm_loop(n);
delay_sms(2000);
}

void gsm_loop(unsigned int n)
{
  for(i=0x31;i<=n;i++)
  {
  clear();
  init();
  lcd_init();
  var=i;
  SMSString("AT\r"); // AT commands to initialize gsm modem
  delay_sms(1000);

  SMSString( "ATe0\r"); // turn off echo
  delay_sms(1000);

  SMSString( "AT&W\r"); // save settings
  delay_sms(1000);

  SMSString( "AT+CMGF=1\r"); // select text mode for sms
  delay_sms(1000);

  SMSString( "AT+CNMI=2,1,0,0,0\r"); // notification of new sms
  delay_sms(1000);

  SMSString( "AT+CMGR=");   // AT command to read sms
  tx0(var);
  SMSString("\r");

  IE=0X90;   // Enable serial interrupt
  delay_sms(2000);

  read_text(msg1);		// read sms and store in buffer msg1

  delay_sms(2000);			  
  IE=0X00;       // Disable all interrupt
            
  }
}


void init(void)
{
j=0;
abc=0;
TL1=0XFD; //9600 @ 11.0592
TH1=0xFD;
TMOD=0x20;
SCON=0x50;
TR1=1;
}

void SMSString(unsigned char* text) //function to send SMS using GSM modem
{
while (*text)
{
tx0(*text++);
}
}


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


void delay_sms (unsigned int count)
{
unsigned int i;                         // Keil v7.5a 
    while(count) {
        i = 115;
                while(i>
0) i--;
        count--;
}
}

void read_text( unsigned char *msg)
{
unsigned char *temp;
temp=msg;
do
msg++;
while(*msg!='#');
msg++;
do
*temp++=*msg++;
while(*msg!='#');       // reaching at end of message
*temp='\0';


lcd_cmd(0x80);
lcd_str(msg1);



         // array having message

}

void lcd_reset()
{
	LCD = 0xFF;
	delay_sms(40);
	LCD = 0x03+LCD_EN;
	LCD = 0x03;
	delay_sms(40);
	LCD = 0x03+LCD_EN;
	LCD = 0x03;
	delay_sms(5);
	LCD = 0x03+LCD_EN;
	LCD = 0x03;
	delay_sms(5);
	LCD = 0x02+LCD_EN;
	LCD = 0x02;
	delay_sms(5);
}


void lcd_init ()
{
	lcd_reset();
	lcd_cmd(LCD_SETFUNCTION);                    // 4-bit mode - 1 line - 5x7 font. 
	lcd_cmd(LCD_SETVISIBLE+0x04);                // Display no cursor - no blink.
	lcd_cmd(LCD_SETMODE+0x02);                   // Automatic Increment - No Display shift.
	lcd_cmd(LCD_SETDDADDR);                      // Address DDRAM with 0 offset 80h.
 }

 void lcd_cmd (char cmd)
{ 
	LCD = ((cmd >
>
 4) & 0x0F)|LCD_EN;
	LCD = ((cmd >
>
 4) & 0x0F);

	LCD = (cmd & 0x0F)|LCD_EN;
	LCD = (cmd & 0x0F);

    delay_sms(1);
}

void lcd_data (unsigned char dat)
{ 
	LCD = (((dat >
>
 4) & 0x0F)|LCD_EN|LCD_RS);
	LCD = (((dat >
>
 4) & 0x0F)|LCD_RS);
	
	LCD = ((dat & 0x0F)|LCD_EN|LCD_RS);
	LCD = ((dat & 0x0F)|LCD_RS);

    delay_sms(1);
}

void clear(void)
{
unsigned char a;
for(a=0;a<100;a++)
msg1[a]=0x00;
}

void lcd_str (unsigned char *str)
{
	while(*str){
		lcd_data(*str++);
	}
}

Thu Mar 01 2012, 01:11 PM
#30
Is above code is working fine at all time..
Try to send msgs continuously of 10msgs and see does it receives all of them.

Get Social

Information

Powered by e107 Forum System

Conversation

ExperimenterUK
Fri Feb 12 2016, 04:39 AM
@ Ankush SS .. source code for what?
plinniocom2n
Fri Feb 12 2016, 12:17 AM
thank you
Tue Feb 09 2016, 05:17 PM
Ankush SS
Can i get the source code of this project? Please n thnk u for ur kindness
Fri Feb 05 2016, 08:33 AM
SANJYOT JADHAV
sir did we have to use Gsm modem for testing the circuit on proteus
Tue Feb 02 2016, 11:17 AM
upendra kumar
i want information about 3-phase motor control using gsm technology
Sat Jan 16 2016, 05:33 PM
Kenneth Etuk
Hi everyone, I need help with a project involving MCU,rttc, and DC motor. I will pay for it. please reply to my mail [email protected] if you are interested. thanks
ExperimenterUK
Sat Jan 16 2016, 02:08 AM
@Kabona Log in and create a thread. Tell us what you want to do
Tue Jan 12 2016, 08:24 PM
Kabona
how can I make my pc be input and output device for the microcontroller
Sat Jan 09 2016, 07:04 AM
Ravz
Thank u..... one more doubt Will ultrasonic sensor HC-SR04 works with aurdino board in operating system linux
Tommy.Kofisterix
Fri Jan 08 2016, 08:50 PM
I know it detects also the mud on rear bumper, this means other obstacles will

Downloads

Comments

plinniocom2n
Fri Feb 12 2016, 12:12 AM
designAAA
Sat Jan 30 2016, 08:49 AM
syavash_kasraeee
Sat Jan 16 2016, 05:54 AM
hamudi
Thu Jan 07 2016, 04:40 AM
Spandan89
Tue Jan 05 2016, 04:06 PM
siimao
Thu Dec 24 2015, 04:00 PM
moinabbasqureshi
Thu Dec 17 2015, 03:35 PM
dodo
Tue Dec 15 2015, 11:36 AM

Online

Guests: 45, Members: 0 ...

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

Members: 37728
Newest member: plinniocom2n
Forum Activity
ExperimenterUK Avatar
Posted By ExperimenterUK
Fri Feb 12 2016, 11:04 PM
Try this program.Let me know if it makes sense to ...
ExperimenterUK Avatar
Posted By ExperimenterUK
Fri Feb 12 2016, 04:45 AM
How do I get the link to the file? plinniocom2nGoo...
plinniocom2n Avatar
Posted By plinniocom2n
Fri Feb 12 2016, 12:18 AM
How do I get the link to the file? Newbie here.
sankalp_s Avatar
Posted By sankalp_s
Thu Feb 11 2016, 06:28 PM
Hello phil sir finaly i'm dumping my code, now i'm...
ExperimenterUK Avatar
Posted By ExperimenterUK
Thu Feb 04 2016, 04:10 AM
Sir I didn't understand that. Could you explain ab...
sankalp_s Avatar
Posted By sankalp_s
Tue Feb 02 2016, 07:26 PM
but good use of sub routines will save a lot of ...
ExperimenterUK Avatar
Posted By ExperimenterUK
Tue Feb 02 2016, 12:25 AM
after removing ALLON instruction it's working fine...
ExperimenterUK Avatar
Posted By ExperimenterUK
Tue Feb 02 2016, 12:14 AM
Which micro controller are you using ?.Does it hav...
sankalp_s Avatar
Posted By sankalp_s
Sat Jan 30 2016, 07:40 PM
You need to explain exactly what you want the code...
ExperimenterUK Avatar
Posted By ExperimenterUK
Sat Jan 30 2016, 06:57 PM
>sir can you code this in any other method?You nee...