Pic to GSM Phone connection (HSerin problems)


Closed Thread
Results 1 to 40 of 289

Hybrid View

  1. #1
    Join Date
    Apr 2005
    Posts
    17

    Default

    Quote Originally Posted by Airrr
    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
    Last edited by kasamiko; - 5th September 2005 at 02:35.

  2. #2
    Join Date
    Sep 2005
    Location
    Switzerland
    Posts
    46

    Default

    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

  3. #3
    Join Date
    Apr 2005
    Posts
    17

    Default

    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.

  4. #4
    Join Date
    Sep 2005
    Location
    Switzerland
    Posts
    46

    Default

    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

  5. #5
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,184

    Default

    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

  6. #6
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,184

    Default

    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

  7. #7
    Join Date
    Sep 2005
    Location
    Switzerland
    Posts
    46

    Default

    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
    Last edited by Lotondo; - 6th September 2005 at 19:48.

  8. #8
    Join Date
    Sep 2005
    Location
    Switzerland
    Posts
    46

    Default

    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

Similar Threads

  1. Serial VB 2005 pic 16f877a problems
    By Snap in forum mel PIC BASIC Pro
    Replies: 28
    Last Post: - 8th July 2013, 00:52
  2. HSERIN & Interupts (aka controlling PIC programs from a remote PC)
    By HankMcSpank in forum mel PIC BASIC Pro
    Replies: 16
    Last Post: - 17th June 2009, 14:46
  3. problem with the GSM controller
    By Dariolo in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 30th May 2009, 20:33
  4. Automatic VB6 to pic serial connection
    By arniepj in forum Code Examples
    Replies: 13
    Last Post: - 10th January 2008, 07:57
  5. Pic to GSM Phone connection
    By samertop in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 14th July 2005, 13:40

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts