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 PLIZ CHECK MY SCHEMATIC,pic16f84->max232->gsm phone

    Hullo friends
    Pliz check my schematic attached whether the connections are ok and guide me, the pic16f84 should instruct the phone to send SMS when push button is +5V, which phone do u suggest i use, help me with coding and any other advice,
    thankyou
    regards
    dumato
    Attached Files Attached Files

  2. #2
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    3,807

    Default

    Post your code please.

    Hmm, wth no phone there is no help though.

    You have to select a phone with Serial port like the old 6210, 6310 of Nokia with the appropriate serial cable. But nowadays I think it is a little difficult to find such a device.

    May be you have to find a GSM module from an on-line shop (e-bay, sparkfun, digikey, etc)

    Once I used the Wavecom and have to same they are very good.

    About examples look at http://www.picbasic.co.uk/forum/showthread.php?t=3765

    There is code available but for specific model.

    Ioannis

  3. #3
    Join Date
    Feb 2003
    Posts
    432

    Default

    You may want to connect Pin 5 of J1 to ground
    Keith

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

  4. #4
    Join Date
    Mar 2010
    Posts
    20

    Default sample code

    Thankyou for ur contributions, about the code, am totally new in Picbasic programming but i got some code from the forum and tried to make it suit my project, it returns sucess when its pic616f877 what changes and additions should i make for it to suit pic16f84
    code:
    DEFINE OSC 4
    DEFINE HSER_TXSTA 20h
    DEFINE HSER_RCSTA 90h
    DEFINE HSER_BAUD 9600
    DEFINE HSER_CLROERR 1

    'Setup the names that will be used throughout the program
    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

    HSEROUT ["AT" ,13,10] ' send AT to modem followed by a CR and line feed

    HSERIN 5000, SMS, [WAIT("OK")] ' now wait for 5secs until OK is received however
    ' if it is not then goto the SMS routine again

    HSEROUT ["AT+CMGF=1" ,13,10]

    HSERIN 5000, SMS, [WAIT("OK")]

    HSEROUT ["AT+CMGS=+256782277658"]

    HSEROUT [13,10]

    HSERIN 5000, SMS, [WAIT(">")]

    HSEROUT ["BUTTON HAS BEEN PRESSED!"]

    HSEROUT [26] ' this is ASCII for Ctrl+Z of which completes SMS sending

    HSERIN 15000, SMS, [WAIT("+CMG")] ' then PIC should receive +CMG from modem

    HSEROUT [10] 'ascii code for a line feed

    end

    Pliz help me
    regards
    dumato

  5. #5
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    3,807

    Default

    1. Get rid off 16F84. It does not have Hardware Serial Port. It is old. It is too expensive too. From direct.microchip.com you can order whatever you want at very low cost.

    2. If you insist on using the F84 part, you have to change the commands from HSERIN/HSEROUT to SERIN/SEROUT or SERIN2/SEROUT2 as these are the software commands. Read the Manual for these. Almost the same as the hardware ones.

    But I really do recommend to use other chip.

    Ioannis

  6. #6
    Join Date
    Mar 2010
    Posts
    20

    Default pic16f84

    Thankyou Ioannis, currently its pic16f84 available for my project and in my country its hard to get access to microcontrollers so i have to just utilize it.
    I have replaced HSERIN/HSEROUT with SERIN/SEROUT but still generating errors,probably i have change something again;
    After changing this is the code:
    DEFINE OSC 4
    DEFINE HSER_TXSTA 20h
    DEFINE HSER_RCSTA 90h
    DEFINE HSER_BAUD 9600
    DEFINE HSER_CLROERR 1

    'Setup the names that will be used throughout the program
    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 ["AT" ,13,10] ' send AT to modem followed by a CR and line feed

    SERIN 5000, SMS, [WAIT("OK")] ' now wait for 5secs until OK is received however
    ' if it is not then goto the SMS routine again

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

    SERIN 5000, SMS, [WAIT("OK")]

    SEROUT ["AT+CMGS=+256782277658"]

    SEROUT [13,10]

    SERIN 5000, SMS, [WAIT(">")]

    SEROUT ["BUTTON HAS BEEN PRESSED!"]

    SEROUT [26] ' this is ASCII for Ctrl+Z of which completes SMS sending

    SERIN 15000, SMS, [WAIT("+CMG")] ' then PIC should receive +CMG from modem

    SEROUT [10] 'ascii code for a line feed

    end

    regards
    dumato

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