PLIZ CHECK MY SCHEMATIC,pic16f84->max232->gsm phone


Closed Thread
Results 1 to 39 of 39

Hybrid View

  1. #1
    Join Date
    Mar 2010
    Posts
    20

    Default

    I read through the manual and made the changes, now the new code is succesful with 16f84 but i wanted the same message to be sent to two phone numbers, pliz help me and check the code below;

    code:

    PushButton var PORTB.0 ' Setup the name PushButton to mean PortB input 0

    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

    SEROUT PORTB.1,6,["AT" ,13,10] ' send AT to phone followed by a CR and line feed

    SERIN PORTB.2,6,["OK"] ' now wait until OK is received

    SEROUT PORTB.1,6,["AT+CMGF=1" ,13,10]

    SERIN PORTB.2,6,["OK"]

    SEROUT PORTB.1,6,["AT+CMGS=+256782277658"]

    SEROUT PORTB.1,6,[13,10]

    SERIN PORTB.2,6,[">"]

    SEROUT PORTB.1,6,["BUTTON HAS BEEN PRESSED!"]

    SEROUT PORTB.1,6,[26] ' this is ASCII for Ctrl+Z of which completes SMS sending

    SERIN PORTB.2,6,["+CMG"] ' then PIC should receive +CMG from modem

    SEROUT PORTB.1,6,[10] 'ascii code for a line feed

    end

    regards

  2. #2
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,141

    Default

    Something like this?

    Code:
    PushButton var PORTB.0 ' Setup the name PushButton to mean PortB input 0
    
    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
    
    SEROUT PORTB.1,6,["AT" ,13,10] ' send AT to phone followed by a CR and line feed
    
    SERIN PORTB.2,6,["OK"] ' now wait until OK is received
    
    SEROUT PORTB.1,6,["AT+CMGF=1" ,13,10]
    
    SERIN PORTB.2,6,["OK"]
    
    SEROUT PORTB.1,6,["AT+CMGS=+256782277658"]
    
    SEROUT PORTB.1,6,[13,10]
    
    SERIN PORTB.2,6,[">"]
    
    SEROUT PORTB.1,6,["BUTTON HAS BEEN PRESSED!"]
    
    SEROUT PORTB.1,6,[26] ' this is ASCII for Ctrl+Z of which completes SMS sending
    
    SERIN PORTB.2,6,["+CMG"] ' then PIC should receive +CMG from modem
    
    SEROUT PORTB.1,6,[10] 'ascii code for a line feed
    
    '---------- second number------------
    
    SEROUT PORTB.1,6,["AT+CMGS=+000222333666444"]
    
    SEROUT PORTB.1,6,[13,10]
    
    SERIN PORTB.2,6,[">"]
    
    SEROUT PORTB.1,6,["BUTTON HAS BEEN PRESSED!"]
    
    SEROUT PORTB.1,6,[26] ' this is ASCII for Ctrl+Z of which completes SMS sending
    
    SERIN PORTB.2,6,["+CMG"] ' then PIC should receive +CMG from modem
    
    SEROUT PORTB.1,6,[10] 'ascii code for a line feed
    
    end
    Ioannis

  3. #3
    Join Date
    Mar 2010
    Posts
    20

    Default phone interface

    Thank you Ioannis, i highly appreciate ur help;
    Now i need to connect the phone to microcontroller, am looking for the models u told me nokia 6210, 6310 but i needed to know when i acquire the phone, how do i test whether it supports AT commands, any software i need to instal?
    regards
    dumato

  4. #4
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,141

    Default

    I would recommend to find a GSM module or a device like the Wavecom, Siemens or other brand. All support AT commands.

    Mobile phones are not designed for this job, although they will work eventually.

    Ioannis

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

    Default

    Ioannis, I would stress your above recommendation adding that some old phone will accept AT command, but they will work only in PDU mode, while the OP needs to work in Text mode.

    Al.
    All progress began with an idea

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

    Default

    Hi Al.

    Your project related to GSM remote control has been down. Are you aware of it?

    Ioannis

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

    Default

    .... Are you aware of it?
    Yes! I will upload it in the new forum as soon as I understand how does it work.

    Al.
    All progress began with an idea

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