Electronics › Electronics › Help in Gsm module › this is my code for
this is my code for atmega8….its not working..
help me..where to edit code…
this code is transmitting commands to hyperterminal but not working with mcu
#include<avr/io.h> //This is the header for AVR Microcontroller
#define F_CPU 12000000
#include<util/delay.h>
#include”uart.h” //header file to program uart
int main(void)
{DDRC=0x00;PORTC=0x0f;DDRB=0x0f;
uart_init(); //initialisation of uart
while(1)
{if((PINC&0x0f)==0x0f)
{PORTB=0x0f;}
else{
PORTB=0x03;
_delay_ms(6000);
uart_string(“ATr”); //function to pass a string
_delay_ms(2000);
uart_string(“ATE0r”); //function to pass a string
_delay_ms(2000);
uart_string(“AT+CMGF=1r”); //function to pass a string
_delay_ms(2000);
uart_string(“AT+CMGS=”+91**********”r”); //function to pass a string
_delay_ms(2000);
uart_string(“op is ok”);
_delay_ms(5000);
uart_char(0x1a);
_delay_ms(6000);
}
}}
rly soon..plz