Multiple SERIN's


Closed Thread
Results 1 to 5 of 5
  1. #1
    JoeR's Avatar
    JoeR Guest

    Default Multiple SERIN's

    I'm trying to build an app that can listen to serial data streams from multiple input pins by polling the pins with multiple SERIN statements, each one referring to a specific input pin.

    My problem is that, after the first instance of SERIN does its thing on its pin, subsequent SERIN's on different pins don't seem to do anything.

    Does anyone have a suggestion for how to make this work?


    Joe

  2. #2
    Join Date
    Sep 2004
    Location
    Mentor, Ohio
    Posts
    352


    Did you find this post helpful? Yes | No

    Smile

    Hi Joe,

    I'll just beat the "pros" to the punch and tell you that if you want help you have to post the code. They don't like quessing about what you are doing.

    BobK

  3. #3
    Join Date
    Oct 2004
    Location
    Italy
    Posts
    695


    Did you find this post helpful? Yes | No

    Default

    Hi,

    From the PicBasic PRo manual:

    SERIN

    An optional Timeout and Label may be included to allow the program
    to continue if a character is not received within a certain amount of time.
    Timeout is specified in 1 millisecond units. If the serial input pin stays
    in the idle state during the Timeout time, the program will exit the
    SERIN command and jump to Label.

    * * * * *

    Post your code and describe the format of the data your are receiving.
    The devices sending data are also running code written by you?

    * * *

    While you receive data on one pin, data arriving at the same time on
    another pin will be lost. (Could work only if the sent data is redundant).

    Best regards,

    Luciano
    Last edited by Luciano; - 30th September 2005 at 09:03.

  4. #4
    crocodilebobbie's Avatar
    crocodilebobbie Guest


    Did you find this post helpful? Yes | No

    Default

    Hi:

    I found this same problem when the serin command does not get
    what it is looking for. If the strings do not get to the SERIN in the right
    format, then the serin just hangs up the PIC. The PIC is waiting for the
    correct number format.

    for example.

    SERIN PortC.0, t300, [170,170,TempIn]

    if the numbers 170 are not transmitted, or arrive correctly, the PIC hangs
    waiting for the correct "strings"

    bobbie

  5. #5
    Join Date
    Dec 2003
    Location
    Wichita KS
    Posts
    511


    Did you find this post helpful? Yes | No

    Default

    Why don't you connect all the Serial pins up to the same pin?

    Use Serin with the "Flag" or "Qualifier" to acknowledge good data.

    You can have bi-directional via one pin...a slave and/or master.

    When you use Serin on 3 different pins...You can still use the Qualifier, but I would use a very short "timeout". And either way, there is no guarantee you will lose a packet or two sometime or another. You may have to keep sending until you receive your data from the chip, them send a "receive" bit.

    Dwayne
    Ability to Fly:
    Hurling yourself towards the ground, and missing.

    Engineers that Contribute to flying:
    Both optimists and pessimists contribute to the society. The optimist invents the aeroplane, the pessimist the parachute

    Pilots that are Flying:
    Those who know their limitations, and respect the green side of the grass...

Similar Threads

  1. Multiple PICS from Same Crystal?
    By WOZZY-2010 in forum General
    Replies: 2
    Last Post: - 6th February 2010, 15:18
  2. Multiple RETURNS within a single subroutine
    By BrianT in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 21st June 2009, 16:43
  3. Problems controlling multiple pics
    By gandora in forum mel PIC BASIC Pro
    Replies: 11
    Last Post: - 29th May 2007, 08:59
  4. Multiple PIC programming
    By Nicholas in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 7th May 2007, 23:47
  5. Using Multiple EEPROMs
    By Tom Gonser in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 27th March 2005, 07:37

Members who have read this thread : 2

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