#include<90s8535.h>
#include<stdio.h>
#include<delay.h>
unsigned char str1[] = "AT";
unsigned char str2[] = "AT+CMGS=25";
unsigned char str3[] = "079119890202456401000B819078004371F400040C486F772061726520796F753F";
void main(void)
{
UBRR=0x33;
UCR=0x18;
puts(str1); //AT
putchar(0x0D); //Enter
putchar(0x0A); //Line feed
delay_ms(3000);
puts(str2); //AT+CMGS=25
putchar(0x0D);
putchar(0x0A);
delay_ms(3000);
puts(str3); //Message in PDU format
putchar(0x1A); //Control-z
}
#include<90s8535.h>
#include<stdio.h>
#include<delay.h>
unsigned char str2[] = "AT+CMGS=25";
unsigned char str3[] = "079119890202456401000B819078004371F400040C486F772061726520796F753F";
void main(void)
{
UBRR=0x33;
UCR=0x18;
puts(str2); //AT+CMGS=25
putchar(0x0D);
delay_ms(3000);
puts(str3); //Message in PDU format
putchar(0x1A); //Control-z
putchar(0x0D);
}
SMSC#+919820205446
Sender:09870034174
TP_PID:00
TP_DCS:04
TP_DCS-popis:Uncompressed Text
class:0
Alphabet:8bit
ow are you?
Length:72
SMSC#+919820205446
Receipient:09870034174
Validity:Not Present
TP_PID:00
TP_DCS:04
TP_DCS-popis:Uncompressed Text
No class
Alphabet:8bit
How are you?
Length:12
the PDU string for above message is :SMSC#+919820205446
Receipient:09870034174
Validity:Not Present
TP_PID:00
TP_DCS:04
TP_DCS-popis:Uncompressed Text
No class
Alphabet:8bit
How are you?
Length:12
079119890202456411000B929078004371F40000AA0CC8F71D14969741F977FD07
079119890202456401000B819078004371F400040C486F772061726520796F753F
Carriage Return (0x0D) is enoughyou have removed the Line Feed commands after the Enter commands.. isn't it required to get the prompt from the phone?
All AT command is endded with Carriage Return (0x0D)and in actual syntax of AT commands we do not press enter after control-z... but here you have?
Are you using CVAVR for develop your system? There two kind of string output function on CVAVR :i guess there is some problem in the system, cos when we send a Dial command, the phone displays random parts of the number to be called, finally not being able to make a call.
But the phone dials properly when connected to the hyperterminal.
void puts(char *str);
void putsf(char flash *str);
hi budhy,
yet again we are facing problems in the smooth functioning for our project.
we wanted to capture the response given by the phone as a result of the AT commands given to it. we are using atmel 8535 and sony ericsson T230.
for e.g when i send in a "AT".... i want to capture the response "OK"... possibly in a string.
i need to compare the responses with predefined strings to proceed further with my project....
can you plz enlighten us with some solution...
you have always been a great source of help for us.... thanx again....
#include <90s8535.h>
#include <stdio.h>
#include <string.h>
char numb[] ="628165417560";
char messg[]="Hello Indonesia";
signed char sendSMS(char *number, char *message){
char response[10];
putsf("ATE0\r"); // disable echo
gets(response,10); // waiting for "OK"
putsf("AT+CMGS=\""); // send number
puts(number);
putsf("\"\r"); // " and 0x0D
gets(response,10); // waiting for ">"
puts(message); // send message
putchar(0x1A); // ended with ctrl-Z
gets(response,10); // waiting for "OK"
return strcmpf(response,"OK");
}
void initUART(void){
...
...
}
void main(void){
initUART();
// repeat send message, until OK
while (!sendSMS(numb,messg));
}
#asm
.equ __lcd_port=0x15 ;PORTD
#endasm
#include<90s8535.h>
#include<stdio.h>
#include<delay.h>
#include <lcd.h>
unsigned char str1[] = "ATE0";
unsigned char str2[] = "ATD 09870034174;";
char ch[20];
void main(void)
{
lcd_init(16);
lcd_gotoxy(0,0);
UBRR=0x33;
UCR=0x18;
puts(str1);
putchar(0x0D);
puts(str2);
putchar(0x0D);
gets(ch,20);
delay_ms(500);
lcd_puts(ch);
delay_ms(5000);
lcd_clear();
while(1)
;
}
lcd_putsf("Hello");
murty_ind said:and my doubt is at the time of sending the message how much message size i have to give in the CMGS CMD
AT+CMGS= ?
whether it is strlen(buff) or number of octols?
[
miss_monica said:, i am sure it has also something to do with rts right? plz answer
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?