Dr.Larq
Newbie level 3
microcontroller at+cmgf=1
HI I'm using an atmega16 with a nokia 6310i cell phone. I have written some code for the micro to send to a cell phone via AT commands.
Does anyone see any problem with the code? I am really having trouble connecting the phone to the microcontroller. I am using a dlr-3 cable to communicate with hyperterminal but am not sure if I need this for the microcontroller. Is the max232 used for this? Because I thought the max232 was only used to communicate with the PC. I have tested the TX pin on the micro with an oscilloscope and I am getting transmission data. Any help would be appreciated! Thanks!
HI I'm using an atmega16 with a nokia 6310i cell phone. I have written some code for the micro to send to a cell phone via AT commands.
Code:
unsigned char str1[] = "AT+CMGF=1";
unsigned char str2[] = "AT+CMGS="/5123333333/"";
unsigned char str3[] = "TEST!";
void main(void)
{
UCSRA=0x00;
UCSRB=0x18;
UCSRC=0x86;
UBRRH=0x00;
UBRRL=0x19;
puts(str1); //AT+CMGF=1
putchar(0x0D);
delay_ms(250);
puts(str2); //phone number
putchar(0x0D);
delay_ms(250);
puts(str3);
putchar(0x1A); //Control-z
delay_ms(2000);
}
Does anyone see any problem with the code? I am really having trouble connecting the phone to the microcontroller. I am using a dlr-3 cable to communicate with hyperterminal but am not sure if I need this for the microcontroller. Is the max232 used for this? Because I thought the max232 was only used to communicate with the PC. I have tested the TX pin on the micro with an oscilloscope and I am getting transmission data. Any help would be appreciated! Thanks!