PDA

View Full Version : Pic to GSM Phone connection (HSerin problems)



Pages : [1] 2

bitmaniac
- 21st January 2004, 11:45
Hi!

I am trying a project of remote control (SMS) using 16f628 connected to an Ericsson T10 mobile phone.
My problem is with the serial communication with the phone
I have tried everyting from software Serou/Serin to HSERIN/HDEROUT using build-in f628 USART.
Although Sending AT commands is ok receiving the reply from the phone is very difficult.
I think the phone response is too uick for picbasic to receive the stirng. What is your opinion. Is it possible from PBP Pro to cath-up the receiving data from the mobile?
(Using 9600,8,n,1) with no rs232-drivers - with inverted/noninverted modes -the same problem

Any ideas?

P.S: I have developed a PDU decoded with the pic. If it works properly I may public the code

Thank you all Pic-maniacs! :))

mcglacy
- 3rd February 2004, 09:48
It is difficult to use Ericsson try to use Nokia Phones..

try to visit this site maybe it can help you..

www.embedtronics.com

Mikkel
- 4th February 2004, 21:13
Hi I have had the same problem, mobiles are sometimes to fast

I use the GSM engine TC 35 from siemens they can run Normaly text but run to fast for a pic too.

so put in a larger crystal (8mhz)

set up your programmer to HS

if your settings is 9600 chose 2400 baud because at 8 MHZ it goes to faster
I use serin and a timeout seqenze so i can find the end of the message

If your modem can deal with slower speed auto matically
try to send some AT AT at a lower speed 1200 Baud

You won't fell the differnce since SMS messages are so short.


Best regards Mikkel Holm
I

Ioannis
- 12th February 2004, 21:22
I may help you but please give some more details, as what do you expect to receive from the phone and what do you receive?

Most of the times is a matter of sync problem.

Ioannis

NavMicroSystems
- 24th February 2004, 18:35
I have tried it using a NOKIA Phone and it works fine.

The Phone is connected to the HW-USART via MAX232
Baudrate: 9600 8N1

You need a clock spped of minimum 8MHz
(I'm using a 12MHz resonator)

-------------------------------------

DEFINE OSC 12

DEFINE HSER_TXSTA 20h
DEFINE HSER_RCSTA 90h
DEFINE HSER_BAUD 9600
DEFINE HSER_CLROERR 1

GSMBUFFER VAR BYTE[16]
Caller VAR BYTE[13]
GSMTime VAR BYTE[17]


'Send SMS Test-Message

HSerout ["ATZ",13,10]
Pause 1000

HSerout ["AT+CMGF=1",13,10] 'Set Text Mode
Pause 500

HSerout ["AT+CMGS=",34,"+491232456789",34,",129",13,10]
Pause 500

HSerout ["Test-Message",10,13]
HSerout [26]
Pause 500

' Check for new incomming Messages

HSerout ["ATZ",13,10]
Pause 1000

HSerout ["AT+CMGF=1",13,10]
Pause 1000

Loop:

'List new Messages
HSerout ["AT+CMGL",13,10]

' Read Caller ID, time and 16 CHARs of Message

' The timeout value in the HSERIN statement is important, it takes some time before the phone replies to the AT+CMGL command

HSerin 5000,loop,[wait("UNREAD"),skip 3,STR Caller\13,skip 4,STR GSMTime\17,skip 6, STR GSMBUFFER\16\13]

' --- Put your code to output the result here

' i.e. LCDOUT . . . .

Goto Loop:

-------------------------------------------------

There are certainly better ways to do the job, this was just a quick test and it works

bitmaniac
- 25th February 2004, 14:21
NavMicroSystems thanks!

I think I will go for Nokia phone as it would be better to handle!
Anyway does al Nokia supports Text mode or only PDU format?

P.S I have a PDU decode routine available -as soon as I will try it out I will make the code available.
:)

NavMicroSystems
- 25th February 2004, 14:42
Originally posted by bitmaniac
NavMicroSystems thanks!

I think I will go for Nokia phone as it would be better to handle!
Anyway does al Nokia supports Text mode or only PDU format?

P.S I have a PDU decode routine available -as soon as I will try it out I will make the code available.
:)

@ bitmaniac

As far as I know do all NOKIA phones with embedded Modem support the text mode.
I have successfully tested it on 62xx and 63xx series.

The TEXT mode is easier to handle than PDU mode and it certainly saves some code space.

anyway: I am interested in your PDU encoding / decoding routines.

rgds

Kypros
- 2nd March 2004, 06:48
Hi people,
I had implemented an interface with Ericsson and a 16F628 that worked fine.
I used a T65 model and pin 4 on the RS232 connector has to be driven high for the phone to accept and issue responces. For other models this can be different. Appart from pin 4, I used 3 more pins, Ground, TX and RX.
I used PDU mode due to the Ericsson and the fact that, any phone can be interfaced with virtually only hardware modifications.
I sample of my code is shown below:

@ DEVICE pic16F628, HS_OSC
' ---- High Speed Oscilator
@ DEVICE pic16F628, WDT_OFF
' ---- Watchdog Timer=OFF
@ DEVICE pic16F628, BOD_ON
' ---- Brown-Out Detect
@ DEVICE pic16F628, LVP_OFF
' ---- Low-Voltage Programming=OFF
@ DEVICE pic16F628, MCLR_OFF
' ---- Reset Pin=Internal
@ DEVICE pic16F628, PWRT_ON
' ---- Power-On Timer=Disabled
@ DEVICE pic16F628, CPD_OFF
' Data Memory Code Protect
' Set to CPD_OFF for Development Copy
@ DEVICE pic16F628, PROTECT_OFF
' Program Code Protection

INCLUDE "modedefs.bas"

' ******* Definitions *******
' ------------------------------

DEFINE OSC 16 ' Define clock Oscillator Frequency at 16Mhz
DEFINE HSER_RCSTA 90H ' Enable Hardware USART receive
DEFINE HSER_TXSTA 24H ' Set Hardware USART parameters
DEFINE HSER_BAUD 9600 ' Set baud rate to 9600
define HSER_CLROERR 1
CMCON=%00000111 ' Make PortA digital

' ****** Initialise PORTs ******
'----------------------------------

TRISA = %11110000 'Set PORTA status (Low byte=Output, for LEDs)
TRISB = %11100010 'Set PORTB status
PORTA = %00000000 ' Initial state of PORT A
PORTB = %00000000 ' Initial state of PORT B

' ****** Variables ******
'---------------------------

TXD VAR PORTA.0 ' Phone not responding
RXD VAR PORTA.1 ' Transmit to Phone
error VAR PORTA.2 ' Receive from Phone
deb var PORTA.3 ' Debugging led
relay0 VAR PORTB.3 ' First Relay
relay1 VAR PORTB.4 ' Second Relay
CALLER var byte[8] ' Callers ID Array
INSMS VAR BYTE[8] ' Incoming SMS message Array
cr con 13 ' Carriage Return character
lf con 10 ' Line Feed character
j var byte


goto start ' Jump to Main Program

' ****** SUBROUTINE AREA ******
' -------------------------------

meminit:
' Instract Phone to use it's own memory for storage and SMS manipulations
TXD = 1 ' Tx LED=ON
HSerout ["AT+CPMS=",34,"ME",34,44,34,"ME",34,44,34]
HSerout ["ME",34,cr] ' Command AT+CPMS="ME","ME","ME"
Pause 600
TXD = 0 ' TX LED=OFF
return

Some other ROUTINES reside here.......

' ****** MAIN PROGRAM AREA ******
' ----------------------------------

Start:
PAUSE 1000
TXD = 1 ' Tx LED=ON
HSerout ["at",cr] ' <----- Check for Phone presence
RXD = 1 ' Rx LED=ON
HSerin 400,nophone,[wait ("OK")]
Pause 500
TXD = 0 : RXD = 0 ' Tx & Rx LEDs=OFF

TXD = 1
hserout ["AT+CMGF=0",cr] ' <----- Initiate PDU Format
pause 400 ' Not needed for Ericsson Phones
' hserout ["ATE0",cr] ' <----- Turn Echo OFF
' pause 200
TXD = 0

Gosub meminit ' <----- Initialise Phone's SMS memory

TXD = 1
hserout ["AT+CSAS",cr] ' <----- SAVE SETTINGS
PAUSE 400
TXD = 0

' ++++ Read from Phone ++++
' -------------------------
GOSUB meminit
pause 3000
TXD = 1
HSerout ["AT+CMGL=0",cr] ' <----- Read Received and Unread Incoming messages.
TXD = 0
pause 2
RXD = 1
Hserin 800, msg_old , [wait ("+CMGL:")] ' If no +CMGL then no new SMS was read
hserin [skip 36, str caller\8 , skip 20, str insms \8]
RXD = 0
'GOSUB eepwrite
gosub meminit ' <----- Initialise Phone's SMS memory
hserout ["AT+CMGD=1",cr] ' <----- Delete the "read message" (First SMS)
pause 200


I do not decode the PDU but I use it ready made :) All the messages were sent and read from phone via HyperTerminal. The resulting PDU coded message was used. an example is shown below.

++++ An Unrecognised command was received ++++
' ----------------------------------------------
PAUSE 400
GOSUB meminit
TXD = 1 : deb = 1 : PAUSE 500
HSerout ["at+cmgs=33",cr] ' Intraction to Phone to send SMS in PDU mode
Pause 500 ' "Unrecognised Command" Message
HSerout ["0011000B915397490185F80000AA1455B7BC3C7E9FDDE97999 0C1ABEDBEDB09BEC02",26,cr,lf] ' PDU message of 33 bytes.


I hope that I helped a bit
Regards

Kypros V.

P.S. If you developed a PDU decoding code I woould appriciate if you share it.

brenda
- 5th March 2004, 19:09
hi,

is there any AT COMMAND to check the time of a nokia 6210.


thanks,
brenda

NavMicroSystems
- 5th March 2004, 23:25
Hi Brenda,

unfortunately there is no such AT-command.

If your intention is to set an RTC on your PIC-board connected to the Phone you could do the following:

as soon as you have received a new SMS-message write your RTC-time to some variables.

now you have got plenty of time to decode the SMS-message.
The message header contains the time it was delivered by the server.
comparing this to your RTCs time gives you the offset you need to correct the RTC.

This is certainly not perfect in terms of accuracy, but far better (+/- 1 min) than the long term accuracy of an RTC with a non-compensated clock.

rgds.

brenda
- 6th March 2004, 07:03
thanks! That was a good idea which I didn't think off. I'll try it today.

regards,

bitmaniac
- 19th March 2004, 08:10
finally here is the forum linkfor the pdu encoding.decoding routine for anyone that is interested

http://www.picbasic.co.uk/forum/showthread.php?s=&threadid=305

Kypros
- 19th March 2004, 12:05
Many many thanks bitmaniac.
Regards
Kypros

NavMicroSystems
- 19th March 2004, 14:07
Thanks bitmaniac !

I'll give it a try this weekend.

rgds

brenda
- 20th March 2004, 20:03
Anybody knows at command for Flash SMS.. i.e.. recipient will recieve tha sms direct to screen without opening it.

Thankx!
Brenda

Kypros
- 22nd March 2004, 06:53
Hi brenda,
There is no AT command for this. You have to use PDU mode in order to send FLASH SMS. First you must undertand how PDU works, then you should know that this function is not supported by all phones.

Try http://www.traud.de/gsm/ and http://www.dreamfabric.com/sms/
for more information on Flash messaging and PDU mode.

Regards
Kypros

brenda
- 23rd March 2004, 19:23
hi kypros,

thanks for the info. I think I have to study Pdu format as what you and everybody recommend. Nice site!!! thanks again!

brenda

brenda
- 27th March 2004, 20:13
Hi kyprus and everybody,

Well, Its really hard to understand PDU format but I manage to understand it. Now I can send a Flash SMS. Cheers!!!! I found a nice PDU converter by Peter Sandstrom.

http://www.spaceorbit.net/peter/projects/microguard_mark1/index.html

Another question:
How about sending Picture message?

Regards,

brenda

Darrenmac
- 8th April 2004, 06:44
I have tried sending a SMS on a nokia 6210 with a 16f84A ( only micro I had at the time) the osc was only at 4MHz. As I was only sending AT commands I thought it would be ok. The sequence seems to hang before the SMS is completed. Has anyone tried this with a 16f84a at 4MHz?

Kypros
- 9th April 2004, 10:39
Hi Darrenmac,
how do you determine tha the sequence hangs?
I sugest that you send a simple AT command and capture the answer as a first step.
In my code example as published is:
HSerout ["at",cr] ' <----- Check for Phone presence

HSerin 400,nophone,[wait ("OK")]
Pause 500

Just convert it to SEROUT and SERIN commands since 16F84 does not have a hardware USART.
In the above example, a sent an AT command followed by a Carriage Return character and then waited for 400 ms for the phone to respond with an “OK”. If within the 400 ms there is no answer (meaning that the phone does not respond) then program execution would continue at label “nophone” where I use a small code to indicate phone absence.

Further to the above, I suggest you test communication at various speeds, baud rates. Try 9600 which is the standard and on unsuccessful results move down to lower speeds.
You can also check your cable connection or the levels on your RS232 interface. Also check if you need to use True or Inverted mode in your SEROUT lines.
I haven used the 16F84 but I cannot see any reason why it should not work ok.

Regards
Kypros

Darrenmac
- 12th April 2004, 13:05
Thanks for the advice Kypros, I found the problem to be the lack of a comma. I found the program to be hanging by add in a couple of leds and some toggle commands between at commands.
I used the debug command instead of the serout as I could not get the serout to work properly for some strange reason.

Bulman
- 19th July 2004, 20:24
Hi.

Where can I find the Nokia protocol? I can't understand what are the AT commands for? Where can I find a comprehensive info about the commands like:
AT
AT+CMGF=1
AT+CMGL
ATZ
AT+CMGS
etc.
I would like to understand the NavMicroSystems's program, but I can't without the protocol.
Please give me some usefull links, bacause I would also like to control my PIC with a SMS.

Thanks

NavMicroSystems
- 19th July 2004, 20:58
GOOGLE:

NOKIA AT COMMANDS

and you will find all you need.

rgds.

Bulman
- 21st July 2004, 11:24
Hi NavMicroSystems

Thanx for the point.
I still can’t understand some of your ideas, therefore I rewrote your program in a way that I think it should be. I wrote my questions like comments next to the lines which I can’t get. So could you please take a look and answer the questions.
And do you think that this program could be used with all Nokia phones with embedded modems, or it’s for the 62xx series only?

Regards



DEFINE OSC 20

DEFINE HSER_TXSTA 24h
DEFINE HSER_RCSTA 90h
DEFINE HSER_BAUD 115200
DEFINE HSER_CLROERR 1

GSMbuffer var Byte [12]
Caller var Byte [12]
GSMtime var Byte [17]

‘Check the connection between the phone and PIC works. Should ‘give OK. Instead you’ve used ATZ, why?

Hserout [“AT”, 13, 10]
Pause 1000

HSerout ["AT+CMGF=1", 13, 10] 'Set Text Mode. Answer: OK
Pause 500

Hserout [“AT+CMGS=”, 34, “+359888123456”, 34, 13, 10] ‘Answer: >
‘Why have you put “,129” in addition. I think it’s not nessesary.

Pause 500

Hserout [“Test-message”, 13, 10]

‘Terminate the SMS by Control+Z
‘Here you send ASCII 26 => SUB. Is it equal with CTRL+Z?
Hserout [26]
‘Answer: +CMGS: 125 - the ord. number of the SMS (0-‘255)
Pause 500

' Check for new incomming Messages

HSerout ["AT", 13, 10] ‘Check the connection
Pause 1000

HSerout ["AT+CMGF=1", 13, 10]
Pause 1000

Loop:
‘list new unread messages
Hserout [“AT+CMGL=”, 34, “REC UNREAD”, 34, 13, 10]
‘Optionally: "REC READ", "ALL"
‘Or it must be HSerout ["AT+CMGL",13,10] ?

‘Answer in 3 lines should look like this:
‘+CMGL: 1,"REC UNREAD","+359888123456",,"04/07/21,08:03:05-00"
‘Test-message
‘OK

HSerin 5000, Loop, [Wait("UNREAD"), skip 3, STR Caller\12, skip 4, STR GSMTime\17, skip 4, STR GSMbuffer\12]
‘You ‘ve written skip 6 before STR GSMuffer\12 but I think it ‘should 'be skip 4? Then you used GSMBUFFER\16\13, which must be 'GSMbuffer\12. Am I right? What \16\13 does mean?

' --- Put your code to output the result here

' i.e. LCDOUT . . . .

‘Delete the processed SMS:
Hserout [“AT+CMGD=1”, 13, 10]

Goto Loop

NavMicroSystems
- 21st July 2004, 13:15
@ Bulman


I still can’t understand some of your ideas,
therefore I rewrote your program in a way that I think it should be.
--> My code example is a working program, have you given it a try?

I wrote my questions like comments next to the lines which I can’t get. So could you please take a look and answer the questions.
And do you think that this program could be used with all Nokia phones with embedded modems, or it’s for the 62xx series only?
--> I have tested it on 62xx and 63xx series,
--> according to the NOKIA documentation
--> it should work on any model with embedded modem.


--------------------------------------

DEFINE OSC 20

