Sending AT Commands using SEROUT


Closed Thread
Results 1 to 3 of 3
  1. #1

    Default Sending AT Commands using SEROUT

    Hello!

    I am trying to get a PIC16F876A to send an SMS message from a Nokia phone. I have used AT commands from Hyperterminal to send an SMS but how can I implement these from the PIC.

    Can I just use?

    SEROUT PORTB.2,N9600,[#AT+CMGF=1,10,13] 'sets text mode
    SEROUT PORTB.2,N9600,[#AT+CSCA="XXX",10,13] 'replace XXX with message centre number
    SEROUT PORTB.2,N9600,[#AT+CMGS="YYY",10,13] 'replace YYY with recipient's number
    SEROUT PORTB.2,N9600,[#hello world,10,13] 'hello world is message to send

    Also to send the message from hyperterminal you press 'Ctrl-Z.' How do I write this as an AT command?

    Many thanks!

    Stuart

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


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by stuart_penman View Post
    Can I just use?

    SEROUT PORTB.2,N9600,[#AT+CMGF=1,10,13] 'sets text mode
    No! What is the # symbol doing in there? Please read your PBP manual on the Serial command syntax!

    You need this:

    Code:
    SEROUT PORTB.2,N9600,["AT+CMGF=1",10,13]	'sets text mode
    and respectively:

    Code:
    SEROUT PORTB.2,N9600,["AT+CSCA=XXX",10,13]	'replace XXX with message centre number
    SEROUT PORTB.2,N9600,["AT+CMGS=YYY",10,13]	'replace YYY with recipient's number
    SEROUT PORTB.2,N9600,["hello world",10,13]	'hello world is message to send
    Quote Originally Posted by stuart_penman View Post
    Also to send the message from hyperterminal you press 'Ctrl-Z.' How do I write this as an AT command?
    Simply just send 26 (that is Control-Z) like this:

    Code:
    SEROUT PORTB.2,N9600,[26,10,13]
    Ioannis

  3. #3


    Did you find this post helpful? Yes | No

    Default

    Thanks very much!

Similar Threads

  1. A Serial GLCD 128x64 Simple Project
    By Oldspring in forum Off Topic
    Replies: 0
    Last Post: - 8th March 2010, 20:58
  2. Serout to serial servo
    By azmax100 in forum mel PIC BASIC Pro
    Replies: 20
    Last Post: - 12th August 2009, 16:46
  3. Sending Commands from Visual Basic about IR to Pic
    By tne_de in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 29th April 2009, 06:09
  4. Advice-scrutiny for my serial controller
    By kevlar129bp in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 13th December 2008, 17:11
  5. Keypad unlock (as in garage door possibly)
    By Fred in forum Code Examples
    Replies: 5
    Last Post: - 2nd April 2006, 04:26

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