Friend which place i am adding in ASM file these lines -select_phone_memory: .db "AT+CPMS=",'"',"ME",'"',0x0d,0 ;Select the phone memory ("ME")
with
select_phone_memory: .db "AT+CPMS=",'"',"SM",'"',0x0d,0 ;Select the phone memory ("ME")
or
select_phone_memory: .db "AT",0x0d,0 ;
;
;
; SMS REMOTE CONTROL, WITH SONY-ERICSSON GSM MODULE GM47
;
;
; written with AVR studio 4.12
;
;
; by Serasidis Vasilis
;
; Home:
https://www.serasidis.gr
; email:
info@serasidis.gr -
avrsite@yahoo.gr
;
;
; Target: ATtiny2313 with 4 MHz crystal
; PD0 = RxD
; PD1 = TxD
; PD2-PD5 = 4 RELAYS
; PB0-PB7 = 8 INPUTS.
;
; Created at 04.Jan.2006 by Vassilis Serasidis
; This source code is distributed under GNU public license (License file is included in the zip file).
; If you don't agree with the license, please do not use this file.
;
;
.equ BAUD =25 ;9600 bps at 4.00 MHz.
.equ RamStart =96 ;First RAM address byte.
.equ SMSC =100 ;RAM address for SMS Service Center
.equ TPDA =118 ;RAM address for Sender's number
.equ TimeDate =134 ;RAM address for Time and date of received SMS
.equ ASCII_HEX =185 ;RAM address for ASCII to HEX conversion
.equ SMScommand =150 ;RAM address for encoded SMS command (11001010)
.equ Relay1 =2
.equ Relay2 =3
.equ Relay3 =4
.equ Relay4 =5
.equ good =$10
.equ error =$20
.def eeadr =R17
;.def backup_status_register = r5
.def temp =R16 ;temporary storage register
.def Txbyte =R18 ;Data to be transmitted
.def Rxbyte =R19 ;Received data
.def temp2 =R20
.def temp3 =R21
.def temp4 =R22
.def No_of_relay =R22
.def output =R23
.def Byte_counter =R24
.def N
f_ignore_bytes =R25 ;
.def status =r26
.def delay1 =R26
.def delay2 =R27
.def YLramadr=R28
.def YHramadr=R29
.def delay3 =R29
.def ZLramadr=R30
.def ZHramadr=R31
.include "tn2313def.inc" ;Define chip particulars
;========================================================================
.org 0
rjmp reset
;.org OVF0addr ; Timer/Counter0 Overflow
; clr interrupt
; in backup_status_register,SREG
; inc interrupt
;
; ldi temp,0b11001100
; out portb,temp
; out SREG,backup_status_register
; reti
;*******************************************************************
;read_module_ID: .db "ATI" ,0x0d, 0 ;Show module's ID (GM47)
;enable_clip: .db "AT+CLIP=1" ,0X0d, 0 ;enable CLIP
select_phone_memory: .db "AT+CPMS=",'"',"ME",'"',0x0d,0 ;Select the phone memory ("ME")
set_text_mode: .db "AT+CMGF=1" ,0x0d,0,0 ;Select text mode
;enable_RI_on_SMS: .db "AT*E2SMSRI=1000" ,0x0d, 0 ;Enable Ring pin after incomming SMS.
Hide_SMS_details: .db "AT+CSDH=0", 0x0d,0,0 ;Show only phone number, date-time, text of SMS.
Read_received_sms: .db "AT+CMGR=1" ,0x0d,0,0 ;read the received message(Memory possition 1)
Send_SMS_command: .db "AT+CMGS=",0,0 ;Send SMS command
Delete_SMS: .db "AT+CMGD=1" ,0x0d,0,0 ;delete the received message (Memory possition 1)
Relay: .db "Relay", 0
cmdOut: .db "Input", 0
.db "SMS REMOTE CONTROL, FOR SONY-ERICSSON GSM MODULE GM47 "
.db "Written by Serasidis Vasilis at December 2005 "
.db "http://www.serasidis.gr
info@serasidis.gr -
avrsite@yahoo.gr"
.cseg
reset:
; Setup buffers and pointers
ldi temp,RAMEND
out SPL,temp ;Init Stack Pointer
ldi temp,0b00000000
out DDRB,temp
ldi temp,0b11111111
out portB,temp
ldi temp,0b11111110
out DDRD,temp
ldi temp,0b00000000
out portD,temp
;ldi temp,(1<<CS02)+(0<<CS01)+(1<<CS00)
;out TCCR0,temp ; Set clock to count on CK/1024
;ldi temp,(1<<TOIE0)
;out TIMSK,temp ; enable timer 0 overflow interrupt
ldi temp,BAUD
out UBRR,temp ;Set baud rate generator
;=========== Set UART, as Transmiter ======================
ldi temp,0b00011000
out UCR,temp ;Enable UART Tx and Rx
;==============================================================
;==============================================================
; Send command to module
;==============================================================
rcall long_delay
- - - Updated - - -
Dear Friend I con't compelling this getting ERROR'S
AVRASM: AVR macro assembler 2.1.2 (build 99 Nov 4 2005 09:35:05)
Copyright (C) 1995-2005 ATMEL Corporation
C:\Documents and Settings\ram\Desktop\New Folder (3)\HAI\HAI.asm(52): warning: Register r22 already defined by the .DEF directive
C:\Documents and Settings\ram\Desktop\New Folder (3)\HAI\HAI.asm(58): warning: Register r26 already defined by the .DEF directive
C:\Documents and Settings\ram\Desktop\New Folder (3)\HAI\HAI.asm(62): warning: Register r29 already defined by the .DEF directive
C:\Documents and Settings\ram\Desktop\New Folder (3)\HAI\HAI.asm(66): Including file 'C:\Program Files\Atmel\AVR Tools\AvrAssembler2\Appnotes\tn2313def.inc'
C:\Program Files\Atmel\AVR Tools\AvrAssembler2\Appnotes\tn2313def.inc(597): warning: Register r27 already defined by the .DEF directive
C:\Documents and Settings\ram\Desktop\New Folder (3)\HAI\HAI.asm(66): info: 'C:\Program Files\Atmel\AVR Tools\AvrAssembler2\Appnotes\tn2313def.inc' included from here
C:\Program Files\Atmel\AVR Tools\AvrAssembler2\Appnotes\tn2313def.inc(598): warning: Register r26 already defined by the .DEF directive
C:\Documents and Settings\ram\Desktop\New Folder (3)\HAI\HAI.asm(66): info: 'C:\Program Files\Atmel\AVR Tools\AvrAssembler2\Appnotes\tn2313def.inc' included from here
C:\Program Files\Atmel\AVR Tools\AvrAssembler2\Appnotes\tn2313def.inc(599): warning: Register r29 already defined by the .DEF directive
C:\Documents and Settings\ram\Desktop\New Folder (3)\HAI\HAI.asm(66): info: 'C:\Program Files\Atmel\AVR Tools\AvrAssembler2\Appnotes\tn2313def.inc' included from here
C:\Program Files\Atmel\AVR Tools\AvrAssembler2\Appnotes\tn2313def.inc(600): warning: Register r28 already defined by the .DEF directive
C:\Documents and Settings\ram\Desktop\New Folder (3)\HAI\HAI.asm(66): info: 'C:\Program Files\Atmel\AVR Tools\AvrAssembler2\Appnotes\tn2313def.inc' included from here
C:\Program Files\Atmel\AVR Tools\AvrAssembler2\Appnotes\tn2313def.inc(601): warning: Register r31 already defined by the .DEF directive
C:\Documents and Settings\ram\Desktop\New Folder (3)\HAI\HAI.asm(66): info: 'C:\Program Files\Atmel\AVR Tools\AvrAssembler2\Appnotes\tn2313def.inc' included from here
C:\Program Files\Atmel\AVR Tools\AvrAssembler2\Appnotes\tn2313def.inc(602): warning: Register r30 already defined by the .DEF directive
C:\Documents and Settings\ram\Desktop\New Folder (3)\HAI\HAI.asm(66): info: 'C:\Program Files\Atmel\AVR Tools\AvrAssembler2\Appnotes\tn2313def.inc' included from here
C:\Documents and Settings\ram\Desktop\New Folder (3)\HAI\HAI.asm(91): error: With: Unknown instruction or macro
C:\Documents and Settings\ram\Desktop\New Folder (3)\HAI\HAI.asm(92): error: Duplicate label: 'select_phone_memory'
C:\Documents and Settings\ram\Desktop\New Folder (3)\HAI\HAI.asm(90): info: previous definition of 'select_phone_memory'
Assembly failed, 2 errors, 9 warnings