DEFINE HSER_TXSTA 24h
DEFINE HSER_RCSTA 90h
DEFINE HSER_BAUD 115200
--> I couldn't establish a reliable connection to the phone faster than 9600
--> and 9600 is certainly fast enough to transfer those few bytes
DEFINE HSER_CLROERR 1

GSMbuffer var Byte [12]
Caller var Byte [12]
GSMtime var Byte [17]


‘Check the connection between the phone and PIC works. Should ‘give OK. Instead you’ve used ATZ, why?
--> You are right, a simple AT would do the same job at this point

Hserout [“AT”, 13, 10]
Pause 1000

HSerout ["AT+CMGF=1", 13, 10] 'Set Text Mode. Answer: OK
Pause 500

Hserout [“AT+CMGS=”, 34, “+359888123456”, 34, 13, 10] ‘Answer: >
‘Why have you put “,129” in addition. I think it’s not nessesary.
--> "129" is the "TYPE" (See NOKIA AT COMMANDS)

Pause 500

Hserout [“Test-message”, 13, 10]

‘Terminate the SMS by Control+Z
‘Here you send ASCII 26 => SUB. Is it equal with CTRL+Z?
Hserout [26]
--> ASCII 26 is equal to CTRL+Z

‘Answer: +CMGS: 125 - the ord. number of the SMS (0-‘255)
Pause 500

' Check for new incomming Messages

HSerout ["AT", 13, 10] ‘Check the connection
Pause 1000

HSerout ["AT+CMGF=1", 13, 10]
Pause 1000

Loop:
‘list new unread messages
Hserout [“AT+CMGL=”, 34, “REC UNREAD”, 34, 13, 10]
--> Lists all unread (new) messages
‘Optionally: "REC READ", "ALL"
--> I'm only interested in new "UNREAD" messages
--> already processed MSGs have been deleted
‘Or it must be HSerout ["AT+CMGL",13,10] ?

‘Answer in 3 lines should look like this:
‘+CMGL: 1,"REC UNREAD","+359888123456",,"04/07/21,08:03:05-00"
‘Test-message
‘OK

HSerin 5000, Loop, [Wait("UNREAD"), skip 3, STR Caller\12, skip 4, STR GSMTime\17, skip 4, STR GSMbuffer\12]
‘You ‘ve written skip 6 before STR GSMuffer\12 but I think it ‘should 'be skip 4?
--> There are two additional bytes to be skipped at the end of the first line (CR LF)

Then you used GSMBUFFER\16\13, which must be 'GSMbuffer\12. Am I right?
--> I did want to read the first 16 chars of the received message, --> GSMbuffer\16

What \16\13 does mean?
--> See PBP Manual Section 5.30
--> stop reading if chr(13) is received if no chr(13) read max 16 chars

' --- Put your code to output the result here

' i.e. LCDOUT . . . .

‘Delete the processed SMS:
Hserout [“AT+CMGD=1”, 13, 10]
--> This is exactly what I would do after the MSG has been processed

Goto Loop

--------------------------------------
regards

Bulman
- 23rd July 2004, 20:54
Thank you very much NavMicroSystems.
I'm gonna bye a Nokia and do some test.

Thanx again.
Bye.

NavMicroSystems
- 23rd July 2004, 21:51
@ Bulman

before you buy a mobile phone
you should have a look at at the SIEMENS TC35i GSM Terminal.
It is more reliable and has more features.
(i.e. remote reset and remote power on/off)

The TC35i is available at about 150 EUR (or even less)

see: siemens.com.

rgds.

LazBoy
- 3rd September 2004, 22:15
Hi,

I have Nokia 7110 and MBUS/FBUS dual data cable.
(home made) I can use some Nokia GSM control
softwares with it. (Oxygen Phone Manager, LogoManager etc)

But, when I want to use with Hyper Terminal for AT commands,
the phone does not answer. I am planning for secure use with
PIC mController. But after PC tests.

What is the wrong ? Any idea for this ?

Darrenmac
- 4th September 2004, 06:01
sounds like the data lead is working in one mode but not the other. I have 2 seperate cables, the one I use for Logo manager is different from the one I use for sms or interconect connection

Ioannis
- 4th September 2004, 12:04
May be if you type the ATE1 command enables the echo?

Ioannis

LazBoy
- 6th September 2004, 11:30
I just learned that Nokia 7110 has not an embedded modem.
A software driver or DLR-3P cable required.
I am planning to use Siemens C55.
Thanks,

brenda
- 10th September 2004, 15:24
Hello there!

Anybody knows how to restart a nokia 6210 thru AT COMMAND or PDU format. Logo Manager has a provision for that.

Thanks in advance
Brenda

stu746
- 18th October 2004, 19:19
gonna get a second hand 6210 to have a play at this :)

do i need to use a max232 or will i be able to hook straight up to a mobile and just use the serin and serout commands?

Bulman
- 18th October 2004, 19:35
Nope. Nokia uses the Fbus. You must bye a RS232-to-Fbus converter, or make your own.
See this link for additional info:
http://www.panuworld.net/nuukiaworld/hardware/cables/basics.htm

Regards
Boyko

stu746
- 18th December 2004, 14:39
hi, got a nokia 6210 and a dlr-3p cable

tried it with hyperterminal with the pc and works fine.

i tried connecting pins 2,3 and 5 (rx,tx and gnd) to the pic and could not get it to work, i just tried connecting it to the pc with just the 3 pins connected and it would not work?

any ideas? i thought i only needed to connect the 3 wires?

NavMicroSystems
- 18th December 2004, 15:22
It is correct, to communicate with the phone you only need RX, TX and GND.

But the Data cable has some embedded logic that is powered from the DB9 connector DTR and/or RTS pin.

regards

Ralph

stu746
- 18th December 2004, 16:17
so if i connect the dtr pin to 5v it should work?

NavMicroSystems
- 18th December 2004, 16:29
Try it with both RTS and DTR on the data cable connected to +5V.

If this doesn't work you may need a higher voltage (up to +12V)

regards

Ralph

stu746
- 18th December 2004, 18:13
not having much luck with this, have u dont this with a 6210 and dlr-3p cable yourself, or has anyone else who can let me know what they did?

thanks, Stu

NavMicroSystems
- 18th December 2004, 18:54
I can't tell wether the "Taiwan-Cable" I have used was a "DLR-3P" type or something else.

But I think it does not really matter as you are saying your cable works with "HyperTerm".

Do you have a DB9 "Breakout-Box" handy?

If so:
connect your DLR-3P cable to your PC across "Breakout-Box"
and find out which pins are really needed by checking communication with "Hyperterm"

Once you have identified the Pins check the Voltage Level at the "Supply" pins (DTR and/or RTS) it is most likely something between +10 an +12 V.

Connect RX, TX and GND to your PIC
and supply the identified "supply"-pins with the correct voltage.

Assuming your PIC-code is ok, It should work.

If it doesn't work, try to communicate with your PIC using "Hyperterm"
and debug the PIC code.

Questions:

What type of PIC are ypu using?

Are you using the HW USART and HSERIN/HSEROUT?

Do you have a "MAX232" type of level shifter connected to the PIC?

What is the PICs clock speed?
(9600 Baud won't work with a 4MHz clock.)

regards

Ralph

stu746
- 18th December 2004, 19:06
i tried connecting the dlr3p to the pc with all the cables needed, i then tried connection the rx, tx and gnd to the pic leaving the others connected to the pc.

i am just trying to send

Serout portb.5,n9600,["atd 453",13,10]

this sends fine to hyperterminal but noting on the phone

if i send this from hyperterminal the phone screen changes to calling 453 - so i know it is working

i am using a 16f877a at 4hz, it works at 9600 with the pc? i have also tried 2400

the pc works at 2400 with the 6210

i dont seem to be getting anywhere :(

NavMicroSystems
- 18th December 2004, 19:26
Originally posted by stu746
i tried connecting the dlr3p to the pc with all the cables needed, i then tried connection the rx, tx and gnd to the pic leaving the others connected to the pc.

i am just trying to send

Serout portb.5,n9600,["atd 453",13,10]

this sends fine to hyperterminal but noting on the phone

if i send this from hyperterminal the phone screen changes to calling 453 - so i know it is working

i am using a 16f877a at 4hz, it works at 9600 with the pc? i have also tried 2400

the pc works at 2400 with the 6210

i dont seem to be getting anywhere :(

Just another question that pops up:

Assuming you have DB9 connectors at both ends (PIC and PC)
are you using a "Null-Modem" when connecting the the Phone to the PIC?

regards

Ralph

stu746
- 19th December 2004, 12:30
have now changed to a 20mhz xtal and i am using a max232 with hserout, with just connecting rx,tx and gnd i am getting the phone to echo back characters!?

but when i tried hserout["atd 453",13,10]
it does nothing

i figured out with the pc connected to the phone it also needs dtr and rts connected together and to one of the pins that supplies 10v

i tried connecting these to the spare output on the max232 and could not even get it to echo stuff back : (

when i connect the pic to the pc with the max232 it works fine and sends the atd 453 command at 9600

i am not using a null modem cable

although i did measure the voltage from the max232 and it was only 7.6v? rather than 10v? i tried changing the caps with no effect

can anyone please help!? : )

NavMicroSystems
- 19th December 2004, 13:23
stu,

could you post your code and schematic?

without it all we can do is guessing.

regatds

Ralph

stu746
- 19th December 2004, 18:51
here is the code, it is a bit of a mess, the main thing i want it to do is call the number with the first hersout, then i can see on the phone that it is working

the hardware is just a basic max232 setup with a 16f877 at 20hz.

my cable is an original nokia one, i am thinking of gettin a cheap copy to see if it any better, it might not be so fussy about what voltage it requires?

thanks for try to help, Stu


DEFINE OSC 20

DEFINE HSER_TXSTA 20h
DEFINE HSER_RCSTA 90h
DEFINE HSER_BAUD 9600
DEFINE HSER_CLROERR 1


adCON1 = 7

Include "modedefs.bas" ' Include serial modes

B0 var byte

pause 2000


hserout["atd 453",13,10]

loop:

hserout["at",13,10]
hSerin [b0]
pause 3000

Lcdout b0

Goto loop

NavMicroSystems
- 19th December 2004, 19:36
Have you tried this code with the PIC connected to your PC running Hyperterm at 9600 Baud?

You should see: atd 453
in the terminal window when you start the PIC.

Once you have got this working you can be sure your Hardware is ok.

You are saying you have already tested the phone and datacable with Hyperterm and it's working.

Are you sure you are connecting
for PIC to PC:
TX from the MAX232 to RX on the PC
RX from the MAX232 to TX on the PC

for PIC to Phone:
TX from the MAX232 to RX on the DataCable
RX from the MAX232 to TX on the DataCable


Before trying to communicate with the phone try to establish a bidirectional communication between PIC and PC.
as long as you haven't got this working there is something wrong in general,
and it doesen't make much sense to connect the PIC to the phone.


regards

Ralph

stu746
- 19th December 2004, 22:01
yes works fine with hyperterminal

NavMicroSystems
- 19th December 2004, 22:52
stu746

check PM

stu746
- 22nd December 2004, 21:11
hi again :)

finally got this working with the circuit from here

http://www.atrox.at/datacable/dlr3/index.html

i omitted the max232 and just wired the rx and tx to the resistors

the following works great
serout2 portb.5, 396,["atz",cr]
serout2 portb.5, 396,["atd +447890563875;",cr]

but when trying to get a response from the pic with the following it just hangs

serout2 portb.5, 396,["atz",cr]
serin2 portb.4,396,[wait("ok")]


so i tried

serout2 portb.5, 396,["a"]
serin2 portb.4, 396,[b0]
Lcdout b0

and it did echo back the a, so i do have 2 way comms

anyone have any idea how best to get an ok back from the phone?

thanks, Stu

Ioannis
- 1st January 2005, 16:13
I suppose that serin is slow in response and your phone answers too early to wait for the 'ok'.

Solutions:

1. Use Hserin that has also 2 bytes buffer, or

2. Use numeric response from the phone (ATV0). That way you only have to wait for the 0 but for OK or 4 for error etc.

I 'd use Hserin though.

Ioannis

jojokatada
- 8th February 2005, 13:35
hi Everybody


is it possible to send an AT command through Hyperterminal using DAU-9P data cable and nokia 5110 or 3310 or 7110

charudatt
- 10th February 2005, 21:04
Having gone thru the entire thread , I am now planning to buy a Nokia Which is AT command enabled and experiment with it.

Any site or info which shows me which of the phones are AT Command enabled.

Thank you.

stu746
- 11th February 2005, 14:02
I used a nokia 6210 and worked great once i got it working :) could not get it to work with the nokia dlr3p cable but i made my own in the end and it worked fine

i got it to send sms messages but it is alot cheaper to just have the phone make a call and hang up, unless there is a message you need to send or you get free sms.

jojokatada
- 12th February 2005, 06:20
Originally posted by stu746
I used a nokia 6210 and worked great once i got it working :) could not get it to work with the nokia dlr3p cable but i made my own in the end and it worked fine

i got it to send sms messages but it is alot cheaper to just have the phone make a call and hang up, unless there is a message you need to send or you get free sms.


hi the dlr3p is it used with the pic16f84a or just only max232. see in the web someone make a dlr3p but can't download the hex file

could you share your schematic of the dlr3p

stu746
- 12th February 2005, 13:33
I used the schematic from this site

http://www.atrox.at/datacable/dlr3/index.html

but i did not need the max232 to connect to a pic

jojokatada
- 13th February 2005, 01:55
yes i know that website but they are not giving the hex file source code for the pic16f84a

how do you get the hex file? copy and paste?

stu746
- 13th February 2005, 10:00
just right click - save as

NavMicroSystems
- 12th April 2005, 20:06
Dear Forum Members,

I will defititely no longer reply to any PM's regarding this thread.

All information you need to get started can be found here.

NavMicroSystems
- 13th April 2005, 14:40
Again:

Please stop sending PMs asking: would Phone Model X work?

I definitely don't know all brands and models available on the market.
And I don't know the pinouts of all those different connectors.

Further down on this thread there is a working code example that can easily be modified for a different PIC type or Phone type.

If the documentation of your specific phone says it has an embedded modem you should be able to get it working.

First try it in Hyperterm, it doesnt make much sense to hook the GSM up to the PIC as long as you havent figured out what the Comms parameters should look like.

If you try the code example with a phone other than mentioned in that posting chances are it will work, but YOU will certainly have to do some homework.
(I'm not going to do it for you)

I'm sure if you google for your particular phone model you will find more descriptions of connectors and interfaces than you'll ever need.

mister_e
- 13th April 2005, 17:47
For some pinout, i think, i'm not familiar with this kind of task, you can find about everything on GsmForum (http://forum.gsmhosting.com/vbb/index.php)

brenda
- 16th April 2005, 01:47
Hi,
Visit picbasic.org/forum, I've seen a very nice project.

Brenda

aruran
- 18th April 2005, 07:55
According to Stu's post (#49). I am indeed need of that modified circuit. Can I do it for Nokia 7250i. Since the MBUS pins are connected.


thanks in advance
aruran

aruran
- 18th April 2005, 11:21
Hello, I am new to this field...
I want the modified schematic you said that worked in the following quoted message. If you can send it to me, it will be a great help..


thanking you
aruran


hi again :)

finally got this working with the circuit from here

http://www.atrox.at/datacable/dlr3/index.html

i omitted the max232 and just wired the rx and tx to the resistors

the following works great
serout2 portb.5, 396,["atz",cr]
serout2 portb.5, 396,["atd +447890563875;",cr]

but when trying to get a response from the pic with the following it just hangs

serout2 portb.5, 396,["atz",cr]
serin2 portb.4,396,[wait("ok")]


so i tried

serout2 portb.5, 396,["a"]
serin2 portb.4, 396,[b0]
Lcdout b0

and it did echo back the a, so i do have 2 way comms

anyone have any idea how best to get an ok back from the phone?

thanks, Stu

kasamiko
- 19th April 2005, 19:13
I have tried it using a NOKIA Phone and it works fine.

The Phone is connected to the HW-USART via MAX232
Baudrate: 9600 8N1

You need a clock spped of minimum 8MHz
(I'm using a 12MHz resonator)

-------------------------------------

DEFINE OSC 12

DEFINE HSER_TXSTA 20h
DEFINE HSER_RCSTA 90h
DEFINE HSER_BAUD 9600
DEFINE HSER_CLROERR 1

GSMBUFFER VAR BYTE[16]
Caller VAR BYTE[13]
GSMTime VAR BYTE[17]


'Send SMS Test-Message

HSerout ["ATZ",13,10]
Pause 1000

HSerout ["AT+CMGF=1",13,10] 'Set Text Mode
Pause 500

HSerout ["AT+CMGS=",34,"+491232456789",34,",129",13,10]
Pause 500

HSerout ["Test-Message",10,13]
HSerout [26]
Pause 500

' Check for new incomming Messages

HSerout ["ATZ",13,10]
Pause 1000

HSerout ["AT+CMGF=1",13,10]
Pause 1000

Loop:

'List new Messages
HSerout ["AT+CMGL",13,10]

' Read Caller ID, time and 16 CHARs of Message

' The timeout value in the HSERIN statement is important, it takes some time before the phone replies to the AT+CMGL command

HSerin 5000,loop,[wait("UNREAD"),skip 3,STR Caller\13,skip 4,STR GSMTime\17,skip 6, STR GSMBUFFER\16\13]

' --- Put your code to output the result here

' i.e. LCDOUT . . . .

Goto Loop:

-------------------------------------------------

There are certainly better ways to do the job, this was just a quick test and it works
This is my first post..pls be gentle..
Will this code applicable to PIC16F84A using an 8 mhz xtal?

mister_e
- 19th April 2005, 22:59
you'll have to do some modification before. Ralph's favourite 16F84a have no internal USART. Wich mean that, at least, you'll need to change HSEROUT, HSERIN for an equivalent SERIN,SERIN2,SEROUT,SEROUT2

Once it will be done... it's suppose to work fine.

NavMicroSystems
- 20th April 2005, 01:22
..,Ralph's favourite 16F84a have no internal USART. Wich mean that, at least, you'll need to change HSEROUT, HSERIN for an equivalent SERIN,SERIN2,SEROUT,SEROUT2


Steve, thanks for the reminder ;-)

