Serin woes


Closed Thread
Results 1 to 5 of 5

Thread: Serin woes

Hybrid View

  1. #1
    Libretto's Avatar
    Libretto Guest

    Question Serin woes

    Hello there,

    I am having problems with the 'serin' command. I have searched this and the MELabs forum about this problem. I have read about the timeout part of serin and the need for a pull down resistor etc...

    At work, the line of code below has been used with no problems. (The preamble is correctly detected and the data stored).

    Serin portc.7,N9600,["ZOM"],z,zc,f,fc

    But when I try to use the timeout options, eg:

    Serin portc.7,N9600,20,fail,["ZOM"],z,zc,f,fc

    It appears the preamble is ignored, so the data is never recovered. Of course the timeout and fail routine works correctly. So somehow the timeout part conflicts with the preamble??

    Any ideas? Suggestions welcome.

    P.S.: Trying on 16F870 and PBP v2.43
    Last edited by Libretto; - 9th November 2004 at 10:48.

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


    Did you find this post helpful? Yes | No

    Default

    Hello Libretto,

    Libretto>>Any ideas? Suggestions welcome<<

    Try increasing your timeout to 500 instead of 20. If that doesn't work, try decreasing your transmit time from 9600 to 4800 to see if a slower speed works

    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...

  3. #3
    Libretto's Avatar
    Libretto Guest


    Did you find this post helpful? Yes | No

    Talking

    [EDIT]Thanks again, changed the crystal to 10MHz and the extended code works! [/EDIT]

    Thanks for the suggestions.

    Well I've tried various timeouts (upto a few seconds) with no change in results.

    I understand that 9k6 timing on a 4MHz crystal is a little dodgy, so maybe the extra timeout code is upsetting the system. Can't easily go to a lower baud rate as the serial sender is a built unit. But will see if a different version can be found, or even speed up the crystal in my circuit.
    Last edited by Libretto; - 9th November 2004 at 15:32.

  4. #4
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    Have you tried using SERIN2 or DEBUGIN..?

    See what happens with something like this:

    DEFINE DEBUGIN_REG PORTC
    DEFINE DEBUGIN_BIT 7 ' Use RC7
    DEFINE DEBUGIN_BAUD 9600
    DEFINE DEBUGIN_MODE 1 ' Inverted

    DEBUGIN 20,fail,[WAIT("ZOM"),z,zc,f,fc]

    I have found (on several occasions) that just using a different serial input type/command does the trick.
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

  5. #5
    Libretto's Avatar
    Libretto Guest


    Did you find this post helpful? Yes | No

    Thumbs up

    Again many thanks, the serin2 verion worked at 4MHz.

Similar Threads

  1. Serin EEPROM Programmer
    By dirtbiker5627 in forum mel PIC BASIC Pro
    Replies: 11
    Last Post: - 24th February 2010, 23:48
  2. Serin woes - qualifiers not working
    By tekart in forum Serial
    Replies: 11
    Last Post: - 2nd February 2010, 18:41
  3. PIC16f877 code crosses boundary @800h
    By inventosrl in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 6th April 2009, 22:03
  4. Problem with PBP interrupt and Serin, please help
    By rgregor in forum mel PIC BASIC
    Replies: 0
    Last Post: - 22nd August 2006, 19:02
  5. SerIn and SerOut
    By Dwayne in forum FAQ - Frequently Asked Questions
    Replies: 0
    Last Post: - 21st July 2004, 15:54

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