Serin Serout Help


Closed Thread
Results 1 to 16 of 16

Hybrid View

  1. #1
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    Not sure what you mean by datapin...
    But..
    On the receive side you are only checking the serial port once,
    Code:
    SERIN2 PORTA.5\PORTA.1, 3313, [DEC X]
    LOOP1:     
       HIGH PORTD.2
       PAUSE X
       LOW PORTD.2
       PAUSE X
    GOTO LOOP1
    Put the SERIN2 line inside of LOOP1.
    Dave
    Always wear safety glasses while programming.

  2. #2
    Join Date
    Aug 2010
    Location
    Maryland, USA
    Posts
    869


    Did you find this post helpful? Yes | No

    Default

    Thats prolly my fault. Way back at the beginning I suggested to take it out of the loop. I was thinking it would be gotten before entering the loop.
    -Bert

    The glass is not half full or half empty, Its twice as big as needed for the job!

    http://foamcasualty.com/ - Warbird R/C scratch building with foam!

  3. #3
    Join Date
    Nov 2010
    Posts
    7


    Did you find this post helpful? Yes | No

    Thumbs up Update

    Thanks again i moved SERIN inside the loop but to no avail. I am assuming there is an issue with my baud rate. If i am sending should the sending and receiving baud rate be identical or should one be inverted?

    Thanks for the help

  4. #4
    Join Date
    Nov 2010
    Posts
    7


    Did you find this post helpful? Yes | No

    Lightbulb Serin Serout Solved!

    So after alot of headaches i have finally got SERIN SEROUT working . The first and biggest problem was the baud rate i was using the initial (3313) is only meant to communicate with a level converter. I am using (27889) which is 7bit with even parity. Here is the code i hope it helps anyone else who is stuck with the SERIN SEROUT.

    Send:

    clear
    DEFINE OCS 4
    ADCON1 = %00000111
    CMCON = %00000111
    TRISA = %11111111
    TRISD = %00000000
    X VAR BYTE
    X = 555

    LOOP1:
    SEROUT2 PORTA.5, 27889 , [244]
    PAUSE 500
    GOTO LOOP1
    END

    Recive:

    Clear
    define ocs 4
    ADCON1 = %00000111
    CMCON = %00000111
    TRISA = %11111111
    TRISD = %00000000
    X VAR BYTE

    LOOP1:
    LOW PORTD.3
    SERIN2 PORTA.5, 27889, [X]
    HIGH PORTD.3
    HIGH PORTD.2
    PAUSE (X * 10)
    LOW PORTD.2
    PAUSE (X * 10)

    GOTO LOOP1

    END

    Thanks Again to all those who helped solve this.

Members who have read this thread : 1

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