As you can see, many beginners are giving themselves a hard time by starting with that "great" F84 while life could be so easy with one of the recent 18pin types.

I guess one of the reasons is because my favourite is mentioned in so many (outdated) books and manuals.

(Even in the lastest issue of the PBP Manual)

mister_e
- 20th April 2005, 04:47
Ralph,
in addition to that, this awesome F84 is one of the first flash device from Microchip and can still be found everywhere and at local electronic parts provider... like 12C508

for the remainder, you know why i did it ;)

kasamiko
- 20th April 2005, 05:40
And it is also weird.....
It's the ONLY PIC available in our electronics store!!!
That's why I have no choice...

BTW:
Is there a FREE PicBasic compiler and some links for tutorials??

Thanks

aruran
- 20th April 2005, 05:58
Sorry to ask you all again. I didn't quite get it Mr.kasamiko since the phone's voltages are little lesser

than 5V. So why the hell we should use max232 to connect to the pic. I didn't quite understand it. I thought

if I connect it to the PIC directly through the interface given http://www.atrox.at/datacable/dlr3/index.html

But I am not farely clear what pins I should omitt. I thought that the phone's MBUS and GND are the only pins connected. As posted by stu746 I didn't realy understand the circuit modification. Enybody please help me......? If you could send me the circuit for any nokia connecting to a PIC only would be of immense help.
I will be greatful to you all

regards
aruran

Ioannis
- 21st April 2005, 07:21
On the above code:

HSerin 5000,loop,[wait("UNREAD"),skip 3,STR Caller\13,skip 4,STR GSMTime\17,skip 6, STR GSMBUFFER\16\13]

it would be good to change UNREAD to READ since the phone can answer also "REC READ" or other "READ" messages.

Ioannis

kasamiko
- 21st April 2005, 08:02
Sorry to ask you all again. I didn't quite get it Mr.kasamiko since the phone's voltages are little lesser

than 5V. So why the hell we should use max232 to connect to the pic. I didn't quite understand it. I thought

if I connect it to the PIC directly through the interface given http://www.atrox.at/datacable/dlr3/index.html

But I am not farely clear what pins I should omitt. I thought that the phone's MBUS and GND are the only pins connected. As posted by stu746 I didn't realy understand the circuit modification. Enybody please help me......? If you could send me the circuit for any nokia connecting to a PIC only would be of immense help.
I will be greatful to you all

regards
aruran

MAX232 was used on that circuit since it was designed to be used for PC. If you're planning to use that as stand-alone on Nokia's like 6210, you can omit MAX232..
I have a circuit to be connected for 6210 but I dont have a code for PIC to have it receive an SMS then activate a relay.
What I need is a PIC16F84 with 8 mhz xtal and can drive a 4 relay when it received an SMS command..
I know sa AT commands for Nokia but don't know how would I start it..
Any sample codes will be appreciated.
TIA

kasamiko
- 21st April 2005, 09:04
On the above code:

HSerin 5000,loop,[wait("UNREAD"),skip 3,STR Caller\13,skip 4,STR GSMTime\17,skip 6, STR GSMBUFFER\16\13]

it would be good to change UNREAD to READ since the phone can answer also "REC READ" or other "READ" messages.

Ioannis

What is the purposed of this code modification? and in what particular above code?
Thanks

NavMicroSystems
- 21st April 2005, 11:06
kasamiko,

see comments (http://www.picbasic.co.uk/forum/showpost.php?p=2101&postcount=25)

As I was interrested in "NEW" Messages only (the ones I had not already taken action on) "UNREAD" was correct.

aruran
- 21st April 2005, 17:31
It seems though everybody are ignoring my problem. Please take a minute to help me.

thanks
aruran

NavMicroSystems
- 21st April 2005, 19:14
It seems though everybody are ignoring my problem...
Have you yet asked yourself why?


...Please take a minute to help me.
Have you taken some time to read this thread from the beginning and checked the links posted here ?

aruran
- 22nd April 2005, 10:39
Hi NavMicroSystems

My aim is to send SMS using a Nokia 7250i phone using a PIC microcontroller most probably 16F877A, since

it has hardware USART

I went through entire thread from page 1 to 2. The problems I faced can be listed as follows


1) I am a beginner so the schematic Stu746 told, had me in some dilema
I thought only modifications to be done are to omit the PC part with two MAx232 ICs

2) I have a Nokia 7250i : which has an embedded modem as I learnt from Nokia website - Solved
But I have a DAU 9P-FBSU cable which I use to connect my phone with other third party

softwares and it is successful. But using Hyperterminal it is not responing to any AT commands. Do I

need an DLR 3P cable. How can I do it with my DAU 9P FBUS cable...?

3) To my knowledge phone voltages are between 3.6 and 5V so why we need a MAX232 IC to connect

the phone to a PIC. We may need it in case we are connecting it to PC COM port. where voltages are

between +15 and -15V. This contradicted with the NavMicrosystems post on 24th February 2004, 22:05

Unless of course you are using the phone datacable inbetween !.

For your reference I have attached the circuit I built.

regards
aruran

NavMicroSystems
- 22nd April 2005, 12:16
aruran,

I'm sorry, but I really can't tell which cable to use with the 7250i.

For my tests I used a 6210 with a standard (NoName) Data cable.

All I can tell is:
If your Phone doesn't respond to AT-commands sent from Hyperterm there is most likely something wrong with your cable.
I had two different cables, one did work, the second one didn't. I haven't taken the time to investigate in detail what the difference between them was.

To find out which cable works with your particular phone (or how to build your own) I guess you will have a better chance on one of the many GSM-Forums.

aruran
- 23rd April 2005, 12:42
Navmicrosystems,

So If I build the circuit I attached in my last post, it should work is it. Of course connecting the MBUS properly to my Nokia 7250i

sufian
- 23rd April 2005, 19:40
Hi
I designed a datacable for Ericsson T28
I used a max3232 in this cable
I connect the com of the computer to Ericsson though this cable
and the result on the Hyper terminal was : the program of the mobile show on the hyper terminal and this program still forever .
so when i try to send At commad the mobile don't response and still send the data of the program.
are there anyone can help me and say to me how can i send the command from hyper terminal to Ericsson by this cable.
please i want help as soon as posible.
my email: [email protected]

dimitrin
- 24th April 2005, 03:35
like in an earlier post I seem to get the code to send the the GM862, the person might have used something different, and it is visible through hyperterm, but the phone does not read the code as commands...

I am using a pic 16f452 and a gm862

common ground

tx and rx connect

I am using nothing inbetween the two... do I need an hex inverter? or a max232?

and the code is:

DEFINE OSC 20

DEFINE HSER_TXSTA 20h
DEFINE HSER_RCSTA 90h
DEFINE HSER_BAUD 9600
DEFINE HSER_CLROERR 1



HSerout ["ATZ",13,10]
Pause 1000

HSerout ["AT+CGATT=1",13,10]
Pause 500

NavMicroSystems
- 24th April 2005, 03:46
... do I need an hex inverter? or a max232?

You will never get this to work if you don't take the time to read any datasheet.

dimitrin
- 24th April 2005, 03:54
don't quite understand your comment.

thanks for your input.

NavMicroSystems
- 24th April 2005, 04:07
don't quite understand your comment...
...nor RS232

dimitrin
- 24th April 2005, 04:37
because it does work with rs 232.

thanks again for you help

aruran
- 28th April 2005, 17:46
I got an Ericsson T18 phone, which works with the data cable for AT commands.. Going through the internet I found that it doesn't support Text mode, Only pdu mode available. So can I make it work by using bitmaniac's PDU decoder. And I am going to use PIC16F877A. If I do the necessary changes it should work right......

thanks in advance
aruran

PIC Coder
- 28th April 2005, 21:22
Hello,
I am look out for technical details of Samsung SCH-N356. I also want to make SMS controled relay. Please suggest.
Bye

aruran
- 9th May 2005, 17:32
Hai all,

First of all thank you all for the help rendered. I have successfully made a Ericsson T18 to send SMS using PIC16F877A. I give the PIC using I2C bus some data from a main PIC for my microcontroller project. I have written a dynamic PDU encode routing to handle the dynamic texts sent by the main pic. This was achieved mainly from the help of bitmaniac's PDU encode...

Thank you all
aruran

NavMicroSystems
- 9th May 2005, 19:15
aruran,

it would be nice if you would share youre code.

MICOCALI
- 21st May 2005, 19:37
What is the metod for write a code in 16f628 for read in rs232?
when the telephone send (*elip:) string, my 16f628 to be one pin at gnd

kasamiko
- 26th May 2005, 12:16
I just finished my circuit below a PIC to cellphone interface to send text messages..I can succesfully SEND a pre-programmed text message using this code:

http://x4.putfile.com/5/14505233479.jpg

Device 16F84A
Declare Xtal = 4

Start:
LOW LED
DelayMS 1000
SerOut2 PORTB.1, 84,["AT+CMGS=",34,"MyNumber",34,13]
DelayMS 1000
SerOut2 PORTB.1, 84,["TEST",13]
DelayMS 1000
SerOut2 PORTB.1, 84,[26]
DelayMS 3000
GOTO Start

I can send an endless "TEST" text messages to "MyNumber" but I can't make it work to read received text messages..

I need a code sample that will READ the received text message and will text back to the sender the word "GOOD"

I don't have the idea how to strip the sender phone number and the sent text message "GOOD" from the example below using SERIN command..

+CMGR: "REC READ","+xx1234567890",,"05/05/26,17:19:23+00"
GOOD
OK

I'd look at this code:

HSerin 5000, Loop, [Wait("UNREAD"), skip 3, STR Caller\12, skip 4, STR GSMTime\17, skip 4, STR GSMbuffer\12]

But I can't "SAY" it using SERIN command using PIC16F84..

Thanks for any info..

Royce
- 24th July 2005, 19:03
Hi

I am very new to PIC's so please excuse some of the comments that I have added to the following code.

I have put this together using data that was available earlier in this post. I have got the SMS sending working great whenever I push a button but I am also wanting an LED to be switched on when the GSM modem receives and SMS containing "SWITCH"

I think I have got everything that I require within the program but I am wondering what commands I should use in order to read the GSMBuffer then if it is true then switch on the LED.

I have added the line just to give an idea of what I'm trying to do:

IF GSMBUFFER = "SWITCH" THEN LED = 1

Here is the code:

' Setup PIC tx and rx serial port
DEFINE OSC 8
DEFINE HSER_TXSTA 20h
DEFINE HSER_RCSTA 90h
DEFINE HSER_BAUD 9600
DEFINE HSER_CLROERR 1

'Setup the names that will be used throughout the program for the led and switch
PushButton var PORTB.0 ' Setup the name PushButton to mean PortB input 0
LED VAR PORTB.1 ' Setup the name LED to mean PortB output 1

' SMS receive buffer setup:
GSMBUFFER VAR BYTE[16] '16 is used to tell buffer to store max of 16 characters
Caller VAR BYTE[13] '13 is used to tell buffer to store max of 16 characters
GSMTime VAR BYTE[17] '17 is used to tell buffer to store max of 16 characters

' Set all PortB i/o 1 to be an output and all other i/o as inputs
TRISB = %11111101

Main:

IF PushButton = 0 THEN SMS 'If button is pressed then run the SMS routine below

goto main ' however if the button is not pushed then just go back to the Main
' routine to wait for the button to be pressed

SMS: ' this is the SMS commands routine in order to send an SMS

HSEROUT ["AT" ,13,10] ' send AT to modem followed by a CR and line feed

HSERIN 5000, SMS, [WAIT("OK")] ' now wait for 5secs until OK is received however
' if it is not then goto the SMS routine again

HSEROUT ["AT+CMGF=1" ,13,10]

HSERIN 5000, SMS, [WAIT("OK")]

HSEROUT ["AT+CMGS=+447977578999"]

HSEROUT [13,10]

HSERIN 5000, SMS, [WAIT(">")]

HSEROUT ["BUTTON HAS BEEN PRESSED!"]

HSEROUT [26] ' this is ASCII for Ctrl+Z of which completes SMS sending

HSERIN 15000, SMS, [WAIT("+CMG")] ' then PIC should receive +CMG from modem

HSEROUT [10] 'ascii code for a line feed

goto main

READSMS: 'Use this routine to read first 16 characters of new messages and then
' store them in the GSMBUFFER variable above then you are able to add a line at
' the end in order for an led to be switched on whenever the modem receives the
' correct SMS command such as LED ON or SWITCH etc

HSEROUT ["AT+CMGF=1",13,10] 'Instruct modem to use text mode

HSerout ["AT+CMGL",13,10] 'List new Messages

' Below I Read Caller ID, time and 16 CHARs of Message
' The timeout value in the HSERIN statement is important, it takes some time
' before the phone replies to the AT+CMGL command
' skip works like this: skip 4 (skips 4 characters) - this is a sample of the
' message that would be received after the AT+CMGL command is sent:
' +CMGL: 2,"REC UNREAD","+447977578999" Test
' Please note that I can't seem to receive the time in the reply as in this
' example: (of which the line of code is written for below - so maybe I should
' edit the line of code below in order to miss it - also remember to update
' GSMTime variable above i.e. remove it if your going to adit the line below)
' +CMGR: "REC READ","+xx1234567890",,"05/05/26,17:19:23+00" GOOD
' Loop could be setup as a routine such as:
' Loop:
' List new Messages again - as above (think about it)
' HSerout ["AT+CMGL",13,10]

HSerin 5000,loop,[wait("UNREAD"),skip 3,STR Caller\13,skip 4,STR GSMTime\17,skip 6, STR GSMBUFFER\16\13]

' Basically in the above line, \13 - stores 13 characters and \17 - stores 17 characters etc into
' each of the buffers i.e. Caller & GSMTime etc etc

HSerout ["AT+CMGD=1;+CMGD=2",13,10] 'Intruct modem to delete SMS's from location
' 1 & 2 as this is where any new messages will be stored, so its a good idea to
' delete them after we have processed the SMS command above - please note that
' it would be a good idea to wait for an OK after this command but we can add
' this at a later time

' --- Put your code to output the result here i.e. IF gsmbuffer = (your sms command) then goto
' subroutine etc

IF GSMBUFFER = "SWITCH" THEN LED = 1

Thank you for your time.

Kind Regards,
Royce

Ioannis
- 25th July 2005, 21:14
On the following code the phone responds ..."REC READ",... if the message was read sometime before. If you have a fresh new message then this becomes UNREAD as you state on your code.

So, why don't you change your code to:

