Serin2/ Serout2


Closed Thread
Results 1 to 5 of 5

Thread: Serin2/ Serout2

  1. #1
    Join Date
    Sep 2005
    Posts
    28

    Default Serin2/ Serout2

    I am trying to send data between two PIC 18F242s.
    I use the command:
    Junk Con 198: Synch Con "A": Dat var byte: INCLUDE "mosdedefs.bas"

    Dat = 15
    Serout2, PortC.5, 84, [Junk, (Synch), Dat] to send data to the second PIC.

    I receive the data with the command: Serin2, PortC.4, 84, [Wait (Synch), Dat]

    I receive the data correctly. I then try to send a signal back (using the same commands reversed) from the second Pic to the 1st, and the data is not received.

    I can switch the PICs and it will work from the 2nd to the 1st, but will not the 2nd PIC will not receive the data after sending.

    I have used this program for some time, but it now does not work.

  2. #2
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Are you trying to use an RF module in between the two PICs or just hardwared them together?

    junk Con 198: Synch Con "A": Dat var byte: INCLUDE "mosdedefs.bas"
    Put the include on it's own line.

    I receive the data correctly. I then try to send a signal back (using the same commands reversed) from the second Pic to the 1st, and the data is not received.
    It's probably not ready for it, or it's been ready and has given up already.

  3. #3
    Join Date
    Sep 2005
    Posts
    28


    Did you find this post helpful? Yes | No

    Default

    My final use is with radios, but I am now trying direct wires.

    I have experimented with time delays to make sure the receiver is ready, but it appears to lock up when trying to send the return command.

    Thanks

  4. #4


    Did you find this post helpful? Yes | No

    Default

    Are you sending the data bidirectionally across the same wire? Or are you sending on C.5 and receiving on C.4 on both parts, using two wires?
    Tim Barr

  5. #5
    Join Date
    Sep 2005
    Posts
    28


    Did you find this post helpful? Yes | No

    Default

    I am sending and receiving on the two ports on each PIC with two wires.

    Not sure why, but the problem was solved when I reset each Port to Input after transmitting or receiving.

Similar Threads

  1. Serout and 18F87J50
    By Glenn_Webber in forum Serial
    Replies: 8
    Last Post: - 20th November 2009, 14:26
  2. SLOW Serin2 and Serout2
    By dragons_fire in forum General
    Replies: 3
    Last Post: - 26th June 2009, 02:38
  3. SEROUT2 and SERIN2 commands
    By bangunprayogi in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 4th August 2005, 09:03
  4. Simple PC Menu System with Serin2
    By Tom Gonser in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 3rd April 2005, 08:27
  5. Serin2 and Serout2 with or without level converter
    By fbestepe in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 31st May 2004, 07:10

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