SMS via pic


Closed Thread
Results 1 to 16 of 16

Thread: SMS via pic

Hybrid View

  1. #1
    Join Date
    May 2008
    Location
    Italy
    Posts
    825

    Default

    RS232 pin2(RX) to leg7(T2OUT) of max232
    RS232 pin3(TX) to leg8(R2IN) of max232
    Since the phone is a DCE device you must change your connection:

    RS232 pin3(TX) to leg7(T2OUT) of max232
    RS232 pin2(RX) to leg8(R2IN) of max232
    Al.
    All progress began with an idea

  2. #2
    Join Date
    Oct 2009
    Posts
    8

    Default

    Thanks aratti for the information,

    Frankly speaking i did not have any idea what is DCE device, so i checked the internet and found that:
    Typically, one is called DTE (Data Terminal Equipment) and the
    other is called DCE (Data Circuit-Terminating Equipment). For instance, in EIA-
    232 communications, DTE devices (terminals, PCs, mini-computers) are quite
    stubborn and only want to talk to DCE devices (modems, multiplexers), and vice
    versa. For this reason, you may connect a PC COM port to a modem using a
    "straight through" EIA-232 cable. However, when you must connect a PC COM
    port to another PC COM port, you must use a "null-modem" cable. The function
    of the null modem cable is to "trick" the DTE device into believing that it is
    talking to a DCE device by cross-wiring the data and control pins in the cable.
    Ethernet AUI (Attachment Unit Interface) also uses the DTE/DCE convention,
    However, itŐs not as simple as it is with EIA-232.
    So in this case i think you meant: Microcontroller and mobile phone are both DCE device, so i need to cross-over RX and TX cables of the serial port.

    I will try this asap and inform back the result, thanks a lot.

  3. #3
    Join Date
    Oct 2009
    Posts
    8

    Default

    Hi again,

    in normal connection;
    * RC6/TX -> T2IN AND T2OUT -> PIN2 RXD
    * RC7/RX -> R2OUT AND R2IN -> PIN3 TXD

    i tried also cross-over connection, but no success ;
    * RC6/TX -> T2IN AND T2OUT -> PIN3 TXD
    * RC7/RX -> R2OUT AND R2IN -> PIN2 RXD

    i tried both connections again but still no success

    any idea or suggestion is really appreciated , thanks...

  4. #4
    Join Date
    Oct 2009
    Posts
    8

    Default

    Hi Everybody;

    Let me tell you, one of my observation;
    i checked the voltage levels at RXD and TXD pins of the mobile phone in both normal and cross-over connections:

    in normal connection:

    * RC6/TX -> T2IN AND T2OUT -> PIN2 RXD;

    PIN2 has negative voltage around 7 or 8 Volts,
    When signal comes from pic , it makes a sudden change

    * RC7/RX -> R2OUT AND R2IN -> PIN3 TXD
    PIN3 has 0 voltage,
    When signal comes from pic , it does not make a sudden change


    i tried also cross-over connection;

    * RC6/TX -> T2IN AND T2OUT -> PIN3 TXD

    PIN3 has negative voltage around 6 or 7 Volts,
    When signal comes from pic , it makes a sudden change

    * RC7/RX -> R2OUT AND R2IN -> PIN2 RXD
    PIN2 has negative voltage around 5 or 6 Volts,
    When signal comes from pic , it does not make a sudden change

    Do you have any idea, what is going on ?

  5. #5
    Join Date
    Oct 2009
    Posts
    8

    Default

    Hi people, try-outs continue

    I started to try different baud rates with different crystals as below:
    4Mhz/2400 - 4Mhz/4800 - 8Mhz/4800 - 8Mhz/9600

    But during these changes, of course I need to make some different definitions about serial communication:
    Code:
    'Definitions
    DEFINE OSC 4			'for 4 Mhz
    'DEFINE OSC 8			'for 8 Mhz
    
    DEFINE HSER_TXSTA 20h	'I wonder shall I define as DEFINE HSER_TXSTA 24h???
    DEFINE HSER_RCSTA 90h	'same for all
    
    DEFINE HSER_BAUD 2400	'for 2400 Baud rate
    'DEFINE HSER_BAUD 4800	'for 4800 Baud rate
    'DEFINE HSER_BAUD 9600	'for 9600 Baud rate
    
    DEFINE HSER_SPBRG 25		'for 4Mhz/2400 & 8Mhz/4800 with an error %0.16
    'DEFINE HSER_SPBRG 12	'for 4Mhz/4800 & 8Mhz/9600 with an error %0.16
    
    DEFINE HSER_CLROERR 1	'same for all
    
    'Initialization
    TRISB=%00000000
    PORTB=%00000000
    
    'Program Starts
    BEGIN:
    PORTB = 0
    HIGH PORTB.7
    PAUSE 1000
    LOW PORTB.7
    HIGH PORTB.6
    HSEROUT ["AT",13]	'send AT to modem followed by a CR and line feed
    HSERIN 5000, BEGIN, [WAIT("OK")]	'now wait for 5secs until OK is received however
    HIGH PORTB.5
    PAUSE 500
    GOTO BEGIN	'if it is not then goto the SMS routine again
    
    'END
    End
    Unfortunately none of above succeeded

  6. #6
    Join Date
    Oct 2009
    Posts
    8

    Default

    Btw i would like to show you setup; maybe i have a simple mistake .

    Thanks for your time and attention,

    Regards,
    Attached Images Attached Images

  7. #7
    Join Date
    May 2008
    Location
    Italy
    Posts
    825

    Default

    Tray to connect your system as per the attached schematic.This works for me.

    With MAX232 you should not use electrolytic capacitors. See the datasheet.

    Make sure you have proper contacts in your layout.

    .

    Al.
    Attached Images Attached Images  
    Last edited by aratti; - 8th November 2009 at 22:20.
    All progress began with an idea

Similar Threads

  1. Replies: 18
    Last Post: - 7th April 2009, 21:46
  2. HELP ME, SMS controlled relay using PIC
    By pazko1125 in forum mel PIC BASIC
    Replies: 14
    Last Post: - 2nd October 2008, 15:26
  3. Replies: 0
    Last Post: - 1st September 2008, 07:03
  4. Serial Pic to Pic using HSER
    By Chadhammer in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 11th March 2005, 23:14
  5. SMS decoding / encoding using PIC!
    By bitmaniac in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 19th March 2004, 07:03

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