HSerin 5000,loop,[wait("READ"),... since the word READ is present all the time?

Ioannis

' +CMGR: "REC READ","+xx1234567890",,"05/05/26,17:19:23+00" GOOD
' Loop could be setup as a routine such as:
' Loop:
' List new Messages again - as above (think about it)
' HSerout ["AT+CMGL",13,10]

HSerin 5000,loop,[wait("UNREAD"),skip 3,STR Caller\13,skip 4,STR GSMTime\17,skip 6, STR GSMBUFFER\16\13]

Royce
- 25th July 2005, 22:22
Thank you for the info.

I was wondering if you could tell me how I should use the data that is captured within the GSMBuffer i.e. the SMS text as I would like use this to switch on an LED. Should it be something like this:

IF GSMBuffer = Switch on then LED = 1

Thanks in advance.

Kind Regards,
Royce

Ioannis
- 26th July 2005, 11:21
PBP does not have such string compring capabilities.

You have to make your own subroutine to compare byte to byte the two string array. Like that:

i=0
while i less_than gsmbuffer_length (I cant sen the less character! Why?)

if gsmbuffer[i]=compare_array[i] then
'gsmbuffer[i]=0
i=i+1
else
goto wrong_sms
endif
wend
correct_sms:
'your code here

wrong_sms:
'your code here

You understand that in compare_array you have to put your characters in some other place of the program prior to the above subroutine.

Royce
- 26th July 2005, 16:33
Thanks again but I'm afraid I dont quite understand. Really sorry but would it be possible to be little clearer.

Thanks again.

Kind Regards,
Royce

Ioannis
- 26th July 2005, 21:04
Hmm, what part you are not understanding?

Ioannis

Royce
- 26th July 2005, 23:46
Sorry.... would it be possible to add comments to each of the following lines:

You have to make your own subroutine to compare byte to byte the two string array. Like that:

i=0
while i less_than gsmbuffer_length (I cant sen the less character! Why?)

if gsmbuffer[i]=compare_array[i] then
'gsmbuffer[i]=0
i=i+1
else
goto wrong_sms
endif
wend
correct_sms:
'your code here

wrong_sms:
'your code here

Could you give me an example using the SMS keyword: "switch on" in order to switch on an LED.

Thanks again.

Regards,
Royce

Ioannis
- 27th July 2005, 10:48
The commands used in the small piece of code are very elementary. So you have to read the manual because all the answers are in there.

I cannot explain how an If-Then-EndIf statement is syntaxed or how is working. The code I gave you is very very easy and basic I could say.

It is comparing one element of the array gsmbuffer at a time with one element of the other array. If it succeeds then it is moving on to the part of the program labeled:

correct_sms:
'you add your code here

If it does not succeed then it is moving on to the part of the program labeled:

wrong_sms:
'you add your code here

Try to write some code and see what happens. One part at a time...

Ioannis

Royce
- 27th July 2005, 11:41
Thanks Ioannis. I will do my homework.

Kind Regards,
Royce

muddy0409
- 27th July 2005, 15:44
Hello all,
I have been doing something similar with an Ericsson T68I phone.
I communicated at 1200 buad and use AT command set.
I am NOT trying to send SMS, but DTMF tones. I am getting the phone to dial by using the access keypad AT command (rather than ATD command, which for some reason wouldn't work) and then activating send DTMF tones. Sorry I can't remember what the AT for these are, but what I dis was successful withoput too much trouble. Simple serout at N1200 (without MAX232 chip) was the most successful from a 4MHz 'F84. The T68I is autobaud so will talk at most baud rates above 1200.

tsupuntu
- 12th August 2005, 22:19
Hello all
if I want not send sms But I dial to phone.How to make it.

NavMicroSystems
- 12th August 2005, 22:49
tsupuntu,

See: This (http://www.picbasic.co.uk/forum/showpost.php?p=8765&postcount=2)

And read the GSM thread from the beginning.

aruran
- 16th August 2005, 17:44
aruran,

it would be nice if you would share youre code.

Hai NavMicro,

Sorry for the delayed response. I was involved in the project in another part..So I couldn't concentrate on the SMS sending part as it is almost finished.

I have finished the PBP coding to send SMS using a Ericsson T10. It uses PDU mode since T10 supports AT command for PDU mode. So help from bitmaniac's PBP file helped me.
I have attached the file.

I also want to develop this to be integrated into a Embedded IP module for my project. I want to know how can I make this SMS sender to send sms when a centrallized MCU gives an interrupt and then the datas such as message, recepient number and so on are fed from that centrallized MCU to the MCU that controlling sending sms.

Some people say that the PBP is not good for interrupt handling, and ASM codes inserted may be of use. Have anybody got any idea....

thanks
aruran

Airrr
- 1st September 2005, 02:42
i've read this thread a few times, but it wont work at all!
nokia 6210 connected with RX to PIC 16f84a port b.1
gnd2gnd :)

now thats the programm

SerOut2 PORTB.1, 396,["AT", 13, 10]
Pause 1000
SerOut2 PORTB.1, 396,["AT+CMGF=1", 13, 10]
Pause 500
SerOut2 PORTB.1, 396,["AT+CMGS=", 34, "+972544567209", 34, 13, 10]
Pause 500
SerOut2 PORTB.1, 396,["Test-message", 13, 10]
Pause 500

i tryed 8mhz crystal and 12mhz
pic sends some pulses out, but mobile just do nothing :(
is it a wrong programm or what?

ps, i need simply to send SMS.
i think i missed something important..

bitmaniac
- 1st September 2005, 09:00
First of all I would like to say a big HELLO! to all of you.

I was out of this forum for some months and I really like the fact that this topic is of so great interest , while I am back.

SO back to PICs again..

Airrr:
I would advice you to read all the related topics about sending sms with Gsm ,
so to take an idea of how this works.
But to make you start:
A simple way to test if your phone is working ok (making sure you have checked the connections) you can connect it to your PC serial port and try sending AT commands using a terminal program like HyperTerminal for example
(set speed 9600,8,n,1)
OF COURSE YOU HAVE TO USE A RS232 LEVEL CONVERTER as your serial port
works with rs232 level volt (+-12v) and your Nokia ecpects TTL level volt (+-5v).

Second, as reading your code I noticed that you are trying to use NOKIA 6210 in 'text mode' and I am not sure that 6210 supports text mode.
I think it only supports PDU mode but I am not 100% sure.
You have to encode your text sms in PDU format in order to 'feed' it to your phone trough AT commands which is a complex procedure with pic but IT IS possible -please read through the topic to get an idea.

I hope I have helped you a little :)

AGAIN A BIG HELLO TO ALL OF YOU!

Airrr
- 1st September 2005, 23:42
i have made this circuit for interfacing rs232 to nokia
http://pinouts.ru/images/cable_cell2.gif
now im starting huper terminal, 9600, com1, 8,n,1, connected xx:xx:xx and
i can't type anything, pressing on keys don't display nothing, but schematic works fine with logo manager as f-bus cable.
? how it could be? logo manager works, does it meen cable is OK?

after few hours i have sucesfully send msg from hyper terminal. now some other questions :)
1: is it so necessary to use pic on mbus? if so, my project has to be double pic'ed :(
2: finaly project uses a 9210 mobile, but seems like communicator dont recognize pic on mbus (debug led on pic remains off all the time)? 6210 works, but now i need to do the same with 9210.. any suggestions?

Lotondo
- 2nd September 2005, 09:29
i have made this circuit for interfacing rs232 to nokia .....

after few hours i have sucesfully send msg from hyper terminal. now some other questions :)


I have the same problem with hyperTerm, how were you able to send AT cmds ?

Thanks
Lotondo

Ioannis
- 2nd September 2005, 11:25
I have the same problem with hyperTerm, how were you able to send AT cmds ?



If you follow the thread from the top, you will find out how. Anyways, just type the commnds that are relative to the phone being used: AT+CMSG etc...

Look the manual of your phone and then type them in your terminal. You can also set your modem to ASCII and not PDU format which is more convinient.

Ioannis

Airrr
- 2nd September 2005, 15:14
Lotondo: like on the schematic abowe, u have to use pic connected to m-bus :) and if its working good, phone will connect to terminal...

kasamiko
- 5th September 2005, 03:30
i've read this thread a few times, but it wont work at all!
nokia 6210 connected with RX to PIC 16f84a port b.1
gnd2gnd :)

now thats the programm

SerOut2 PORTB.1, 396,["AT", 13, 10]
Pause 1000
SerOut2 PORTB.1, 396,["AT+CMGF=1", 13, 10]
Pause 500
SerOut2 PORTB.1, 396,["AT+CMGS=", 34, "+972544567209", 34, 13, 10]
Pause 500
SerOut2 PORTB.1, 396,["Test-message", 13, 10]
Pause 500

i tryed 8mhz crystal and 12mhz
pic sends some pulses out, but mobile just do nothing :(
is it a wrong programm or what?

ps, i need simply to send SMS.
i think i missed something important..

I succesfully done it using this code..

Device 16F84A
Declare Xtal = 4

Symbol BAUD = 84 ' 9600,8,N,1(True,driven)
SYMBOL LED = PORTB.2 ' Assign PortB.2 for Status LED
Symbol TX = PORTB.1 ' TX to Phone
Symbol RX = PORTA.0 ' RX from Phone

Start:

SerOut2 TX, BAUD,["AT",13]
DelayMS 500
SerOut2 TX, BAUD, ["AT+CMGF=1",13] ' Use TXT Mode
LOW LED ' Turn OFF Status LED
DelayMS 1000 ' Pause for 1 second
HIGH LED ' Turn ON Status LED
SerOut2 TX, BAUD,["AT+CMGS=",34,"Recipient Phone Number",34,13]' Prepare the recipient Phone Number
DelayMS 1000 ' Pause for 1 Second
SerOut2 TX, BAUD,["TEST Message!!",13] ' The message to be sent
DelayMS 1000 ' Pause for 1 second
SerOut2 TX, BAUD,[26] ' Terminate message with Control+Z (26)
LOW LED ' Turn OFF Status LED
DelayMS 1000
Goto Start ' Repeat
End

What i did is some sort of SMS bomber...look for the circuit I posted before to make this code works..
Notice that all it does is send..TX. I dont process any message I received so RX was not used.
BR

Lotondo
- 5th September 2005, 20:33
Kasamiko,

thanks for sharing your project.
I built it according to your above schema but the test I did had no success.
The pics receive 2.8 V. from the phone, is that enough ?
IC2 has your software with my data (phone nr. + text)
IC1 has the the software found at http://www.atrox.at/datacable/dlr3/dlr1.hex
LED1 is always flashing
LED2 is just flashing once.
Could you pls. tell me the pic config (osc, wdt, pwrt) ?
What's the purpose of diode zener (D5 2.7) ?
Thanks your or anyone else support.

Lotondo

kasamiko
- 6th September 2005, 02:36
That circuit is drawing power from the phone..2.8VDC is enough since this is the maximum the phone can supply. Please remove that zener Diode that was left when I was experimenting powering it with external power supply.
I think you have the problem with the HEX you used for the DLR-3P part since LED1 will light steadily. You used the wrong HEX! this is the link for the 8 Mhz version..http://www.atrox.at/datacable/dlr3/dlr2.hex
LED2 will continously blink meaning it is sending SMS.

Lotondo
- 6th September 2005, 11:26
Kasamiko,
thanks for answering.
I did what you said.
Now the LED1 is always on and not flashing like before. This should be ok.
Led 2 is just flashing once cause I turn the loop off.
Till here should be everything correct but I dont receive any sms on the
other cellphone.
Testing my phone (7110) with a DLR3P cable (Nokia cable) and hyperterm I noticed that it worked only at 19200 baud. I knew that it should also work with a lower baud but it did not. Maybe it's the DLR3P cable that 'force' it works at 19200.
Btw here is "my" code pls have a look.
Thanks again for any further help.
Lotondo

;Device 16F84A
DEFINE OSC 4

BAUD VAR BYTE
LED VAR PORTB.2 ' Assign PortB.2 for Status LED
TX VAR PORTB.1 ' TX to Phone
RX VAR PORTA.0 ' RX from Phone

BAUD = 84 ' 9600,8,N,1(True,driven)

Start:

SerOut2 TX, BAUD,["AT",13]
Pause 500
SerOut2 TX, BAUD, ["AT+CMGF=1",13] ' Use TXT Mode
Low LED ' Turn OFF Status LED
Pause 1000 ' Pause for 1 second
High LED ' Turn ON Status LED
SerOut2 TX, BAUD,["AT+CMGS=",34,"0761111111",34,13]' Prepare the recipient Phone Number
Pause 1000 ' Pause for 1 Second
SerOut2 TX, BAUD,["TEST Message!!",13] ' The message to be sent
Pause 1000 ' Pause for 1 second
SerOut2 TX, BAUD,[26] ' Terminate message with Control+Z (26)
Low LED ' Turn OFF Status LED
Pause 1000
;GoTo Start ' Repeat
End

Ioannis
- 6th September 2005, 13:03
Hi!

All phones default on power up to Autobaud mode. The first connection defines the speed from that moment on upt to the next power up.

This is over ruled only if you define explicitly and store to the phone's memory the speed to use.

So, in your case may be you did a connection with the mobile at 19200 with the Hyperterminal and then without reseting the mobile, did you connected to the PIC circuit? Are you sure the mobile does autobaud at power up?

Ioannis

Ioannis
- 6th September 2005, 13:04
Hi!

All phones default on power up to Autobaud mode. The first connection defines the speed from that moment on upt to the next power up.

This is over ruled only if you define explicitly and store to the phone's memory the speed to use.

So, in your case may be you did a connection with the mobile at 19200 with the Hyperterminal and then without reseting the mobile, did you connected to the PIC circuit? Are you sure the mobile does autobaud at power up? If it does then you should send an AT command without any parameters to sync the mobile to the speed you set in the beginning of your program.

Ioannis

Lotondo
- 6th September 2005, 20:45
Hello,
as far as I know, I read again the manual, it's not possible to set baud speed to be used through the port. The only set possible for baud speed is if you want to connect to the internet (wap). I tried in any case to set it at 9600 but it did not work.
I checked the at command manual and i did the following check with the cable and hyperterm (19200,8,N,1):
AT+CBST?
> +CBST:0,0,1 the phone is in autobauding
then i typed:
AT+CBST 7,0,1
AT+CBST?
> +CBST:7,0,1 the phone is at 9600 baud
Great, I thought, now i change the hyperterm setting from 19200 to 9600 and let's see !!
Nothing, exactly like before, at + enter, no answer back
I reset the hyperterm to 19200 and i type
AT+CBST?
> +CBST:7,0,1 the phone is still at 9600 baud

Seen that the phone is in autobauding and it's not possible to set via menu
I'll try to add to the code this:

>>CUT
BAUD = 84 ' 9600,8,N,1(True,driven)

Start:

SerOut2 TX, BAUD, ["AT+CBST=7,0,1",13] ' <-------------------------------
SerOut2 TX, BAUD,["AT",13]
Pause 500
SerOut2 TX, BAUD, ["AT+CMGF=1",13] ' Use TXT Mode
Low LED ' Turn OFF Status LED
>>CUT

I have some doubts but I will try
What do you think you guys ??
Bye

Lotondo
- 7th September 2005, 11:12
Hi,
i added this line
SerOut2 TX, BAUD, ["AT+CBST=7,0,1",13]

but no success.

I'm running out of ideas.

Thanks for yr help
Lotondo

Lotondo
- 7th September 2005, 14:00
Tried with Sony Ericsson T610
it works just GREAT !!!!
I dont know what's wrong with damn Nokia 7110 !!

Any help will be appreciated
Thanks

Lotondo

Ioannis
- 7th September 2005, 15:17
Why not read any manuals about the specified phone?

With Wavecom module, 6210 and 6310 I had no problem with any commands. May be your phone is a little different.

Ioannis

Lotondo
- 8th September 2005, 14:44
Guys, I finally successed !
The Nokia 7110 did work too !
Here what I did:
The 7110 boots and sets itself in autobaud mode,
even i forced it to work at 9600 baud with
AT+CBST= 7,0,1
it did not send out any sms. (see code previous msgs)
Now I did not want to waist more time I already did,
so I reprogrammed the 16f84a and I change the
line:
BAUD = 84 ' 9600,8,N,1(True,driven)
with this one
BAUD = 32 ' 19200,8,N,1(True,driven)
and it worked !
According to what I read here and in some manuals
the 16f84a with 4Mhz quarz should not work properly
with that baud speed, but it did.
Now I'll get more time to study some code ;)
Thanks again
Lotondo

kasamiko
- 9th September 2005, 04:44
Woiw nice to hear about it!!
Congrats my friend..

Now my problem is this..since I can successfully send SMS I also what it to received and process some command I want it to fucntion like this:

SerIn2 Rx, Baud (...READ THE MESSAGE IN 1ST MEMORY LOCATION) if the message contains a command like, ON1 call ON1 routine, if it contains OFF1 call OFF1 routine else goto DELETE_SMS. Then make a loop to check it again..

Lotondo
- 10th September 2005, 00:09
Kasamiko,
I'm making some test about reading sms received.
I'll let you know as soon as I have some good result.

Bye
Lotondo

Ps: Are you a vampire ? 8) You are always writing in the middle of the night.

kasamiko
- 10th September 2005, 08:38
Nice to hear that my friend..pls keep me updated..

Me vampire?? you're wrong...I'm a security guard!! hehehehe...

Regards to all..

bitmaniac
- 10th September 2005, 15:49
Hi! to all of you picMANIACS out there!

I experiment with my (damaged lcd!) 6210 ! . This is an excellent platfrom for my pics experiments using sms alarm sytem.
It does support text sms mode and I have seen that it has a build-in gsm modem (through AT commands)
I wonder if it is possible to call the 6210 from my home pc modem and initiate a data call!
My first attempt with hyperterminal was this:
connected 6210 (trough pic dlr2p interface-THANKS KASAMIKO for your circuit) with one com of my pc + hyperterminal (communication was established ) .
At com2 I have my external USRobotics modem.
I dial the number of 6210 with usr modem and at the other and I noticed that 6210 response with '+CRING: VOICE '

How can I initiate a data call? . 6210 should response '+CRING: DATA'
...at least I hope so!

Is it possible to start a data call between my desktop modem and 6210 ?

Has anyone tried this?

Keep up the good work out there guys

I have returned and started PIC Projects again!!!!

Lotondo
- 11th September 2005, 22:43
Hi Guys,
here is my first test, unfortunatly no success.
I tried several changes in the code but always something went wrong.
This is the code:
;Device 16F84A
DEFINE OSC 4

CALLER VAR BYTE[13]
BAUD VAR BYTE
LED VAR PORTB.2 ' Assign PortB.2 for Status LED
TX VAR PORTB.1 ' TX to Phone
RX VAR PORTA.0 ' RX from Phone

BAUD = 32 ' 19200,8,N,1(True,driven)

Start:

