Microcontroller › AVR › How to interface GSM modem TO atmega16 › hii think this program is
August 19, 2011 at 11:48 am
#6613
Participant
hi
i think this program is betet 4 u .
i did it .this program is working with pc (in codevision terminal )but it doesnt work with gsm 300!!!
#include <mega16.h>
#include <stdio.h>
#include <delay.h>
char Enter=13;
char double_quote=34;
char Ctrlz=26;
void main(void)
{
PORTD=0x00;
DDRD=0x00;
UCSRA=0x00;
UCSRB=0x18;
UCSRC=0x86;
UBRRH=0x00;
UBRRL=0x33;
while (1)
{
if (PIND.2==0) {
printf(“at%c”,Enter);
delay_ms(500);
printf(“AT+CMGF=1%c”,Enter);
delay_ms(500);
printf(“AT+CMGS=%c09351563176%c%c”,double_quote,double_quote,Enter);
delay_ms(100);
printf(“AVR Test 1%c”,Ctrlz);
delay_ms(500);
};
};
}