Hanging on SERIN2 - SOLVED!


Closed Thread
Results 1 to 2 of 2
  1. #1
    blainecf's Avatar
    blainecf Guest

    Smile Hanging on SERIN2 - SOLVED!

    Problem:
    SERIN2 would never time-out

    Domain:
    PIC to PIC communications using standard TTL I/O pin, where second PIC may or may not be present. Chips particularly involved in this project: 18F4550, 18F458

    Discussion:
    The mode for SERIN2 is very picky about line conditions (from my recent 2 days wasted tracking this down!)

    Some modes WANT infinite ohms, some modes will not work WITH infinite ohms.

    Here's the problem. If you use a (cheap) scope, it alters the resistance and causes some modes to fail. If you use the modes that work with the scope, and then remove the scope, they fail.

    Solution:
    Use the modes that require some resistance (see below), and add a 10k (or more) resistor to ground (pull low). Then SERIN2 will work regardless of whether your scope is connected!

    See pages 201,202 of the PicBASIC PRO manual (or equiv. other reference) for more details.


    Mode Result Mode Detail
    ______ ___________________ ____________________________
    49548 Works with resistance Output Open, Conversion Inverted
    41356 Hangs with resistance Output Open, Conversion True
    396 Hangs with resistance Output Driven, Conversion True
    16780 Works with resistance Output Driven, Conversion Inverted
    33164 Hangs with resistance Output Open, Conversion True

    Notes:
    1. Above modes are for 2400 baud; for different bauds, match the other mode details.
    2. These are the only modes I tested. If you're having similar problems, create a simple benchmark and test each of the modes you're interested in.


    P.S. My humble apologies to everyone in advance if this info turns out to be bogus. I'm just reporting what's happend on my bench.



    (Search Key words: resistor pull-down serin2 hang timeout time-out time out comm mode)

  2. #2
    blainecf's Avatar
    blainecf Guest

    Default ...and, don't forget DEFINE CHAR_PACING 1000

    This also seems to be necessary for chip-to-chip communications. If the first letter you receive is correct, and the rest is garbage, this should solve it.

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