SerOut2 TX, BAUD,["AT",13]
Pause 500
SerOut2 TX, BAUD, ["AT+CMGF=1",13] ' Use TXT Mode
Pause 1000 ' Pause for 1 second
SerOut2 TX, BAUD,["AT+CMGL",13,10]
Pause 5000 ' Pause for 1 second
SerIn2 RX, BAUD,[wait("REC READ"),skip 3,STR CALLER\13]
Pause 1000
High LED ' Turn ON Status LED
SerOut2 TX, BAUD, ["Result: ",STR CALLER,13,10]
Pause 2000
Low LED
End

This is what I get on hyperterm monitor:

AT
OK
AT+CMGF=1
OK
AT+CMGL

+CMGL: 1,"REC READ","44544",,"05/05/31,16:58:21+08"
Super! Viel Gluck in der Verlosung! - Bonne chance au tirage au sort! - Buona fortuna per l'estrazione! Swisscom Mobile

OK

I think that after the "OK" the pic should send out:
Result: 44544
Maybe also some other characters, Caller var byte has 13 byte
In any case there is a record that matched and I believe I should
see something
Led does not also go on.
What am I doing wrong ?

Thanks

Lotondo

mister_e
- 11th September 2005, 22:49
Sorry guy, but you'll NEVER EVER be able to have a reliable 19200 baud comm @ 4MHZ with serout2. Seems you miss the advert in the manual :)

try with DEBUG instead OR have a higher crystal value OR change your PIC to another who have an internal USART like 16F628. With the internal USART @ 4MHZ you'll be able to make it work.

Lotondo
- 12th September 2005, 23:04
Well Mister_e,
in one way i agree with you but pls. have a look to msgs. 113, 118 and 120.
How can you explane me that in this test everything is working great ?
Pls do not missunderstand me, I also read that theoreticaly should not
work but it does.
Maybe there is something wrong in this code (msg. 125), i'm not
an expert and i'll try to increase the crystal but i have the feeling that it's not
only this the problem

Bye
Lotondo

Lotondo
- 15th September 2005, 14:46
Hi everybody !
Here I'm again.
I moved to pic 16F876A + Crystal 20MHZ
Here is the code:

DEFINE OSC 20
DEFINE HSER_TXSTA 24h
DEFINE HSER_RCSTA 90h
DEFINE HSER_BAUD 19200
DEFINE HSER_SPBRG 64 ' 19200 Bauds
DEFINE HSER_CLROERR 1

Caller VAR BYTE[5]

HSerout ["AT",13,10]
Pause 1000

HSerout ["AT+CMGF=1",13,10] 'Set Text Mode
Pause 1000

Loop:

HSerout ["AT+CMGL",13,10]
Pause 1000
HSerin 5000,loop,[wait("REC READ"),STR Caller\5]
HSerout [STR Caller,13,10]

End

Here is what i get on monitor:

AT
OK
AT+CMGF=1
OK
AT+CMGL
+CMGL: 1,"REC READ","44544",,"05/05/31,16:58:21+08"
Super! Viel Gluck in der Verlosung! - Bonne chance au tirage au sort! - Buona fortuna per l'estrazione! Swisscom Mobile
OK

And it loops endless.

There is only one sms, and it has REC READ
I'm waiting to see something after the OK, it should be "44544" or anything else but it should !!
Am I right or not ?
Please help me !
Thanks
Lotondo

mister_e
- 15th September 2005, 14:56
i'm not a pro of SMS but i think it refer to that part


Loop:

HSerout ["AT+CMGL",13,10]
Pause 1000
HSerin 5000,loop,[wait("REC READ"),STR Caller\5]
HSerout [STR Caller,13,10]

End

probably you need a delay after the HSERIN and a GOTO after the HSEROUT.

I can be wrong but i think it make sense. With the current, after the Hserout, your program can jump to XYZ places so ... hard to say what's happen.

Lotondo
- 15th September 2005, 23:06
I did some delay, nothing changed.
I made another test, here is the code:

DEFINE OSC 20
DEFINE HSER_TXSTA 24h
DEFINE HSER_RCSTA 90h
DEFINE HSER_BAUD 19200
DEFINE HSER_SPBRG 64 ' 19200 Bauds
DEFINE HSER_CLROERR 1

main:
HSerout ["AT",13,10]
HSerin 5000,main,[WAIT("OK")]
HSerout ["WELL DONE",13,10]
End

Despite i receive the ok from the phone, the program continues to
loop and no WELL DONE.

I don't know what to search and/or test anymore !!

Thanks for any help.
Bye
Lotondo

Ioannis
- 16th September 2005, 10:59
main:
HSerout ["AT",13,10]
HSerin 5000,main,[WAIT("OK")]
HSerout ["WELL DONE",13,10]
End


I can not understand where will the "WELL DONE" message be displayed. You are sending it back to the mobile, is this correct? What can the mobile do with this message?

On you previous post you had a pause 1000 after HSerout ["AT",13,10]. You did well removing it.

So, I guess a sample like this might help you:

main:
Green_Led=0
HSerout ["AT",13,10]
HSerin 5000,main,[WAIT("OK")]
Green_Led=1
End

Ioannis

Lotondo
- 16th September 2005, 14:09
Ioannis
thanks for answering.
As you know i have problems with hserin.
The WELL DONE should come out on the screen cause i'm monitoring
via max232 what it's happened between the pic & phone.
I tried as you said to add the Led lines. The led did not turn on.
The pic sends out the AT, the phone answers back OK, the pic now
should understand that it has received an OK and with Hserin should
turn a led on or send out a WELL DONE.
Of course the phone does not understand what the purpose but I should
see it on the monitor and the pic ends to run.
Thanks for any further help
Lotondo

Ioannis
- 16th September 2005, 22:47
I know it might sound silly, but are sure you are communicating between mobile and PIC with the correct levels? May be your PIC does not see the appropriate voltage levels if you don't use a MAX232 device.

Other than that, I cannot see what might be wrong.

Ioannis

Lotondo
- 17th September 2005, 13:32
Well,
I think so. I'm using Kasamiko's schema + max232 to monitor the dialog between pic & phone.
I already tried several code list, I can send sms out if an event happens at a programmed port and many more.
Now i wanted to try the opposite, if it receives a sms the pic should, for example, turn a led on.
I believe I have to use hserin to catch a part of the sms (text or pdu) but it seems not working properly.
I don't know, i'm using all my knowledge (not a lot), I read more than hundred posts, it seems that i'm using hserin correct but ..........
Thanks for any help.
Bye
Lotondo

Lotondo
- 19th September 2005, 10:18
After a long rainy Sunday day spent in front of 16f876A I think I got where is the problem but I can not give me an answer of why this happen.
Please see code in the msg. 130+131.
If I use serial db9 pin 2 (rx) to monitor what the pic (pin 17) is sending to the phone I just see a loop of AT. Perfect no problems here.
If now I monitor what the pic (pin 18) is receiving from the phone I see:
AT
OK
According to my knowledge I should just receive OK.
After this I decided to change the line
HSerin 5000,main,[WAIT("OK")] into
HSerin 5000,main,[WAIT("AT")] and like a miracle on the screen WELL DONE and the led on.
I believe it's quite clear why with WAIT("OK") the led did not go on, after AT there is a <CR> and the OK gets lost.
I do not really understand why the phone is sending back again AT and not just OK.
If someone of you can explain me this I think I'll get the solution of my problem.
I'm waiting for yr msgs.
Thanks
Lotondo

Ioannis
- 19th September 2005, 10:34
You had to send to the mobile ATE0 (that is E and zero).

By default all phones reply what you type, so you can see on you monitor screen what you have just typed.

May be you could also try to set the phone to numeric response instead alphanumeric with ATV0. Instead of "OK" you'll get 0 and 4 for error.

Ioannis

Lotondo
- 19th September 2005, 15:14
Thanks for tips.
I tried but no success.
Well I'll try to change the phone, maybe the 7110 is not the right one.
Even in my working test (msg.135) I could see that it was unstable, sometimes it did work, sometimes not.
I can not spend too much time in these tests.
Hserout is working fine, at the moment I'll use to send out sms.
For the incoming I'll wait for a while.
Thanks

Lotondo

Hamlet
- 7th October 2005, 23:09
what dou you all study to know all that?
do you spend all day long in electronics and computer??

doesnt your girlfriend bother you?? opss... do you have one??

what is your life like??

you all seem to be genious!!

Rufinus
- 10th October 2005, 19:41
Hi everyone!
Did somebody try to connect Siemens mobile to PIC? I have S65 with no result :(
I guess, Siemens needs more then 3 wire connection.

Lotondo
- 12th October 2005, 17:58
@Rufinus

Check here maybe you'll find the solution
http://pinouts.ru/data/siemens_c55_pinout.shtml

Rufinus
- 13th October 2005, 10:58
Thanx, Lotondo.

But i do have the pinout of S65 and even service manual of C55/S55 (they are similar to S65).
Perhaps i should give some more detail of my problem.


I started with 16F84 and serout2 commands. Everything according to this thread.
Pic is connected to the phone through the MAX232 and original data cable, which came with tthe phone. I managed to connect pic and pc with 9600 baud and lower in bidirectional mode. No problem with that. Phone and pc communicate very good as well. Tried all kinds of commands, even sniffed on com2 port to see how original Siemens software is sending sms from pc.
Than i made an adapter, in order to determine how many wires are essential for communication between pc and phone using original cable. Result: 3 wires if enough for communication (did not try GPRS), AT commands are working from hyperterm.
Now, if i connect the same 3 wires to the pic, phone does nothing!!

This is driving me crazy for 2 days already :)

From this all i concluded, that problem is in Siemens original cable (?). Dont know what the problem, unfortunately. Gonna keep on trying.

Also desided to shift to pic16f870. Has more capabilities. Tried to send
Hserout ["ATD phonenumberhere", 13, 10]
at 9600 baud and received it on pc without problem. Phone still does nothing.

Should name it Enigma instead of Siemens :)

Rufinus
- 13th October 2005, 16:45
Here is the code i used to test it with PC:

DEFINE LOADER_USED 1

'UART hardware defines
DEFINE HSER_RCSTA 90h
DEFINE HSER_TXSTA 20h
DEFINE HSER_BAUD 9600
DEFINE HSER_CLROERR 1


'LCD defines
DEFINE LCD_DREG PORTA 'set LCD data port
DEFINE LCD_DBIT 0 'set starting data bit (0 or 4) if 4 bit bus
DEFINE LCD_RSREG PORTA 'set LCD register select port
DEFINE LCD_RSBIT 4 'set LCD register select bit
DEFINE LCD_EREG PORTB 'set LCD enable port
DEFINE LCD_EBIT 3 'set LCD enable bit
DEFINE LCD_BITS 4 'set LCD bus size (4 or 8 bits)
DEFINE LCD_LINES 2 'set number of LCD lines
DEFINE LCD_COMMANDUS 2000 'set command delay time in us
DEFINE LCD_DATAUS 50 'set data delay time in us
DEFINE OSC 20 'set crystal speed



'Main program


pause 1000 'wait for screen to sort get started
start:
lcdout $FE,1, "Sending number.."
pause 1000
HSEROUT ["atd **********", 13, 10]
HSERIN [wait("OK")]


lcdout $FE, 1, "Got it!"
pause 1000
goto start
end


It's running on 16f870 connected trough max232 to com2 port on pc, and i have no problem!
When i connect the phone following way:
PIC--->MAX232--->Data cable (original Siemens)--->Phone

Nothing happens!
That must be the cable. But from other side, phone is listening to commands from pc, using same cable with only 3 wires connected: Rx, Tx, GND
Miricle..

Ioannis
- 14th October 2005, 08:51
'Main program

pause 1000 'wait for screen to sort get started
start:
lcdout $FE,1, "Sending number.."
pause 1000
HSEROUT ["atd **********", 13, 10]
HSERIN [wait("OK")]

lcdout $FE, 1, "Got it!"
pause 1000
goto start
end



Try to add on top of your program:

HserOut ["AT",13,10] ;Sync modem to 9600 baud

Also if you power up PIC at the same time as the mobile you won't get reliable connection with the phone until the phone is on the network.

Ioannis

Rufinus
- 14th October 2005, 11:23
Thanx, but i tried this already. Nothing. And i do not power up the phone in the same time. Phone is just on costantly.

I thougt, maybe when i send AT, phone answers OK, but pic does not capture it (for whatever reason). So i changed to atd **********, because even if pic is not capturing the answer, phone should react (dial given number).
I started yesterday to build new cable, just typical 3 wires based on standard MAX232. Let's see what this will give. I will test it with the phone--->pc connection first, and than test with pic. And if this doesnt work, i should consider direct connection from pic to phone without max232 but just trough 1 kOhm resistors. Shall i send in inverted mode then?

And i measured voltages on the original cable, both form the phone's side and rs232 side. Cable was pluged in the phone and not in rs232. I can give them here, if somebody is interested. It seems, that phone is powering the cable's logic.

Ioannis
- 14th October 2005, 14:01
If you miss the MAX232 then send in inverted mode. The MAX does this inversion.

Another thing you may try is to use Numeric mode instead Alphanumeric. Then the phone answers 0 (zero) for OK, 4 for error etc.

Did you double check that you have not connected Rx, Tx the wrong direction? Try to cross connect them. Don't worry, RS232 is able to withstand this if it wrong.

Ioannis

Rufinus
- 14th October 2005, 14:31
OK, i will try again without MAX using inverted mode. How to set it in HSerout command?
I am sure about the RX TX connection, besides, with the pc communication there are no problems.
And i will try also numeric mode (atv0, if i am corect?)

Well, it would be easy to give up on it, but it looks like nobody tried yet with Siemens. And anyways i like doing this things, so i will keep on going untill its working anyhow, and than i will try to get it working with original cable (sometimes i am an optimist ;))

Thanx for your help, Ioannis, i appreciate it.


P.S. I have a feeling, that this must be some stupid little ditail which is missing. As allways, so..

Ioannis
- 14th October 2005, 14:48
On the matter of Rx Tx connection let me insist on. Try to change and see what happens.

Also with siemens (cannot recall the model) had no problem 2-3 years ago.

Whatever you connect to the PIC as modem and sending "AT" it should reply "OK".

Ioannis

NavMicroSystems
- 14th October 2005, 17:16
Rufinus,

I guess the problem is with the Siemens Datacable.
Most cables have some embedded electronics.
(At least a level shifter, probably more..)

This is usually powered from the PCs serial port (DTR & RTS)
So if you are using one of these cables to connect the phone you will need a MAX232 on the PIC end as well.
And you have to set the correct levels at DTR & RTS on the MAX232 at the PIC end in order to supply the cables embedded electronics.

As far as I can remember The Siemens interface is 5V tolerant, so all you need is 3 straight wires from the PIC to the Phone (no MAX232 at all).
But then you'll have to use SERIN2 /SEROUT2 instead of HSERIN/HSEROUT since HSERIN/HSEROUT doesn't allow to toggle between true/inverted mode.

Rufinus
- 14th October 2005, 18:05
OK, just finished selfmade cable.
Rx and Tx do through the MAX, and CTS(5), RTS(6), DCD(7) are connected to the GND(2) trough 10k resisors. Without this it does not work. Or other way is to connect RTS to CTS straigt, it will communicate with the PC then also. Communication with the PC was fine in both cases. So, sefmade cable is considered to work correctly, at least for the AT commands.

Tried swapping Rx and Tx as Ioannis sugested, but it just made my phone to go off. After restart it was working fine. So, nothing was wrong with my pinout.


Now, NavMicroSystems, i am not that sure about powering cable from COM port. It is rather powered by the phone itself (as strange as it sounds). As a proof i can say, that i was able to communicate with the PC, using original cable with only 3 wires (Rx, Tx, GND), rest of them i disconnected for the experimental sake. And in this configuration it was working with hyperterm or some similar software except original Siemens software, which did not detect the phone. Only when you connect also CTS line, the phone will be detected by the Siemens software.

I should mention again, i'm experimenting on S65 and S55 phones which are rather new, and they are different from older Siemens models, pinout of the phone's interface and connector itself are different.


So, now my setup looks like this: PIC--->MAX232--->MAX232(selfmade cable)--->Pnone

From above, and as NavMicroSystems says, both MAXes can be ommited. Will try then connecting straight PIC to Phone using serout2 in inverted mode.
Wish me good luck ;)

Rufinus
- 14th October 2005, 20:36
Well, i guess, your wishes did work ;)

A little :)

I did connect it straight with the pic and used inverted mode. And i got the phone dialing! Why didnt it work with pic16f84 then?? Who knows..

So, thanks to all who cared and helped, in particular, NavMicroSystems and Ioannis.


But it still leaves some questions. Why didnt it wont to work with cables??

