serin2?


Closed Thread
Results 1 to 12 of 12

Thread: serin2?

Hybrid View

  1. #1
    Join Date
    May 2006
    Posts
    19

    Unhappy

    OK, THIS IS THE WHOLE CODE:


    on the stamp:

    ' {$STAMP BS2}
    ' {$PBASIC 2.5}
    ' {$PORT COM1}

    dat VAR Byte
    DO
    SEROUT 10, 396, ["blink"]
    SERIN 10, 396, [WAIT("t"), dat]
    DEBUG "data: ", DEC dat, CR

    PAUSE 1000
    LOOP


    on the pic:


    define OSC 20
    INCLUDE "modedefs.bas"

    S_in var PORTC.0
    S_Out var PORTC.0
    Led var PORTC.3
    dat var byte

    Main:
    SerIn2 S_in,396,[dat]
    gosub blink
    SEROUT s_out, T2400,["1234t", dat]
    pause 50
    goto main

    Blink:
    high led
    pause 10
    low led
    return


    THAT code only returns me "data: 0" in my debug window (witch is already strange.)

    and if i use THIS code (the one i actually need):


    on the stamp:

    ' {$STAMP BS2}
    ' {$PBASIC 2.5}
    ' {$PORT COM1}

    dat VAR Byte
    DO
    SEROUT 10, 396, ["blink"]
    DEBUG "data: ", DEC dat, CR

    PAUSE 1000
    LOOP


    on the pic:


    define OSC 20
    INCLUDE "modedefs.bas"

    S_in var PORTC.0
    S_Out var PORTC.0
    Led var PORTC.3
    dat var byte

    Main:
    SerIn2 S_in,396,[wait("k")]
    gosub blink
    pause 50
    goto main

    Blink:
    high led
    pause 10
    low led
    return


    than it never blinks and never sees a "k". I really need this problem solved. please post ANYTHING that might help me (i live in european time so i usely have to wait a whole night before i can read your answers and an other day before you read my posts, so post anything you got, i don't have much time left) and my config is HS (in winpic) and define OSC = 20. "dat" is the byte in witch it saves the data received from serin2, isn't it?

    thanks in advance,

    Chris
    Last edited by chriroz; - 1st November 2006 at 07:38.

  2. #2
    Join Date
    May 2006
    Posts
    19

    Default

    I also tried to use an FlowPin and it didn't work. but i found out something strange. after i send my data from my stamp the pin stays high. is that normal? if i give an "low 10" command after it it will get low again

Similar Threads

  1. GPS $GPRMC to PIC16F684. Need help with SERIN2
    By xnihilo in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 27th November 2009, 09:47
  2. Getting SERIN2 to work?
    By BobPigford in forum mel PIC BASIC Pro
    Replies: 11
    Last Post: - 22nd July 2009, 20:10
  3. SLOW Serin2 and Serout2
    By dragons_fire in forum General
    Replies: 3
    Last Post: - 26th June 2009, 02:38
  4. SERIN2 digit parsing
    By skimask in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 7th January 2007, 23:15
  5. SEROUT2 and SERIN2 commands
    By bangunprayogi in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 4th August 2005, 09: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