Serin2/Serout2 PIC 2 PIC


Closed Thread
Results 1 to 4 of 4
  1. #1
    actionplus's Avatar
    actionplus Guest

    Default Serin2/Serout2 PIC 2 PIC

    I am trying to communicate between 2 PICs for a week now. But have no success still.

    I am using the PIC16F877A as the transmitter and PIC16F628 as the receiver.

    All I am trying to do is take some data say decimals and send it to the 628 where it should disply it on a LCD.

    Here is what I was trying so far.


    'TX

    Include "modedefs.bas"

    Temp1 VAR BYTE
    Temp2 VAR BYTE

    Temp1 = 1
    Temp 2= 5


    loop: High PORTC.1 'LED indicator for transmission
    Serout2 PORTC.6,N2400,["A",temp1,temp2]
    Pause 200
    Goto loop




    "RX

    include "modedefs.bas"

    Temp1 VAR BYTE
    Temp2 VAR BYTE

    loop: Serin2 PORTB.1,N2400,[wait("A"),Temp1,Temp2]
    Pause 200
    LCDout $fe,1
    LCDout DEC Temp1, DEC Temp2

    Goto loop


    Doesn't this just send the the numbers 1 and 5 to the LCD?
    I am running the PICs with 10MHz xtal. I have tried it with 4MHz and still nothing. I tried DEFINE OSC 10.

    I have just a wire linking PORTC.6 of the 877A to the PORTB.1 of the 628.

    Hopefullly someone has tried thi before.

    HELPPPPPPP!

    Thanks
    Randy

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


    Did you find this post helpful? Yes | No

    Default

    A exremely good friend of mine as accomplished this using a
    12f675, and a 16f648.

    The 12F675 is the transmitter, and the 16F648 is the receiver.
    We developed our own little "Protocal", and send the data to the 16f648, allowing the 648 to display on our LCD, because it has the 8 bit port to power the LCD.

    I would be curious if you get yours working, using the built in Serial commands...

    Dwayne

  3. #3


    Did you find this post helpful? Yes | No

    Default

    Tx

    loop:
    serout2 portc.6,813,["A",byte1, byte0]
    pause 100
    goto loop


    Rx
    serin2 portb.1,813,[wait ("A"),byte1, byte0]


    This works for us. It's slow but it works fine for us. All you should have to do is check the 813 to something faster.

  4. #4
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    You can't use N2400 with Serin2 or Serout2.

    Check this list of modes.
    http://www.melabs.com/resources/ser2modes.htm

    The equivelent of N2400 is 16780

Similar Threads

  1. HSERIN & Interupts (aka controlling PIC programs from a remote PC)
    By HankMcSpank in forum mel PIC BASIC Pro
    Replies: 16
    Last Post: - 17th June 2009, 14:46
  2. PIC to PIC "wired" serial one-way communication - SERIN2/SEROUT2
    By flotulopex in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 14th April 2008, 20:02
  3. USB-FTDI[UM232R] with PIC16f877a
    By bjox in forum USB
    Replies: 1
    Last Post: - 23rd February 2008, 22:40
  4. having problems with Hantronix 20x4 lcd
    By Rhatidbwoy in forum mel PIC BASIC Pro
    Replies: 16
    Last Post: - 22nd December 2005, 12:22
  5. 2 cable and more pic
    By SuB-ZeRo in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 28th May 2005, 17:48

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