Rufinus
- 15th October 2005, 00:24
Ooops. It was to early to yell Gloria! :(
It does work with S55, i am able to send commands to the phone, but not receive from the phone.
And with S65 nothing is working at all. Tried different modes..

NavMicroSystems
- 15th October 2005, 01:23
Rufinus,

I don't have the full specs of S55/S65
but this looks like a problem with the logic levels.
(Presuming your Code is OK)

Could you Scope the phones TX Pin to see wether it is sending anything at all and check it's output level?

You'll probably need a simple Levelshifter (i.e. 2 Transistors)

Ioannis
- 15th October 2005, 20:35
I totally agree with Ralph. If your phone is "listening" what PIC says then PIC should listen too. May be the phone outputs too low voltage levels. So a MAX232 or even a simple circuit with a transistor would help. Test with a scope to see the real levels. What Resistors are you using on Rx - Tx lines?

Ioannis

Rufinus
- 16th October 2005, 13:42
Well, i fidured out S65 now too. The cable is the key to success.
S55 and S65 use different cable detection mechanisms. Yes, yes, phones novadays are detecting data cables. So, besides the usual Rx, Tx, GND lines, one needs other pins on the phone too, to tell the phone, that cable is present and the datatransfer will happen.
After googling for some time, i found out, that pins 5,6, and 7 of the phone connector determine how the phone will detect the cable. If you connect 5,6,7 through 10k resistors to pin 2, Siemens S65 will detect it as DCA540, which is corresponding to the Siemens USB connection cable. And so the cable is detected, the phone will not respond to AT commands.
Now, if you connect only 5,7 through the 10k resistors to the pin 2, phone will recognize this cable as DCA510, which is Siemens COM cable. And S65 then responding to AT commands. Bingo! :)

For now, phone is connected straight to pic through 1k resistors on Rx Tx lines. And i tried to scope the Tx line from the phone and yes, i get a spike of about 3-3.5 volts (my scope is an old one) after sending the AT command to the phone. For comparizon, i scoped the Tx line of the pic, which gave about 4.5 volts spike.
So, i conclude, that phone is receiving and anwering now.
I guess, i will now send the Tx signal from the phone trough the MAX232, to insure proper levels for the pic.

And here is mine testing code i use:

DEFINE LOADER_USED 1


'LCD defines
DEFINE LCD_DREG PORTA 'set LCD data port
DEFINE LCD_DBIT 0 'set starting data bit (0 or 4) if 4 bit bus
DEFINE LCD_RSREG PORTA 'set LCD register select port
DEFINE LCD_RSBIT 4 'set LCD register select bit
DEFINE LCD_EREG PORTB 'set LCD enable port
DEFINE LCD_EBIT 3 'set LCD enable bit
DEFINE LCD_BITS 4 'set LCD bus size (4 or 8 bits)
DEFINE LCD_LINES 2 'set number of LCD lines
DEFINE LCD_COMMANDUS 2000 'set command delay time in us
DEFINE LCD_DATAUS 50 'set data delay time in us
DEFINE OSC 20 'set crystal speed


b0 var byte

include "modedefs.bas"


'Main program


pause 1000 'wait for screen to sort get started
start:




lcdout $FE,1, "Sending AT.."
pause 3000
serout2 portc.4, 84, ["AT", 13]
serin2 portc.5, 84, [b0]
lcdout $FE, 1, b0


pause 3000
lcdout $FE,1, "Sending command.."
serout2 portc.4, 84, ["at+cgmm", 13]
serin2 portc.5, 84, [b0]
lcdout $FE,1, b0
pause 5000
goto start
end


-------------------------------------------

Now, i predict your comment about b0. With this i gust try to get anything from the phone, for example, after AT, b0 should be displayed as O (from OK), and after AT+CGMM it should be S (from S65). When i get correct response, i will change to WAIT("OK") or so.

And one more detail. As you see, i used mode 84 in serout2, which is True mode. In inverted mode, which would be the 16468, phone does not respond (very strange, indeed).

Rufinus
- 16th October 2005, 16:45
Switched back to HSEROT, HSERIN just to experiment. Seems to be fine, phone starts dialing! (extremely strange).
But still cannot receive anything. Considering level shifter for the Tx line of the phone.
Perhaps you have something simple in mind already?

Rufinus
- 16th October 2005, 20:18
Connected Tx line from the phone through max232 to pic. Nothing.
Than i desided to hook it up to pc. So the phone is receiving commands from the pic and outputting them to the pc.
Here is what i get:

AT#0D [len=2] <------it echoes AT command from the pic??
#0D[len=0]
OK#0D [len=3] <------ that is the answer
at+cgmm#0D [len=7] <-----command to display model number(also echoed?)
#0D[len=0]
S65#0D [len=4] <----- answer
#0D [len=1]
OK#0D [len=3]

So, now it is 100% clear, that phone is answering. But why then pic does not receive anything??? With or without max, i cant receive answers!

Ioannis
- 16th October 2005, 22:33
If you don't want the phone to echo (with PIC you sure do not want) try ATE0 (<- zero, not capital O).

Ioannis

Rufinus
- 17th October 2005, 21:15
Discovered strange thing. Works with S55. If i connect Tx line from the phone trough 1k resistor to one of the ports, serin2 will hang, waiting for an answer on that port. But when i quickly shorten this serin2 port to the ground, it starts working! And then hangs until the next command, then i short it and after it goes without problem to the end of the program. This trick does not work with HSERIN or SERIN. And only sometimes works with S65 phone.
With max232 doesnt work anyways.

Any ideas??



Here is my code:


DEFINE LOADER_USED 1

'UART hardware defines
DEFINE HSER_RCSTA 90h
DEFINE HSER_TXSTA 20h
DEFINE HSER_BAUD 9600
DEFINE HSER_CLROERR 1


'LCD defines
DEFINE LCD_DREG PORTA 'set LCD data port
DEFINE LCD_DBIT 0 'set starting data bit (0 or 4) if 4 bit bus
DEFINE LCD_RSREG PORTA 'set LCD register select port
DEFINE LCD_RSBIT 4 'set LCD register select bit
DEFINE LCD_EREG PORTB 'set LCD enable port
DEFINE LCD_EBIT 3 'set LCD enable bit
DEFINE LCD_BITS 4 'set LCD bus size (4 or 8 bits)
DEFINE LCD_LINES 2 'set number of LCD lines
DEFINE LCD_COMMANDUS 2000 'set command delay time in us
DEFINE LCD_DATAUS 50 'set data delay time in us
DEFINE OSC 20 'set crystal speed



b0 var byte
include "modedefs.bas"



'Main program


pause 1000 'wait for screen to sort get started

lcdout $FE,1, "Sending AT.."
pause 2000
HSEROUT ["AT", 13]
pause 500
HSEROUT ["ATE0", 13]
serin2 portc.4, 84, [str b0\10]
lcdout $FE, $C0, str b0\10
pause 3000

b0=0
lcdout $FE,1, "Asking model.."
pause 2000
HSEROUT ["at+cgmm", 13]
serin2 portc.4, 84, [SKIP 2, str b0\20]
lcdout $FE, $C0, str b0\20
pause 5000

b0=0
lcdout $FE,1,"Asking IMEI.."
pause 2000
Hserout ["at+cgsn", 13]
serin2 portc.4, 84, [SKIP 2, str b0\20]
lcdout $FE, $C0, str b0\20
pause 5000

b0=0
lcdout $FE,1,"Asking capabilities:"
pause 2000
Hserout ["at+gcap", 13]
serin2 portc.4, 84, [SKIP 2, str b0\20]
lcdout $FE, $C0, str b0\20
pause 5000


b0=0
lcdout $FE,1,"Asking time.."
pause 2000
Hserout ["at+cclk?", 13]
serin2 portc.4, 84, [SKIP 2, str b0\20]
lcdout $FE, $C0, str b0\20
end

NavMicroSystems
- 17th October 2005, 22:11
Rufinus,
I hate to say that, but you have got to do some homework.

Make yourself familiar with the principles of serial communitation and the datasheet of a MAX232.

Pay special attention on the MODES, (TRUE/INVERTED)

If you receiver is expecting the data line to be ILDE HIGH and your transmitter IDLES LOW, (and vice versa) you will see all kinds of strange phenomenon.

You are not really connecting one of the RS232 Outputs of the MAX to the phone or PIC, are you?
(you are about to kill the PIC and/or the Mobile)

Rufinus
- 17th October 2005, 22:46
RS232 output of max i do connect to the pic, but through 22k resistor.
Pic to phone both ways goes through 1k resistor.
There is no reason to connect rs232 straight to phone anyways, so i dont and would not. There is no problem now with the phone receiving commands. The problem is to receive answers on pic.

Regarding modes - tried both true and inverted, tried different baud rates.

Now it is connected to the pic without MAX. I still think it is the problem of levels.

If you have a good link in mind about serial communication, i would appreciate. Otherwise, gonna google.

Thanks for adwise anyways.

NavMicroSystems
- 17th October 2005, 23:07
RS232 output of max i do connect to the pic, but through 22k resistor.
A simple NPN Transistor and two resistors would do here.
(Invert the logic and shift the level to 5V)


Regarding modes - tried both true and inverted, tried different baud rates.
I still think it is the problem of levels.


Find out what level the Phones TX Pin has in Idle state, and what it is in active state.




If you have a good link in mind about serial communication, i would appreciate. Otherwise, gonna google.

Sorry, I don't have any link, but there are some good books, i.e.
"Serial Port Complete" by: Jan Axelson

Rufinus
- 18th October 2005, 21:38
I should report now, that the problem is solved!!
My thanks and respect goes to NavMicroSystems and Ioannis for helping me out.
Problem was solved by making a simple level shifter (so i can use phone with USART), using two BC 547 transistors.

Perhaps should make a simple conclusion, for those, who will work with Siemens S55/S65 phones.
There is no need in MAX232. Rx line of the phone can be connected to the PIC through 1k resistor. Tx line of the phone must be connected through simple level shifter. Written above is valid for PICs with USART onboard.
Pins 5 and 7 of the phone should be connected trough 10k resistors to pin 2.
Otherwise the phone will not detect the cable and will not accept commands from the PIC.

As a hint: if you dont have a spare connector for the phone, you can make one from AGP slot of the old PC motherboard, pin spacing is the same ;)

-----------------------------------------------------------------------
And, of course, if you are not sure what are you doing, better dont do it!You can damage a lot of expensive things!
-----------------------------------------------------------------------

So now i will move on to next step - sending messages in PDU format.

NavMicroSystems
- 18th October 2005, 22:41
Rufinus,

I'm glad to hear you have got it to work!

Why do you want to use PDU format, doesn't the S55 support TEXT?

Ioannis
- 19th October 2005, 08:19
Ralph is right about the serial kwnoledge Rufinus. I was about to say almost the same things. If you don't own the Serial Complete, do so as soon as possible. It will help you the most.

Now, about your phone, it is sure a problem of levels, no question about it. It is just that we cannot guess anything. You have to find data sheets and read them from A to Z. Then you sure find why it behaves like the way you describe.

Regards,
Ioannis

