sms to control pic..pls help...


Closed Thread
Results 1 to 40 of 54

Hybrid View

  1. #1


    Did you find this post helpful? Yes | No

    Default

    It looks like it should work, but what speed are running comms at, doh! just realised its 1200, doh!


    just try it again 300, see it the program is just not fast enough to catch it.

  2. #2
    Ziki's Avatar
    Ziki Guest


    Did you find this post helpful? Yes | No

    Default

    hi..i have change to T300 and also omit the "skipping" character part so that i can focus on just storing data in array.


    include "modedefs.bas"
    DEfine OSC 4
    buffer var byte[90]
    z var byte
    x var byte
    TRISB= %10001000


    portb.4=0
    portb.2=0
    portb.1=0



    serout portb.6,t300,["atz",13]
    pause 2000

    serout portb.6,t300,["at+cpms=",34,"me",34,13]
    pause 2000

    serout portb.6,t300,["at+cmgr=1",13]

    for x=1 to 3
    SERIN portb.7,t300,1000,oops,buffer(x)
    oops:
    next x
    pause 2000

    if buffer(1) ="+" then
    portb.1=1
    if buffer(2) ="C" then
    portb.2=1
    if buffer(3)="M" then
    portb.4=1

    endif
    endif
    endif

    end


    now ...only portb.1 LED light up .. ....running out of idea .

  3. #3


    Did you find this post helpful? Yes | No

    Default

    emm, I cant do anything at the moment I'm changing my PC/desk everything, but try it this way.......

    x=1

    while x<4
    serin buffer(x)
    x=x+1
    wend

    or use if....then... etc, I remember when I used a for loop I had a problem that went a way for no reason, I think its when I stopped using the ...for...next...


    Or I could be wrong.........

    <edit>

    Yes I am wrong because I have it working with a foor loop IE

    for x=1 to 12
    SERIN portb.7,t1200,500,oops,incphn(x)
    oops:
    next x

    <edit2>

    Can you use a max232 circuit or an old phone data cable to monitor on the PC with hyperterminal what is goin on?

    If you put it on the phone output, you get to see (because the phone echos) what your pic is sending, and what the phone replys with.
    Last edited by f_lez; - 13th October 2006 at 10:46.

  4. #4
    peter_o_tool's Avatar
    peter_o_tool Guest


    Did you find this post helpful? Yes | No

    Default test

    test

    p_O_t






    Quote Originally Posted by f_lez
    emm, I cant do anything at the moment I'm changing my PC/desk everything, but try it this way.......

    x=1

    while x<4
    serin buffer(x)
    x=x+1
    wend

    or use if....then... etc, I remember when I used a for loop I had a problem that went a way for no reason, I think its when I stopped using the ...for...next...


    Or I could be wrong.........

    <edit>

    Yes I am wrong because I have it working with a foor loop IE

    for x=1 to 12
    SERIN portb.7,t1200,500,oops,incphn(x)
    oops:
    next x

    <edit2>

    Can you use a max232 circuit or an old phone data cable to monitor on the PC with hyperterminal what is goin on?

    If you put it on the phone output, you get to see (because the phone echos) what your pic is sending, and what the phone replys with.

  5. #5


    Did you find this post helpful? Yes | No

    Default

    lol hello and welcome.

  6. #6
    zaliko's Avatar
    zaliko Guest


    Did you find this post helpful? Yes | No

    Default Hi

    It's not tested but try this one:

    include "modedefs.bas"
    DEfine OSC 4

    buffer var byte[20]
    z var byte
    x var byte
    TRISB= %10001000


    portb.4=0
    portb.2=0
    portb.1=0



    serout portb.6,t300,["atz",13]
    pause 2000

    serout portb.6,t300,["at+cpms=",34,"me",34,13]
    pause 2000

    serout portb.6,t300,["at+cmgr=1",13]

    ; wait + sign for 1 second and then store next 2 signs in buffer[0] and buffer[1]
    SERIN portb.7,t300,1000,oops,["+"],buffer[0],buffer[1]

    portb.1=1 ; port be is high beqause + sign already detected
    if buffer(0) ="C" then
    portb.2=1
    endif
    if buffer(1)="M" then
    portb.4=1
    endif
    goto dasasruli
    oops: ;no answer from the phone
    ; do something if there is no answer
    dasasruli:
    end

  7. #7


    Did you find this post helpful? Yes | No

    Default info required!

    I'm new to serial communication, can anyone tell me what does the 34,34,13 do in the below syntax???
    serout portb.6,t300,["at+cpms=",34,"me",34,13]
    and whats the difference between above and
    serout portb.6,t300,["at+cmgr=1",13]

    also please tell me does oops block get executed if + is not received ???
    SERIN portb.7,t300,1000,oops,["+"],buffer[0],buffer[1]


    Quote Originally Posted by zaliko View Post
    It's not tested but try this one:

    include "modedefs.bas"
    DEfine OSC 4

    buffer var byte[20]
    z var byte
    x var byte
    TRISB= %10001000


    portb.4=0
    portb.2=0
    portb.1=0



    serout portb.6,t300,["atz",13]
    pause 2000

    serout portb.6,t300,["at+cpms=",34,"me",34,13]
    pause 2000

    serout portb.6,t300,["at+cmgr=1",13]

    ; wait + sign for 1 second and then store next 2 signs in buffer[0] and buffer[1]
    SERIN portb.7,t300,1000,oops,["+"],buffer[0],buffer[1]

    portb.1=1 ; port be is high beqause + sign already detected
    if buffer(0) ="C" then
    portb.2=1
    endif
    if buffer(1)="M" then
    portb.4=1
    endif
    goto dasasruli
    oops: ;no answer from the phone
    ; do something if there is no answer
    dasasruli:
    end

    Best Regards
    Jamshid Dastur

Similar Threads

  1. SMS via pic
    By kenandere in forum GSM
    Replies: 15
    Last Post: - 10th March 2010, 11:00
  2. HELP ME, SMS controlled relay using PIC
    By pazko1125 in forum mel PIC BASIC
    Replies: 14
    Last Post: - 2nd October 2008, 16:26
  3. Siemens c55 sms control help please
    By camolas in forum mel PIC BASIC Pro
    Replies: 85
    Last Post: - 20th August 2008, 02:13
  4. Motor Control PLC with a PIC
    By sougata in forum mel PIC BASIC Pro
    Replies: 11
    Last Post: - 2nd November 2006, 08:59
  5. Need help on pic to pic flow control (simple problem I think)
    By khufumen in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 11th January 2006, 01:34

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