- This topic has 2 replies, 3 voices, and was last updated 11 years, 9 months ago by .
Viewing 3 posts - 1 through 3 (of 3 total)
|
Microcontroller › AVR › Sending message from AVR atmega32 using sim900D
Please help me in sending txt via gsm sim900D using AVR.
I am using following code.
#define F_CPU 11059200UL
#include <util/delay.h>
#include <inttypes.h>
#include <string.h>
void send_msg();
void init_USART();
void usart_send_string(char *str );
void usart_send(char data);
void gsm_cmd(char *cmd);
void init_USART()
{
unsigned int baud=71; //(UBRR= (Fos/ (16*baudrate) )-1 )
UBRRH =(unsigned char)(baud>>;
UBRRL=(unsigned char)baud;
UCSRC|=(1<<URSEL)|(3<<UCSZ0);
//Enable The receiver and transmitter
UCSRB |= (1<<RXCIE) | (1 << RXEN) | (1 << TXEN); // Turn on the transmission reception .
sei();
}
ISR (USART_RXC_vect)
{
unsigned char value;
value = UDR; // Fetch the received byte value into the variable “value”
len_recieved++;
recieved_msg[len_recieved]=val
if(data_flag==-1)
data_flag=0;
}
}
void usart_send_string(char *str )
{
while((*str)!=’