Rufinus
- 19th October 2005, 20:14
Well, S55/S65 suports only PDU, unfortunately :(


I will get the book, because this is not my last project related to this matter.

Regarding datasheets. It is quite a tricky one, to find a complete datasheet for the phone. Even service manual i managed to find in internet, has the stamp on it: "For internal use only". So it is pretty much of poking and trying here and there, or call it guessing, if you will. And if the models of the phone are relatively new..

Ioannis
- 20th October 2005, 14:21
OK. PDU is one thing. Some phone do support ASCII some do not.
That's why I choose modules like Telit or Wavecom for serious projects or Nokia for experimenting.

But EVERY phone should answer 'OK' if addressed by 'AT'.

Ioannis

NavMicroSystems
- 20th October 2005, 16:35
Ioannis is right.

There are two GSM-Terminals I can recommend:

SIEMENS TC35i Terminal

and the Telit Terminal Ioannis has already mentioned.

Lefteris
- 22nd November 2005, 09:59
Hi
I am trying to write and read my phone number as sting in on-chip eprom of a 16f877 but no luck!!.
I like aslo to write a new phone number durring the program runs...
Any idea ??


Lefteris Rhodes Island Greece

Ioannis
- 22nd November 2005, 10:20
More input would be usefull, like some code, phone type, connection (serial or what?).

Ioannis

kblim
- 25th November 2005, 15:33
Hi all,
The use of GSM phone as the communication module via SMS is the successful one. I have use this method to collect the data from the remote site.
Discussion here are more on interfacing the pic with the serial GSM phone. But I think it is difficult to get the serial interface GSM phone because the USB becomes the standard.
Any idea to use the PIC as the host usb that can connect to the USB port.

NavMicroSystems
- 25th November 2005, 16:59
kblim,

there are so many GSM-Modules (Engines) or even "standalone" GSM-Terminals available at reasonable prices.

OK, for a single shot prototype for home use one could try a mobile phone, but for a commercial product?

If you require just one or two GSMs for a hobby project go get you some used phones with a serial port. You can get used phones at very low prices.

However, I would recommend a GSM-Module or Terminal.

A good choice is SIEMENS or TELIT.
SIEMENS TC35i is a robust low cost GSM Terminal.
The TELIT Terminals offer some nice extra features but are more expensive.

The Telit PYTHON Terminal does even have some GPIOs, plenty of memory and supports I2C, so for many applications you wouldn't need an additional Micro at all!

This will reduce overall development cost and time to market to an absolute minimum.

cosmomen
- 24th January 2006, 13:56
Hi all,

I'm trying to make a data call to another phone with command ATD+43506.....
This is working fine the phone will make the call, but I can't hang up with the ATH command while ringing.
Can somebody help me please?

microkam
- 27th January 2006, 14:09
i plane to buy simense TC35i terminal , and there are many site to buy tc35i with different price ....
any body can help me to chose the best site with the best price >>>

PoTeToJB
- 25th February 2006, 12:18
Hai, could anybody help me on how to built a device (pic) connected to handphone and pc where i can control input just by sending sms. i already search through internet and iam trying to built one. could anybody help me. i want to use PIC16F84A as the controller as iam doing alot of thing with this MCU and control by nokia 3310. may be somebody could provide me the step and all the hex file that i need to built one. i interested on this project but have lack of experience!
please give me a guide

PoTeToJB
- 6th March 2006, 21:16
helllo

can same one tell me, what phone can support AT Command

please...

Ioannis
- 7th March 2006, 08:34
Nokia, Erricson, Siemens, Wavecom modules, Telit modules....

PoTeToJB
- 7th March 2006, 18:46
helllo

Ioannis..

I now Nokia, Erricson, Siemens, Wavecom modules have at command but not all model have at command.

i try to find nokia model (6310,6210) ,Erricson model (T28,T68) in my country but i can't find't.

can u give me what modal can support at command

i try to do same project like kasamiko ( post #90 ). if i use another phone can i use the kasamiko schematic.

sorry my engglish is not good.. i am malay boy

Ioannis
- 8th March 2006, 08:29
When I experimented with phones I used the ones you mentioned.

But when it comes to industrial projects or commercial that should be a complete device... do not think of using a mobile phone. Instead look for a module like Telit if you can solder the extremely thin connector or a Siemens - Ericsson and more easy the Wavecom which has a VGA-15 connector.

Language is not a problem. I am not native speaking too.

Ioannis

kasamiko
- 9th March 2006, 07:28
I've been using a Nokia 6210 and has a working SMS Controller FULLY working with 4 output to drive a relay and 4 input for sensors..
Also capable of sending SMS messages to the Master phone.

Current usage:

Anti carnapping for vehicles..will send SMS to master phone when any of the 4 sensors will be activated. the owner of the car will simply send simple command to turn off the vehicle engine, turn on the light and horn.

Future plan:

I will be adding a VOICE Module so the carnap vehicles can scream " I'M BEING CARNAPPED!" literally..

Regards

PoTeToJB
- 19th March 2006, 09:30
hello, every one..

now i success send sms using pic 16f84a and nokia 3310.. i use pic to push hp button...

My next problem is to read incomming msg (SMS) and send the data to VB6 and MS access .. i use Sony Erricsson T610. i want build database.. for the system i need use pic or i can directly send the msg to VB..

can someone help me..

i need your help..

---> i need use pic or not.
---> i want know how to send msg data to VB and MS Access.
---> want now how to build database and link to MS access.

thank for help..

Ioannis
- 20th March 2006, 08:32
You may read the header of the SMS by using the appropriate AT command (either directly from your PC or by your PIC) and disgard the bytes you don't need and keep the rest up to the end (CR+LF).

Another solution might be using the GPRS service if you have alot of data to send. May be more effective than SMS.

Ioannis

BruMans
- 24th March 2006, 07:14
I've been using a Nokia 6210 and has a working SMS Controller FULLY working with 4 output to drive a relay and 4 input for sensors..
Also capable of sending SMS messages to the Master phone.

Current usage:

Anti carnapping for vehicles..will send SMS to master phone when any of the 4 sensors will be activated. the owner of the car will simply send simple command to turn off the vehicle engine, turn on the light and horn.

Future plan:

I will be adding a VOICE Module so the carnap vehicles can scream " I'M BEING CARNAPPED!" literally..

Regards

i'm interested on this. could you share your code here?

PoTeToJB
- 27th March 2006, 09:50
hello

kasamiko
if i want send variable data can i use your program..
what part i must change..

i want send 3 variable data

Device 16F84A
Declare Xtal = 4

Start:
LOW LED
DelayMS 1000
SerOut2 PORTB.1, 84,["AT+CMGS=",34,"MyNumber",34,13]
DelayMS 1000
SerOut2 PORTB.1, 84,["TEST",13]
DelayMS 1000
SerOut2 PORTB.1, 84,[26]
DelayMS 3000
GOTO Start

thank

PoTeToJB
- 1st April 2006, 19:22
hello

can someone tell me what the number mean in kasamiko program..

number:

13
34
26

thank for help

BruMans
- 3rd April 2006, 02:37
hello

can someone tell me what the number mean in kasamiko program..

number:

13
34
26

thank for help

13 - CR (Carriage Return)
34 - "
26 - SUB (substitute) or Ctrl-Z key

chrisv2879
- 9th April 2006, 20:44
I've been using a Nokia 6210 and has a working SMS Controller FULLY working with 4 output to drive a relay and 4 input for sensors..
Also capable of sending SMS messages to the Master phone.

Current usage:

Anti carnapping for vehicles..will send SMS to master phone when any of the 4 sensors will be activated. the owner of the car will simply send simple command to turn off the vehicle engine, turn on the light and horn.

Future plan:

I will be adding a VOICE Module so the carnap vehicles can scream " I'M BEING CARNAPPED!" literally..

Regards

Hi Kasamiko
I´ve been trying with a 5120i TDMA phone but nothing!. The pinout of this cellphone says that the pin 4 is Analog ground, so i cant take 2,8V from there. Can u help me?.
thanks

charudatt
- 9th April 2006, 22:42
I am using SIMCOM GSM module with PIC to receive SMS successfully.

Now I am interested in Rx SMS's on the PC via serial port using VB6.

Any help

regards
Charudatt

PoTeToJB
- 11th April 2006, 21:48
hello
charudatt

goto this link.
i hope help u abit.
http://www.planet-source-code.com ---> search for receive sms in vb6
http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=54140&lngWId=1&txtForceRefresh=411200615432979755

rexilen
- 25th September 2006, 18:19
hello all...i need ur help about my project. i just finished read and study previous post but currently still hard to understand. well my project was simple..i using 3 capacitive sensor at 3 level..when it detect any diturbance let say when sensor 1 detect it will send input to pic16f873 and pic will send a text msg using nokia modem N30 to a specific phone number. i understand well about pdu how to encode letter.other sensor all do the same. i using max232 which connected at rx and tx pins.well my problem here i'm cant write specific program to send sms..for those want help..ur help is very appreciated.

rexilen
- 28th September 2006, 17:21
hello..nobdy reply..wel mybe i have ask bit by bit..


DEFINE OSC 12 'this command used for what..let say i used 20MHz
crystal with pic16f873 so should i set it to 20?

someone pls xplain commad below define for what please..

DEFINE HSER_TXSTA 20h
DEFINE HSER_RCSTA 90h
DEFINE HSER_BAUD 9600
DEFINE HSER_CLROERR 1

GSMBUFFER VAR BYTE[16]
Caller VAR BYTE[13]
GSMTime VAR BYTE[17]

HSerout ["AT+CMGF=1",13,10]'the number 13 and 10 stand for wat?

HSerout ["AT+CMGS=",34,"+491232456789",34,",129",13,10]'also 129,13,10

HSerout ["Test-Message",10,13] >> and also 10, 13?
HSerout [26] '26?

Ioannis
- 28th September 2006, 18:25
Have you read the manual? These are explained under the command Hserout and Hserin.

Ioannis

rexilen
- 28th September 2006, 19:10
manual?where can i got that..didnt find one of it,,huhu sorry

Ioannis
- 28th September 2006, 19:39
Did you buy the product and it did not included the manual?

Or is it a copied product?

Ioannis

rexilen
- 28th September 2006, 21:10
which poduct? nokia N30 modem gsm or what..well i got this all from lab and it doesnt have manual. well about the AT command Nokia modem can got here
http://www.nowsms.com/discus/messages/12/Terminal_AT_command_guide_V3_0-10600.pdf

whcih manual actually i must refer? i kinda blur @.@

Russell
- 2nd October 2006, 11:53
i need a circuit diagram showing the connection between rs232 and pic16f84 for sending and receiving sms. ofcourse the phone is nokia.(AT supported). i am in desperate need of it.
thanks.

Ioannis
- 2nd October 2006, 12:01
Have you ever used MAX232? (do a search on the forum and you will find a lot)

Have you an RS-232 cable for your Nokia Model?

Have you read the relevant AT commands for controlling you phone first through Windows terminal so to get familiar with the commands?

All these are necessary...

Ioannis

rexilen
- 2nd October 2006, 20:58
i used pic16f873..nokia modem n30..lcd 2x16..3 sensors which give an input to pic +5V. this 3 sensor connected to portA from portA 0-2.rx and tx connected to max232 and used 4.5Mhz Crystal with 33pF capacitor. the LCD pins which are E connected to RB0, RS to RB3, DB4 to RB4, DB5 to RB5, DB6 to RB6, and DB7 to RB7.
well..my project do like this..if sensor 1,2,and 3 detect it will give an input to pic and LCD will diplay a message and nokia modem will send sms text message to specific phone number. well below is my program and it didnt work..the LCD didnt display anything and the modem didnt send any message.someone please help which part is wrong..

Pause 1000
DEFINE LCD_DREG PORTB 'Define PIC port used for LCD data line
DEFINE LCD_DBIT 4 'Define first pin of portC connected to LCD DB4
DEFINE LCD_RESREG PORTB 'Define PIC port used for RS line of LCD
DEFINE LCD_RSBIT 3 'Define PortC pin used for RS connection
DEFINE LCD_EREG PORTB 'Define PIC prot used for E line of LCD
DEFINE LCD_EBIT 0 'define the 3 bit communication
DEFINE LCD_LINES 2 'Define using a 2 line LCD
DEFINE LCD_COMMANDUS 2000 'define delay between sending LCD commands
DEFINE LCD_DATAUS 50 'Define delay time between data sent

DEFINE OSC 4

DEFINE HSER_TXSTA 20h
DEFINE HSER_RCSTA 90h
DEFINE HSER_BAUD 9600
DEFINE HSER_CLROERR 1

GSMBUFFER VAR BYTE[16]
Caller VAR BYTE[13]
GSMTime VAR BYTE[17]

Init:

trisa = %11111111 'set portA-RA1 input
porta = %00000000 'set portA high to give an input sensor


SEN1 :
if portA.0 = 0 then SEN2 'If sensor 1 dont detect then jump to SEN2
if portA.0 = 1 then LCD1 'Sensor at level1 detect then go to LCD 1
goto SEN1

SEN2 :
if portA.1 = 0 then SEN3 'If sensor 2 dont detect then jump to SEN3
if portA.1 = 1 then LCD2 'Sensor at level2 detect then go to LCD2
goto SEN1

SEN3 :
if portA.2 = 0 then SEN1 'If sensor 3 dont detect then jump to SEN1
if portA.2 = 1 then LCD3 'Sensor at level3 detect then go LCD3
goto SEN1

LCD1:

LCDOut$fe,1 'Clear LCD
LCDOut$fe,2 'Position cursor at home

LCDOut "LEVEL 1 HAZARD"
Pause 1000
Goto SEND1

lcd2:

LCDOut$fe,1 'Clear LCD
LCDOut$fe,2 'Position cursor at home

LCDOut "lEVEL 2 HAZARD"
Pause 1000
Goto SEND2

LCD3:
LCDOut$fe,1 'Clear LCD
LCDOut$fe,2 'Position cursor at home

LCDoUT "lEVEL 3 HAZARD"
Pause 1000
Goto SEND3

SEND1:
'Send SMS Test-Message LEVEL 1
HSerout ["ATZ",13,10]
Pause 1000

HSerout ["AT+CMGF=1",13,10] 'Set Text Mode
Pause 500

HSerout ["AT+CMGS=",34,"+01234567890",34,",129",13,10]
Pause 500

HSerout ["LEVEL 1 HAZARD",10,13]
HSerout [26]
Pause 1000
goto SEN1

SEND2:
'Send SMS Test-Message LEVEL 2
HSerout ["ATZ",13,10]
Pause 1000

HSerout ["AT+CMGF=1",13,10] 'Set Text Mode
Pause 500

HSerout ["AT+CMGS=",34,"+01234567890",34,",129",13,10]
Pause 500

HSerout ["LEVEL 2 HAZARD",10,13]
HSerout [26]
Pause 500
goto SEN1

SEND3:
'Send SMS Test-Message LEVEL 3
HSerout ["ATZ",13,10]
Pause 1000

HSerout ["AT+CMGF=1",13,10] 'Set Text Mode
Pause 500

HSerout ["AT+CMGS=",34,"+01234567890",34,",129",13,10]
Pause 500

HSerout ["LEVEL 3 HAZARD",10,13]
HSerout [26]
Pause 1000
goto SEN1

Please someone took a look which part is wrong..

Ioannis
- 3rd October 2006, 08:46
For starters I would suggest to use crystal at 8MHz or better at 16MHz EXACTLY. Not 4.5 or other. May be 4MHz would work, but don't recommend it. Too slow. It is important to have correct frequency, otherwise the UART will be out of sync.

Then use these Defines

DEFINE HSER_RCSTA 90h
DEFINE HSER_TXSTA 24h '9600 baud rate, BRGH=1
DEFINE HSER_BAUD 9600
DEFINE HSER_SPBRG 129
DEFINE HSER_CLROERR 1

DEFINE OSC 8 'or 16

What are you trying to do here?

this makes the A port input :trisa = %11111111 'set portA-RA1 input
and this makes the port output (?): porta = %00000000 'set portA high to give an input sensor

Then I see at your code that you send a ATZ to the mobile. Have you checked how long does it take for a mobile to RESET? I found that the Wavecom needs about 17 seconds for the GSM engine to be accessible. In the meantime the AT commands are working OK!!!

First you have to check if the mobile is responding with its name like this:

HSerout ["AT+CGMI",13] 'Get Manufacturer ID
Hserin 1500,err1,[wait("WAV")] 'Wait for Wavecom Module <<<--- Put here the name of your modem!!!
lcdout com,line1,"Module found!"

One trick to succesfully realize that you can send SMS is to check if at the command AT+CMGF=1 the device responds with OK like this:

HSerout ["AT+CMGF=1",13] 'Text SMS mode
HSerin 5000,error,[wait("OK")]

The devices have different respond times for different commands.

You have to check with a terminal programm like Hyperterminal sending AT+ commands. Also always wait for a response from the mobile. Either OK or another character.

Ioannis

Russell
- 4th October 2006, 11:10
i am doing a project on gps and mobile phone.
using rs232 and dku-5 cable i can successfully receive and send sms which contain gps position.(in bs2)
but when i am using pic16f84a only to receive and send sms it's not working.
i think the picbasic pro code is ok.
it must be the circuit which is creating the problem.
please provide me the circuit if anyone can.
regards.

Ioannis
- 4th October 2006, 13:23
Why not YOU provide the circuit you are using to see if there is a problem??

Ioannis

Russell
- 8th October 2006, 12:59
Connection
1.DKU-5 cable connected to the Nokia phone.
2.a male type connector connected to the other end of the DKU-5 cable
3.from that connector I set up the connection to the basic stamp2 as shown above.
4.by the following bs2 code I successfully sent sms
SEROUT 1, 16572,25, [ "AT+CMGF=1" , CR]
SERIN 3, 16572,[ WAIT ( "OK" )]
SEROUT 1,16572,25,["AT+CMGS=",34,"+880191787670",34,CR]
SERIN 3, 16572, [WAIT (">")]
SEROUT 1, 16572, [“hello”,CR]
SEROUT 1, 16572, [26,CR]
SERIN 3, 16572, [WAIT ("OK")]
DEBUG "ok"

MY PROBLEM NOW IS, I MADE SAME CIRCUIT WITH PIC16F84A TO SEND SMS. BUT IT IS NOT WORKING. MY PICBASIC PRO CODE IS OK. I THINK (SURE) I COULD NOT MAKE THE CORRECT CIRCUIT FOR THAT. CAN ANYONE PROVIDE ME THAT.

Ziki
- 8th October 2006, 17:02
hi there....i'm doing some similar project ..i can sucessfully send sms from my gsm phone (t610 SE) now ..i'm having problem with the receiving part ...
below are my code :

DEFINE OSC 4
DEFINE HSER_TXSTA 20h
DEFINE HSER_RCSTA 90h
DEFINE HSER_BAUD 4800
DEFINE HSER_CLROERR 1
Caller VAR byte [5]


HSEROUT ["AT" ,13,10]
pause 500

HSEROUT ["AT+CMGF=1" ,13,10]
pause 1000

hserout ["AT+CPMS=",34,"ME",34,13,10]
pause 2000

loop:

HSEROUT ["AT+CMGR=1",13,10]
pause 2000

Hserin 6000,loop,[ wait("REC READ"),STR Caller\5 ]
pause 1000


Hserout ["at+cmgs=" ,34,"my number",34,13,10 ]
pause 2000
hserout [ str Caller,26,13,10]

pause 5000
end

inside my phone memory there's a msg ...i'm juzt trying to send back a sms which is (caller)
is there anything wrong with my code?
thx...

Ioannis
- 9th October 2006, 08:44
Russel:

Maybe if you interchange the tx and rx lines?


Ziki:

Try not to Pause after a Hserout command. Wait for a real answer from the device like the example I gave at http://www.picbasic.co.uk/forum/showpost.php?p=26344&postcount=198
Also I think raising clock from 4 to 8 ro 16MHz might help.

Ioannis

Ziki
- 10th October 2006, 09:15
hi ...still canot work ..:( i chnage my code to this ..it canot send sms )

DEFINE OSC 8
DEFINE HSER_TXSTA 24h
DEFINE HSER_RCSTA 90h
DEFINE HSER_BAUD 9600
DEFINE HSER_SPBRG 129
DEFINE HSER_CLROERR 1

sms:

HSEROUT ["AT" ,13,10]
hserin 5000,sms,[WAIT("OK")]


HSEROUT ["AT+CMGF=1" ,13,10]
hserin 5000,sms,[WAIT("OK")]


HSEROUT ["AT+CMGS=",34,"my number",34,13,10]
hserin 5000,sms,[WAIT(">")]


HSEROUT ["hello",26,13,10]
pause 5000

end

Ioannis
- 10th October 2006, 10:35
I suppose you did change also the crystal from 4 to 8MHz, not only the Define, right?

Ioannis

Ziki
- 10th October 2006, 12:31
yup...i change my hardware too...

Ioannis
- 11th October 2006, 07:26
Have you set the mobile to TEXT SMS mode prior to use the code you sent as an example?

Also have you disabled the echo of the device (by ATE0)?

Test the same commands with a terminal to compare the results.

More than that I cannot help. Sorry.

Ioannis

Russell
- 12th October 2006, 08:41
i have implemented the given circuit(only the right portion).
i used 8Mhz crystal.
but no result.
can you please help me.

mister_e
- 12th October 2006, 08:51
So i hope you have include the Max232 (icl232) too?

Ioannis
- 12th October 2006, 09:15
As Steve asked, did you used the 232 chip? What do you mean by "only the right portion"?

Ioannis

Ziki
- 13th October 2006, 19:02
hi ...ioannis ..how do i disable the echo?ATEO mean? ..is it necesssary to off it ???
thxxx....

Ioannis
- 13th October 2006, 22:36
Yes. Please do disable the response from the mobile since everything that you type is echoed back so you can see it on the terminal window. But on the microcontrler it is not needed. In fact, it messes with the UART as it is getting characters.

ATE0 (<-- this is zero, NOT letter O) is AT command to disable echo. Not that after a reset, this cames back to normal, so you have to send it again. Say on top of the program.

Ioannis

Ziki
- 14th October 2006, 09:43
ok..thx...
can you have a look at this thread ....
http://www.picbasic.co.uk/forum/showthread.php?t=4425
i use serin since hserin canot work ....
but don't know why ...it can only store the 1st data into the variable -buffer(1)
since the speed is reduced to T300 ...it should be able to catch it right ?:)
i try using 8Mhz ...also no luck ....
thxx

Ioannis
- 16th October 2006, 08:14
Sorry, cannot help any more. It seems to be something with your mobile. All the schematics is OK. About PDU I have no idea and to be honest, I don't want to get!!!

I always used phones with text ability and in control applications Wavecom and Telit modules.

I think that you have timing problem since the Hserin/Hserout is the best command on the PBP repertore. Of course a string handling needs to be improoved, but that's another thread story.

Ioannis

brenda
- 31st December 2006, 18:38
Hi,
Happy New Year To All!!!!!!


In DLR3-p of Atrox, which is the tx? RB4 or RB5. I'm trying to read the frame via hyperterminal.

Please help,
brenda

m_vincent
- 1st February 2007, 15:29
hi, i have a nokia 3310, another nokia 5110, an ericson T20e, does someone have a schematic to make my own datacable 100% operational and tested plz? (for using with hyperterminal at first time)
tanks a lot

Ioannis
- 2nd February 2007, 09:26
Hi. Where I live, a ready made cables (e.g. MobileAction) are way to cheaper than building one. I don't see why you should deal with it...

Ioannis

m_vincent
- 2nd February 2007, 09:41
simply to understand how does it work, because next step is to interface it with a pic, so i need to know how are the signal,....

Josuetas
- 11th April 2007, 07:33
Hi, I read it all, so now i shouldnt be punished.

Well, is everyone using the same phones? NavMicro said he had tried 62XX does this mean that a new 6230 phone will work? isnt this an USB telephone? does the same D+ D- pin apply to internal modem RX and TX somehow?

I read thorugh the whole post and there is not one schematic... i mean really? not one? i have conneceted GSM phones to microcontrollers and used FBUS protocol, for that you would at least use a max232 to be able to use Hardware USART at 115200.

This post seems to touch too many subjects! Pic to GSM phone connection should just talk hardware (ie. phone models and basic interconnections), there should be another post for software. From what i read here there are: FBUS, MBUS, Plain Serial, Pc to Pic, PC to phone, Pic to phone connections, AT commands, like 5 kinds of cables, many good and bad lines of code.

Help, i read 6 pages... i am confused... very....

Summary of the 6 pages:
To begin i want to give something, this post doesn´t deals with FBUS, so you will find that it doesnt deal with low profile Nokia phones, this phones can also be controlled but you will have to use FBUS, for that you would have to begin with http://www.embedtronics.com/nokia/fbus.html. The other thing i would recommend is the use of a Hardware USART instead of serin, an interrupt on serial port (only given by an USART) will allow you to control data received, wich seems to be the hardest part to control.
Some Siemmens phones can also be used, i have used c55 and a55 before they are plenty strightforward just connect TXpic to RXphone and viceversa and send some AT,cr string at any speed try several times.
Please use the tested program from NAVMicro of the first page of this post, it works. period.

And why is that i read all this ? ?.... Ah!!! yes, will for example nokia 6230 work??? The cable is USB and this AT modems are serial, how does that work?

bitmaniac
- 11th April 2007, 08:25
Josuetas :
I am using 6210 connecting to a pic (and picbasic pro) with no problem.
In order for the phone to accept /respond to AT commands use the circuit on this excellent site:
http://www.atrox.at/datacable/dlr3/index.html
and read "...Short description of the DLR-3 circuit..." paragraph that explains exactly the way the phone gets into 'AT command mode'.
The circuit is a must if you want 6210 accept AT commands.
I hope this helped you a little. Have a nice day :)

