Help me about communicating PIC with cellular phone...


Closed Thread
Results 1 to 14 of 14
  1. #1
    Join Date
    Nov 2006
    Posts
    8

    Default Help me about communicating PIC with cellular phone...

    Hi, i have to communicate PIC 16F877 with my Nokia 7250i mobile phone. I want to make a call by using PIC. But there's a problem i couldn't solve. I sent the link of the schematic of circuit, and wrote my codes below. Waiting for your help...




    INCLUDE "modedefs.bas"

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

    DEFINE OSC 10 ' Define clock Oscillator Frequency at 10Mhz
    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


    OUTPUT PORTC.6
    INPUT PORTC.7

    PORTC = %00000000 ' Initial state of PORT C

    Start:
    PAUSE 1000
    HSerout ["atD05354511850"]

    goto start

    end

  2. #2
    Join Date
    Feb 2003
    Posts
    432

    Default

    Is anyone else thinking "MAX232" ???
    Keith

    www.diyha.co.uk
    www.kat5.tv

  3. #3
    Join Date
    Jan 2006
    Location
    Istanbul
    Posts
    1,185

    Default

    Also, is anyone else thinking about doing some search?

    This forum has so many examples that most of the time makes me surprised.

    What a treasure we have here!



    ---------------------
    "If the Earth were a single state, Istanbul would be its capital." Napoleon Bonaparte

  4. #4
    Join Date
    Dec 2005
    Posts
    1,073

    Default

    Try cross-connecting TX & RX. That is, PIC-RX to Nokia-TX and vice versa. If you need to invert the logic (likely), see...or you could use two other of the PIC's pins and use SerIn & SerOUt so you can set the logic to inverted.

    If the Nokia uses RS232 voltage levels (unlikely) you need current limiting resistors in the TX & RX lines. See the PBP manual pages for SerIn, SerOut.
    Last edited by dhouston; - 1st November 2006 at 19:54.

  5. #5
    Join Date
    Nov 2006
    Posts
    8

    Default

    Yes I had cross connected RX and TX of the phone and pic. I don't think the problem is because of it.

    Nokia is working with TTL Logic so it gives high for 3.3v (so 5volt too) and low for 0 volts; So I think max232 is not needed to use here. Because it is using for RS232 which is working with 12Volt.

  6. #6
    Join Date
    Dec 2005
    Posts
    1,073

    Default

    Quote Originally Posted by d_hamen
    Yes I had cross connected RX and TX of the phone and pic. I don't think the problem is because of it.

    Nokia is working with TTL Logic so it gives high for 3.3v (so 5volt too) and low for 0 volts; So I think max232 is not needed to use here. Because it is using for RS232 which is working with 12Volt.
    You still need to invert the logic. The PIC UART is uninverted. You either need to use SerIn/SerOut so you can invert in your firmware or you need to add two inverters (e.g. using the comparators as suggested in the link I gave earlier).

    I'm not sure what you mean by "so 5volt too" but 3.3V is inadequate if you are using the PIC at 5V Vdd. Port C has Schmidt Trigger buffers which need 0.8*Vdd for a logic High (0.8*5V=4V). If you use SerIn/SerOut or DebugIn/Debug on pins that have TTL buffers, 3.3V should be OK.

  7. #7
    Join Date
    Dec 2005
    Posts
    1,073

    Default

    Are you sure about those 7250i pins? Everything I can find indicates the 7250i has USB and IR but there's nary a mention of a serial connection.

    What is FBus?

  8. #8
    Join Date
    Nov 2006
    Posts
    8

    Default

    FBUS is a protocol that nokia phones are using. It is same as AT commands but a bit complex.
    I made the program as you said. but it doesn't work. FBus Rx&Tx means it is supported for serial connection for Nokia 7250i.


    INCLUDE "modedefs.bas"

    DEFINE OSC 4 ' Define clock Oscillator Frequency at 4Mhz
    DEFINE HSER_CLROERR 0

    OUTPUT PORTc.6
    INPUT PORTc.7
    PORTc = %00000000 ' Initial state of PORT C


    Main:

    ' Make a call

    serout2 portC.6, T9600, ["ATZ",13,10] ' Reset the phone
    Pause 1000

    serout2 portC.6, T9600, ["ATDT",34,"+905448515247",59,34,",129",13,10] ' Make a call for 15 sec.s 59 is ;
    PAUSE 15000

    serout2 portC.6, T2400, ["AT",13,10] ' Finish the call
    PAUSE 1000

    GOTO Main

    END


    Thanks...
    Last edited by d_hamen; - 4th November 2006 at 07:49.

  9. #9
    Join Date
    Jan 2006
    Location
    Istanbul
    Posts
    1,185

    Default

    Himmm,

    I now where this phone number comes from!

    -------------------------
    "If the Earth were a single state, Istanbul would be its capital." Napoleon Bonaparte

  10. #10
    Join Date
    Dec 2005
    Posts
    1,073

    Default

    You need INVERTED logic -try N2400.

    And, assuming you use +5V to power the PIC, you are still using PortC which needs 4V for a logic high so the 3.3V from the Nokia will not be detected. Look at the Electrical Characteristics section of the datasheet.

    Do you have a URL that explains the FBus connections and protocol?
    Last edited by dhouston; - 4th November 2006 at 16:07.

  11. #11
    Join Date
    Dec 2005
    Posts
    1,073

    Default

    I found numerous links about F-Bus. If they are accurate, you are pretty far off base.It runs at 115200bps. Here's a schematic of the interface hardware...
    Last edited by dhouston; - 5th November 2006 at 03:11.

  12. #12
    Join Date
    Nov 2006
    Posts
    8

    Default

    Yes I read them. I know; FBus works with 115200 bps but I read the thread of "hserin, hserout problems" and I saw that they are all using FBus with 9600 bps. (If I did not misunderstand them )

    You said "you are still using PortC which needs 4V for a logic high so the 3.3V from the Nokia will not be detected"

    I used a resistor between them. And the voltage across the phone's Rx is nearly 3.5Volt. İs it again a problem if yes;

    what must I do then? choose a different port?


    Thaks so much...
    Last edited by d_hamen; - 5th November 2006 at 11:58.

  13. #13
    Join Date
    Dec 2005
    Posts
    1,073

    Default

    Quote Originally Posted by d_hamen
    You said "you are still using PortC which needs 4V for a logic high so the 3.3V from the Nokia will not be detected"

    I used a resistor between them. And the voltage across the phone's Rx is nearly 3.5Volt. İs it again a problem if yes; what must I do then? choose a different port?
    Yes. Look at DO40 & DO41 (Vih) Input High Voltage in the Electrical Characteristics section of the datasheet for your PIC. Ports with a Schmidt Trigger buffer (e.g. PortC) need 0.8*Vdd (4V with Vdd=5V) while ports with a TTL buffer (e.g. PortB, some PortA pins) only need 2.0V. See the I/O Ports section for buffer types.

    Note that while you can omit the MAX232 (which, in addition to converting voltage levels, inverts the logic) you still need to invert the logic.

    Unless the Nokia has auto-baud detection, you either need 115200 or need to send some (?) command to set the baud rate in the Nokia.

  14. #14
    Join Date
    Nov 2006
    Posts
    8

    Default In the end...

    Hi d_houston;

    I have lots of exams for a week.So; Because of my lectures I had to study and couldn't connect to the internet.

    Yesterday I bought ericsson A1018s and used it in my project. Also I changed some of my hardware too. (I changed pic and crystal)

    And result is perfect! It is working now. I used HSERIN and HSEROUT commands according to serout2, serin2 and I did not inverted. I don't use max232. I directly connect phone's pins to the pic. Now I am trying to make a control system with sms. For example when you send sms "led1" to pic's ericsson phone then first led will light in the circuit.

    Thanks for your help d_houston...

    Good works

Similar Threads

  1. SMS via pic
    By kenandere in forum GSM
    Replies: 15
    Last Post: - 10th March 2010, 11:00
  2. communication of pic 18f4520 and cell phone
    By Alisha in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 10th February 2010, 12:47
  3. Replies: 288
    Last Post: - 25th August 2008, 17:53
  4. Replies: 2
    Last Post: - 12th September 2007, 09:08
  5. Serial Pic to Pic using HSER
    By Chadhammer in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 12th March 2005, 00:14

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