GSM MODEM with 8051
Thu Dec 09 2010, 04:55 pm
hi kirangowle
TI is an transmit interrupt flag
TI_flag is any general bit
it can not be replaced with each other
TI is an transmit interrupt flag
TI_flag is any general bit
it can not be replaced with each other
Thu Dec 09 2010, 06:09 pm
Hi,
I have made little modification well this is also not working as per expected.
Problem is, for first msg working fine.
when i send another msg its entering into the loop but being hanged.
I have made little modification well this is also not working as per expected.
Problem is, for first msg working fine.
when i send another msg its entering into the loop but being hanged.
void read_notification() { IE=0x00; lcdcmd(0x01); lcdcmd(0xd4); lcddata('Z'); delay(50); clear(); SMSString("AT+CMGR="); tx0(MyBuff[12]); SMSString("\r"); IE=0x90; delay(100); read_text(msg1,rec_no,time_date); clear(); // clear MyBuff[] so that next index no can be stored. clear_mybuff(); } SMSString( "AT+CNMI=2,1,0,0,0\r"); // notification of new sms while(1) { IE=0x90; k=0; lcdcmd(0xd4); lcddata('R'); delay(100); while(!NewMessage); { lcdcmd(0xd4); lcddata('I'); delay(10); NewMessage = 0; read_notification(); IE=0x90; } //New msg indication. // +CMTI: "SM",3 } void clear_mybuff() { unsigned int a; for(a=0;a<=15;a++) MyBuff[a]=0x00; }
Thu Dec 09 2010, 10:07 pm
its entering into the loop but being hanged.
in which loop it enter and hang
may be there is memory overlapping try to increase buffer size to 20 or 25 bytes
Fri Dec 10 2010, 12:14 pm
Hi mojaka,
When 2nd msg arrives its entering in read notification() clears the screen and displays 'Z' and then its being hanged.
When 2nd msg arrives its entering in read notification() clears the screen and displays 'Z' and then its being hanged.
Fri Dec 10 2010, 08:17 pm
well there is no need to disable interrupts, it can cause problems later on.
And you should not use tx0 function inside interrupt.
void tx0(unsigned char x) //send data to serial port 0 { SBUF=x; while(!TI_flag); TI_flag=0; }
And you should not use tx0 function inside interrupt.
[ Edited Fri Dec 10 2010, 08:18 pm ]
Fri Dec 10 2010, 09:49 pm
hi kirangowle
debug it with keil
connect modem to serial port in Proteus send data to serial port and see fee back on proteus
also use pproteus vsm plug in with keil it will easily catch the error point
in read_notification() function write a character to lcd after each line so we detect a point where its get stuck
debug it with keil
connect modem to serial port in Proteus send data to serial port and see fee back on proteus
also use pproteus vsm plug in with keil it will easily catch the error point
in read_notification() function write a character to lcd after each line so we detect a point where its get stuck
lcddata('Z');
delay(50);
lcddata('A');
clear();
lcddata('B');
SMSString("AT+CMGR=");
lcddata('C');
Tue Dec 14 2010, 05:44 pm
Tue Dec 14 2010, 06:15 pm
After this i have to debug in proteus or in keil itself guide me to proteus?.
Tue Dec 14 2010, 11:15 pm
hi kirangowle
go through these links
http://www.labcenter.com/support/vdmkeil.cfm
http://www.labcenter.com/support/vdmavr.cfm
at first u need to enable from Proteus debug-> use debug monitor
from keil use it as u see in above screen shoot
steps:
1.In Keil options select proteus VSM monitor under debug tab.
2. Build the project in Keil. Select to generate hex file also.
3. In Proteus, under properties (ctrl+E over the part) of 8051 point to the above hex file as program file.
4. Start the simulation with remote debug monitor selected.
5. Start debugging from keil.
if u get this message " the target DLL has been cancelled. the debugger is stopped"
then do these steps
1. download vdmadi.exe from Labcenter and install.
2. download this cracked prospice.dll and replace the original one.
3. check debug-use remote debug monitor in Proteus.
4. Config keil51, debug-Proteus monitor 51 driver - setting - ip 127.0.0.1 for debug on same computer. Port 8000.
go through these links
http://www.labcenter.com/support/vdmkeil.cfm
http://www.labcenter.com/support/vdmavr.cfm
at first u need to enable from Proteus debug-> use debug monitor
from keil use it as u see in above screen shoot
steps:
1.In Keil options select proteus VSM monitor under debug tab.
2. Build the project in Keil. Select to generate hex file also.
3. In Proteus, under properties (ctrl+E over the part) of 8051 point to the above hex file as program file.
4. Start the simulation with remote debug monitor selected.
5. Start debugging from keil.
if u get this message " the target DLL has been cancelled. the debugger is stopped"
then do these steps
1. download vdmadi.exe from Labcenter and install.
2. download this cracked prospice.dll and replace the original one.
3. check debug-use remote debug monitor in Proteus.
4. Config keil51, debug-Proteus monitor 51 driver - setting - ip 127.0.0.1 for debug on same computer. Port 8000.
Powered by e107 Forum System