Pic to GSM Phone connection (HSerin problems)


Closed Thread
Results 1 to 40 of 289

Hybrid View

  1. #1
    Join Date
    Oct 2005
    Location
    Stuttgart, Germany
    Posts
    24

    Default

    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

  2. #2
    Join Date
    Oct 2005
    Location
    Stuttgart, Germany
    Posts
    24

    Question

    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..

  3. #3
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,170

    Default

    Quote Originally Posted by Rufinus

    '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

  4. #4
    Join Date
    Oct 2005
    Location
    Stuttgart, Germany
    Posts
    24

    Unhappy

    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.

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

    Default

    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

  6. #6
    Join Date
    Oct 2005
    Location
    Stuttgart, Germany
    Posts
    24

    Default

    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..

  7. #7
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,170

    Default

    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

Similar Threads

  1. Serial VB 2005 pic 16f877a problems
    By Snap in forum mel PIC BASIC Pro
    Replies: 28
    Last Post: - 8th July 2013, 01: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, 15:46
  3. problem with the GSM controller
    By Dariolo in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 30th May 2009, 21:33
  4. Automatic VB6 to pic serial connection
    By arniepj in forum Code Examples
    Replies: 13
    Last Post: - 10th January 2008, 08:57
  5. Pic to GSM Phone connection
    By samertop in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 14th July 2005, 14:40

Members who have read this thread : 1

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