vishu489
Advanced Member level 4
hi i want to interface gsm modem sim 300 with atmega 16.my target is to send message and received msg from gsm modem.if any one having source code then plz mail me at vishu489@gmail.com
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
#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);
};
};
}
thank u for ur reply
but why u assign the following values
to char variables
enter=13
double quote=34
ctrlz=26
#include <avr/io.h>
#define baud ((F_CPU/(speed*16UL))-1)
#define speed 2400 //
#define F_CPU 16000000UL //
#include <stdio.h>
void usart_init() //(unsigned int baud)
{
UBRR0H = (unsigned char) (baud>>8);
UBRR0L = (unsigned char) baud; //
UCSR0B = (1<<RXEN1) | (1<<TXEN0);
UCSR0C = (1<<USBS1) | (3<<UCSZ00);
}
void usart_transmit(char data)
{
while ( !( UCSRA & (1<<UDRE)) )
UDR= data;
}
void send(char *data0)
{
int j;
int x=strlen(data0);
for(j=0;j<x;j++)
{
usart_transmit(data0[j]);
}
}
int main (void)
{
usart_init();
while(1)
{
send("it's me!");
}
}
thank u for ur reply
but why u assign the following values
to char variables
enter=13
double quote=34
ctrlz=26
dont use this forum as your mobile, if you need any help from anyone in future... all your post will be deleted and you would get infraction or ban if continued..
take this as last warning , and spend time to type the words properly.....