View previous topic :: View next topic |
Author |
Message |
krneki
Joined: 13 Feb 2007 Posts: 12
|
Posted: Sat Mar 01, 2008 1:10 am Post subject: Sending SMS over Siemens C45 |
|
|
Hi,
I have microcontroller with ATmega8 microprocessor and mobile phone Siemens C45. My object is to send SMS messages with ATmega8. I already connected them over RX and TX (pins 2 & 3) but Siemens just won't accept any AT command. For a beginning, I tried with some basic commands (mute, dial last call...) but nothing works. Here is my program:
$regfile = "m8def.dat"
$crystal = 4000000
$baud = 9600
$hwstack = 32
$swstack = 10
$framesize = 40
Config Serialin = Buffered , Size = 100
Dim In1 As Bit
Dim In2 As Bit
Dim In3 As Bit
Dim In4 As Bit
Dim In5 As Bit
In1 Alias Pind.0
In2 Alias Pind.1
In3 Alias Pind.2
In4 Alias Pind.3
In5 Alias Pind.4
Dim Out1 As Bit
Dim Out2 As Bit
Dim Out3 As Bit
Dim Out4 As Bit
Out1 Alias Portc.1
Out2 Alias Portc.0
Out3 Alias Portb.2
Out4 Alias Portb.1
Config Portb = &B11000111
'Portb = &00111000
Config Portc = &00000011
Portc = &B00000011
Config Portd = &B11100010
Portd = &B00011000
Config Lcdpin = Pin , Db4 = Portd.6 , Db5 = Portd.5 , Db6 = Portb.7 , Db7 = Portb.6 , E = Portd.7 , Rs = Portb.0
Config Lcd = 16 * 2
Do
Wait 1
Print "ATZ"
Waitms 200
Print "AT"
Waitms 200
Print "AT+CFUN=1"
Waitms 400
Print "ATDL"
Waitms 400
Print "AT+CGMR=?"
Waitms 400
Print "AT+CMUT=1"
Loop
End
Does anybody have any ideas, what could I do to fix this?
Thanks in advance.
Regards,
krneki |
|
Back to top |
|
|
KrasserMann
Joined: 24 Sep 2007 Posts: 48
|
Posted: Sat Mar 01, 2008 1:30 pm Post subject: |
|
|
Hi,
what makes you tho think that nothing hapens after sending an AT Command to your Mobile?
I cant see any code to receive the answer of your mobile phone. So you cant see what happens.
To send a TEXT SMS you need the following sequence
ATZ
if OK then
AT+CMGF=1 (Sets TEXT MODE)
if OK then
AT+CMGS=phonenumber <CR>
Data here
ctrl-z to send
if OK then
END
You should check the output of each command
And use the SEARCH Funktion of this forum there are working examples for your project.
Martin |
|
Back to top |
|
|
krneki
Joined: 13 Feb 2007 Posts: 12
|
Posted: Sat Mar 01, 2008 4:47 pm Post subject: |
|
|
I tried to use program from http://www.mcselec.com/index2.php?option=com_forum&Itemid=59&page=viewtopic&t=4635&highlight=siemens but it didn't work.
For a start, I would just like to send one basic command to Siemens (for example mute) and read with AT command if it's OK.
I tried with:
Code: | Dim I As Byte
Dim Y(1) As Byte
Dim Niz As String * 18
Print ;
For I = 2 To 19
Y(i) = 0
Next
Print "ATE0"
For I = 2 To 6
Y(i) = Waitkey()
Next
Lcd Niz
Wait 1
Lowerline
For I = 2 To 6
Lcdhex Y(i)
Next
End |
But it didn't work. Do you have any ideas what could I change? |
|
Back to top |
|
|
Gianni
Joined: 09 Jul 2004 Posts: 61 Location: Italy
|
Posted: Sun Mar 02, 2008 7:56 am Post subject: |
|
|
Hi.
instead of "$baud = 9600"
use "$baud = 19200"
Anyway you can connect the cellphone (with the serial adapter) to your PC serial port, and use hyperterminal to send command.
Regards |
|
Back to top |
|
|
|