(P.S: I have built the first schematic that worked just fine, also I think there are cheap ready made DLR-3 vables around 10USD but I have not tested any of them!)

Ioannis
- 11th April 2007, 10:49
I don't think that 6230 was on the market at the time NavMicro refered to 62xx. I think he meant 6210 like phones.

Anyway USB and RS232 are not interchangable! Not the D+ D- relate to Tx and Rx of the RS232 signals!

You have to use a USB converter to RS232 or better use a phone of the older types that had RS232 interface. If want to make a commercial product I suggest one of the modules like Wavecom or Telit. Ericson is out of the modules market now.

Ioannis

Josuetas
- 11th April 2007, 17:55
Well But nokia 6210 isn´t available around here (its way too old) and GSM modules exceed the final cost of my possible product, so they are no good options. What about nokia 3220 it is serial for sure since the cable has an USB-RS232 converter in built and it is available, i haven´t been able to send AT commands to it though. I was able to Send AT commands to the 6230 but i suppose it is made throught the Windows Driver. How .... :| ?.... mmm

I am sure that nokia phones are way to different now than they were on this 6210 models, How is the modem activated now? it can´t be too hard since you can simply open HyperTerminal and send AT (is what i heard, i succeded in 6230)

Thanks for your replies.

Ioannis
- 12th April 2007, 07:56
What do you mean by "how is the modem activated now?"

It is always On! If you call the mobile from another computer with a dialup modem through terminal and have your mobile also connected to a PC with a terminal running, then after the first communication of the modems they are transparent. What you type from one terminal window, appears on the other.

Of course you must have payed for the data service to your mobile provider first!

Ioannis

Josuetas
- 12th April 2007, 14:29
In GSM phones like A55 you can´t use AT modem if you are in HandsFree mode, did you knew that? and from http://www.atrox.at/datacable/dlr3/index.html you have to use some pulldown resistors or the 6210 will not answer correctly (it says so). You cant communicate with FBUS unless you send U like 60 times to sync with the phone.
I have tried several phones from nokia which claim to have Data Modem in built, connected them to HyperTerminal and none works(just the ones with USB in Pop-port), have you ever tried one aside of the old 6210?

What do i mean with "how do you turn it on"? well ... How do you?.

I am looking for someone who actually had connected a new model, like 3220 or..... well i don´t now.... Any model. I personally have done it with Siemmens phones, they do are pretty strightfordward.

Ioannis
- 12th April 2007, 15:07
I have tried 6210, 6310, 6310i, Wavecom Fastrack, Telit and long time ago the Falcon mobile modem. All work simply by connecting them. Plug and Play sort of speak. After you type ati3 they respond with their name!

Ioannis

pukx
- 8th May 2007, 03:58
@bitmaniac, i would like to ask if i'm goin' to build the dlr3 can i use max232C in substitute for max3232? 'coz it's very hard to find those parts here... rgrds, pukx

bitmaniac
- 8th May 2007, 06:41
@pukx
I don't think you will have any problem using C version If I remember right it has to do with the operation temperature rating...

enesgurler
- 1st June 2007, 10:08
hi friends. i am working on a circuit that calls the mobile phone with pic 16f84a. but i couldn't write the exact code can you help me?
thanks

Ioannis
- 1st June 2007, 13:36
What have you written up to this moment? Can we see you project or is it ""TOP SECRET"?

I know the thread has grown exponentially, but have you read the previous posts? There are a lot snippets and I see no reason to look them for you and copy/paste here...

Ioannis

enesgurler
- 3rd June 2007, 12:03
What have you written up to this moment? Can we see you project or is it ""TOP SECRET"?

I know the thread has grown exponentially, but have you read the previous posts? There are a lot snippets and I see no reason to look them for you and copy/paste here...

Ioannis

ioannis, you misunderstand me. i don't want all codes about my project, i asked for any help. you may advise look this thread etc... never mind the project isn't top secret:) it on the link:

www.elektronika.ba

Ioannis
- 4th June 2007, 08:32
Hmm, I think there is a general misunderstanding in this forum.

We cannot help if we don't see any code that you have tried. There are many examples in this thread (try from the page 1 and after) for various PIC.

But we really need your code that is not working and your circuit.

By speculating I think solution cannot be found.

Here's a link for an older post

http://www.picbasic.co.uk/forum/showpost.php?p=26344&postcount=198

Ioannis

isaac
- 22nd June 2007, 12:06
Sorry Guys to bring this nokia 6210 thing up again i know you have all tried to give all the advise that you can, but i am a bit lost here.
I am trying to communicate with a Nokia 6210 with my pic using( Melabs LAB-X1 Experimenter/Lab Board) but i dont get any response from the phone .
i am using the Original Nokia DLR-3 Data Cable that i ordered from Nokia.
the phone works ok when i use the cable with Hypertheminal and i know my Hardware is ok because i can communicate with my pc with my project board
so where do you think the problem lies.

Regards
Isaac

i am trying to run the following program


Define LOADER_USED 1
Include "Modedefs.Bas"
DEFINE OSC 20

DEFINE HSER_RCSTA 90h
DEFINE HSER_TXSTA 20h
DEFINE HSER_BAUD 9600
DEFINE HSER_CLROERR 1
' Define LCD connections
Define LCD_DREG PORTD
Define LCD_DBIT 4
Define LCD_RSREG PORTE
Define LCD_RSBIT 0
Define LCD_EREG PORTE
Define LCD_EBIT 1


' Define program variables
col var byte ' Keypad column
row var byte ' Keypad row
key var byte ' Key value


OPTION_REG.7 = 0 ' Enable PORTB pullups

ADCON1 = 7 ' Make PORTA and PORTE digital
Low PORTE.2 ' LCD R/W low (write)

Pause 100 ' Wait for LCD to start

Lcdout $fe, 1, "Press any key" ' Display sign on message

loop: Gosub getkey ' Get a key from the keypad
Lcdout $fe, 1, #key ' Display ASCII key number
if (key =5) then
gosub sms
endif
Goto loop ' Do it forever


' Subroutine to get a key from keypad
getkey:
Pause 50 ' Debounce

getkeyu:
' Wait for all keys up
PORTB = 0 ' All output pins low
TRISB = $f0 ' Bottom 4 pins out, top 4 pins in
If ((PORTB >> 4) != $f) Then getkeyu ' If any keys down, loop

Pause 50 ' Debounce

getkeyp:
' Wait for keypress
For col = 0 to 3 ' 4 columns in keypad
PORTB = 0 ' All output pins low
TRISB = (dcd col) ^ $ff ' Set one column pin to output
row = PORTB >> 4 ' Read row
If row != $f Then gotkey ' If any keydown, exit
Next col

Goto getkeyp ' No keys down, go look again

gotkey: ' Change row and column to key number 1 - 16
key = (col * 4) + (ncd (row ^ $f))
Return ' Subroutine over

'Send SMS Test-Message
sms:

HSerout ["ATZ",13,10]
Pause 1000

HSerout ["AT+CMGF=1",13,10] 'Set Text Mode
Pause 500

HSerout ["AT+CMGS=",34,"+447895711481",34,",129",13,10]
Pause 500

HSerout ["Test-Message",10,13]
HSerout [26]
Pause 500

RETURN ' return from subroutine

Ioannis
- 22nd June 2007, 12:44
.....

'Send SMS Test-Message
sms:

HSerout ["ATZ",13,10]
Pause 1000 <<<<<<<<<<<<<< [1]

HSerout ["AT+CMGF=1",13,10] 'Set Text Mode
Pause 500 <<<<<<<<<<<<<< [2]

HSerout ["AT+CMGS=",34,"+447895711481",34,",129",13,10]
Pause 500 <<<<<<<<<<<<<< [3]

HSerout ["Test-Message",10,13]
HSerout [26]
Pause 500 <<<<<<<<<<<<<< [4]

RETURN ' return from subroutine

General all the above lack the response from the mobile. Every command has a response and that response comes with different timing. Other sooner other later.

So my suggestion is to:

[1]: Wait for the 'OK' response
[2]: Wait for the 'OK' response
[3]: Wait for the '>' response
[4]: Wait for the 'OK' response

Also, have put the phone in TEXT mode or is it in PDU mode?

A monitor on the RS232 lines to see what text is transmitting to both ends would be very helpfull. If your PC has a second Port use it for stealling the signals with two 10K and drive the Rx pin of the second RS232 com port.

Ioannis

isaac
- 22nd June 2007, 13:07
Ioannis

Thanks for your quick reply.
i delibrately removed the WAITS as i was debuging the phone because the phone was not sending any response back my program kept looping in sms.
i have only got one serial port on my pc so would be able to experiment as to your suggestion.
Is it true that i just neeed Tx/Rx & Gnd connection?

Here is my original code
Define LOADER_USED 1
Include "Modedefs.Bas"
DEFINE OSC 20

DEFINE HSER_RCSTA 90h
DEFINE HSER_TXSTA 20h
DEFINE HSER_BAUD 9600
DEFINE HSER_CLROERR 1
' Define LCD connections
Define LCD_DREG PORTD
Define LCD_DBIT 4
Define LCD_RSREG PORTE
Define LCD_RSBIT 0
Define LCD_EREG PORTE
Define LCD_EBIT 1


' Define program variables
col var byte ' Keypad column
row var byte ' Keypad row
key var byte ' Key value


OPTION_REG.7 = 0 ' Enable PORTB pullups

ADCON1 = 7 ' Make PORTA and PORTE digital
Low PORTE.2 ' LCD R/W low (write)

Pause 100 ' Wait for LCD to start

Lcdout $fe, 1, "Press any key" ' Display sign on message

loop: Gosub getkey ' Get a key from the keypad
Lcdout $fe, 1, #key ' Display ASCII key number
if (key =5) then
gosub sms
endif
Goto loop ' Do it forever


' Subroutine to get a key from keypad
getkey:
Pause 50 ' Debounce

getkeyu:
' Wait for all keys up
PORTB = 0 ' All output pins low
TRISB = $f0 ' Bottom 4 pins out, top 4 pins in
If ((PORTB >> 4) != $f) Then getkeyu ' If any keys down, loop

Pause 50 ' Debounce

getkeyp:
' Wait for keypress
For col = 0 to 3 ' 4 columns in keypad
PORTB = 0 ' All output pins low
TRISB = (dcd col) ^ $ff ' Set one column pin to output
row = PORTB >> 4 ' Read row
If row != $f Then gotkey ' If any keydown, exit
Next col

Goto getkeyp ' No keys down, go look again

gotkey: ' Change row and column to key number 1 - 16
key = (col * 4) + (ncd (row ^ $f))
Return ' Subroutine over

'Send SMS Test-Message
sms:
HSerout ["ATZ",13,10]
HSERIN 5000, SMS,[WAIT("OK")] ' wait for response ok for 5 seconds
HSerout ["AT+CMGF=1",13,10] 'Set Text Mode
HSERIN 5000, SMS,[WAIT("OK")] ' wait for response ok for 5 seconds
HSerout ["AT+CMGS=",34,"+447895711481",34,",129",13,10]
HSERIN 5000 , SMS, [WAIT(">")]
HSerout ["Test-Message",10,13]
HSerout [26]
Pause 500

RETURN ' return from subroutine

Ioannis
- 22nd June 2007, 14:01
You are welcome.

Of course I cannot debug from here, but can suggest to send the commands from terminal program and check what the phone responds.

If all seems OK then check if the PIC communicates OK with the terminal window and you emulate the phone by typing the responses (you have to be quick here...!)

Also check the settings of the DEFINES for the Baud and XTAL you use. I don't remember if these you use are correct.

Ioannis

isaac
- 22nd June 2007, 15:45
Just a quick one
Do i need RTS and DTR etc as those are not connected on the LAB-X1 Experimenter board ?

Isaac

isaac
- 22nd June 2007, 18:14
Just tried it with RTS/DTR tried to +5v but still no joy
maybe i need to get another nokia cable

Isaac

Ioannis
- 22nd June 2007, 20:59
First you do not need to use the RTS or other signal as long as you have low data rate and be able to process the data. I am using the 9600 mobile modem to transfer blocks of 66 bytes without any problem.

Second, have you check if the phone responds as I stated in my previous post?

Have you also checked the responses from your controller (PIC)?

What were the results?

Ioannis

isaac
- 23rd June 2007, 01:41
As stated the phone response ok and i can even send & receive sms
but only when its connected to the pc
My Pic also works correctly as i can send and receive via the serial port
via hyperterm
This is strange

isaac
- 23rd June 2007, 11:44
I think i would have to make the DLR3-p of Atrox as knowone seems to have used the original nokia data cable to communicate with the pic

Isaac

Ioannis
- 23rd June 2007, 13:01
Since you can send and receive with the current cable I don't see why you should change it.

Also please note that the phone might send other characters too, like more CR and LF.

You said you have only one Com on you PC, ok. You can do a "thief" with two 10K (or even 4K7) that take samples of the Tx and Rx signals while PIC and Mobile are connected together and send them to the Rx pin of the PC Com Port, just to monitor what they are doing while you are not looking. This way you will see exactly what the PIC wants the mobile to do, and what exactly is the mobile responding.

Please try to take a Screenshot of this and post it.

Ioannis

isaac
- 23rd June 2007, 16:11
Thanks Ioannis

I am gonna do that now and would keep you posted

Isaac

isaac
- 23rd June 2007, 17:41
i am trying to upload the screen shots but keep getting msg that this exceeds 200kb

isaac
- 23rd June 2007, 17:56
I dont know what happened to my last post.
i was trying to attach the screen shots but couldn't.
i connected breakout as you suggested and think i know what the problem is but not the solution lo:)
When i connected the Tx/Rx to the Rx of the Pc when i run my program
the pic is not sending anything to screen at all so this means the phone is not receiving anything so its not responding.
But if i then disconnect the phone DLR-3 cable from the serial port of my project board i can see the AT command being sent to the phone on screen so i think the phone cable maybe faulty.
i am still trying to get the shot to you but keep getting this massage below

Your file of 1.08 MB bytes exceeds the forum's limit of 200.0 KB for this filetype.

Isaac

Ioannis
- 23rd June 2007, 18:40
Make the file smaller jpg, png, bmp. No more than 200kb. This size is more than enough!

About the problem not monitoring try smaller resistors like 4K7 or smaller. May be your driver from the PIC side is not powerful. What chip do you use?

Ioannis

isaac
- 23rd June 2007, 18:51
i use Max232 which comes with the project board

isaac
- 23rd June 2007, 18:59
here are the results

Ioannis
- 23rd June 2007, 19:07
What I see is in the first case only AT. Where is the rest of the string?

Something is not working here. Check your overall setup of the PIC. Are you sure about the loaded program in the PIC memory? Try erasing before programming.

Should come up with the rest of the commands, like ATZ etc.

Ioannis

isaac
- 23rd June 2007, 19:18
Sorry about that.
you would only see AT because the pic times out when it dont get ok back and goes back in the loop
snipper of code

'Send SMS Test-Message
sms:
HSerout ["AT",13,10]
HSERIN 5000, SMS,[WAIT("OK")] ' wait for response ok for 5 seconds
HSerout ["AT+CMGF=1",13,10] 'Set Text Mode
HSERIN 5000, SMS,[WAIT("OK")] ' wait for response ok for 5 seconds
HSerout ["AT+CMGS=",34,"+447895711481",34,",129",13,10]
HSERIN 5000 , SMS, [WAIT(">")]
HSerout ["Test-Message",10,13]
HSerout [26]
Pause 500

RETURN ' return from subroutine

isaac
- 23rd June 2007, 20:00
Just a thought
Is there a Difference between DLR-3 & DLR-3P

Isaac