پاسخ : مشکل با AVR و SIM 900
خب الان بریم سراغ حل مسئله چه کنیم؟؟ خصوصیتونو چک کنید
خب الان بریم سراغ حل مسئله چه کنیم؟؟ خصوصیتونو چک کنید
/*****************************************************
This program was produced by the
CodeWizardAVR V2.04.4a Advanced
Automatic Program Generator
© Copyright 1998-2009 Pavel Haiduc, HP InfoTech s.r.l.
http://www.hpinfotech.com
Project :
Version :
Date : 2013/07/27
Author : NeVaDa
Company :
Comments:
Chip type : ATmega32
Program type : Application
AVR Core Clock frequency: 11.059200 MHz
Memory model : Small
External RAM size : 0
Data Stack size : 512
*****************************************************/
#include <mega32.h>
#include <delay.h>
#asm
.equ __lcd_port=0x1B ;PORTA
#endasm
#include <lcd.h>
// Standard Input/Output functions
#include <stdio.h>
// Declare your global variables here
char Enter=13;
char double_quote=34;
char Ctrlz=26;
char TELL[12]="091*********";
void main(void)
{
PORTA=0x00;
DDRA=0xFF;
PORTD.5=1;
DDRD.5=0;
// Timer/Counter 0 initialization
// Clock source: System Clock
// Clock value: Timer 0 Stopped
// Mode: Normal top=FFh
// OC0 output: Disconnected
TCCR0=0x00;
TCNT0=0x00;
OCR0=0x00;
// Timer/Counter 1 initialization
// Clock source: System Clock
// Clock value: Timer1 Stopped
// Mode: Normal top=FFFFh
// OC1A output: Discon.
// OC1B output: Discon.
// Noise Canceler: Off
// Input Capture on Falling Edge
// Timer1 Overflow Interrupt: Off
// Input Capture Interrupt: Off
// Compare A Match Interrupt: Off
// Compare B Match Interrupt: Off
TCCR1A=0x00;
TCCR1B=0x00;
TCNT1H=0x00;
TCNT1L=0x00;
ICR1H=0x00;
ICR1L=0x00;
OCR1AH=0x00;
OCR1AL=0x00;
OCR1BH=0x00;
OCR1BL=0x00;
// Timer/Counter 2 initialization
// Clock source: System Clock
// Clock value: Timer2 Stopped
// Mode: Normal top=FFh
// OC2 output: Disconnected
ASSR=0x00;
TCCR2=0x00;
TCNT2=0x00;
OCR2=0x00;
// External Interrupt(s) initialization
// INT0: Off
// INT1: Off
// INT2: Off
MCUCR=0x00;
MCUCSR=0x00;
// Timer(s)/Counter(s) Interrupt(s) initialization
TIMSK=0x00;
// USART initialization
// Communication Parameters: 8 Data, 1 Stop, No Parity
// USART Receiver: On
// USART Transmitter: On
// USART Mode: Asynchronous
// USART Baud Rate: 9600
UCSRA=0x00;
UCSRB=0x18;
UCSRC=0x86;
UBRRH=0x00;
UBRRL=0x47;
// Analog Comparator initialization
// Analog Comparator: Off
// Analog Comparator Input Capture by Timer/Counter 1: Off
ACSR=0x80;
SFIOR=0x00;
lcd_init(16);
while (1)
{
lcd_putsf(" W E L C O M E");
delay_ms(1000);
lcd_clear();
if(PIND.5==0)
{
while(PIND.5==0);
delay_ms(20);
printf("at+cmgs=%c%s%c%c",double_quote,TELL,double_quote,Enter);
delay_ms(1000);
printf("MORTEZA %c",Ctrlz);
delay_ms(1000);
}
lcd_putsf(" F I N I S H ");
delay_ms(1000);
lcd_clear();
}
}
printf("%cat+cmgs=%c%s%c%c",10,double_quote,num,double_quote,13); //incomming_number , command_no while(getchar()!='>'); delay_ms(1000); printf("text of sms"); delay_ms(1000); putchar(a); //ctrl+z wait_to_get('O'); delay_ms(10); putchar(a); delay_ms(10); putchar(a); delay_ms(10); putchar(a);
دیدگاه