Using SEROUT and SERIN


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

    Default Using SEROUT and SERIN

    I have 2 PIC16F876 processors and I am trying to comunnicate serially between them. I need to send 3 nimbers. I have tried numerous configurations, but can not get a reliable transfeer. I get a variety ov numbers but not the values that I asigned to the variables I am using an LCD display as a test device simply to view the results. Whats wrong?


    Display program
    AX VAR BYTE
    BX VAR BYTE
    CX VAR BYTE

    DEFINE LCD_DREG PORTB
    DEFINE LCD_DBIT 4
    DEFINE LCD_RSREG PORTB
    DEFINE LCD_RSBIT 1
    DEFINE LCD_EREG PORTB
    DEFINE LCD_EBIT 3
    DEFINE LCD_BITS 4
    DEFINE LCD_LINES 2
    DEFINE LCD_RWREG PORTB
    DEFINE LCD_RWBIT 2

    pAUSE 500

    LOOP1:
    LCDOUT $FE,1
    pause 2000
    LCDOUT $FE,$80,"TEST"
    pause 1000
    SERIN PORTC.3,0,3500,LOOP1,["A"],#AX,#BX,#CX
    LCDOUT $FE,$C0,#AX
    LCDOUT $FE,$C0 + 4,#BX
    LCDOUT $FE,$C0 + 8,#CX
    PAUSE 3000
    GOTO LOOP1

    ;Program for outputing the data


    AX VAR BYTE
    BX VAR BYTE
    CX VAR BYTE
    AX = 2
    BX = 150
    CX = 1
    LOOP1:
    SEROUT PORTC.4,0,[0,0,"A",#AX,#BX,#CX]
    PAUSE 1000
    GOTO LOOP1

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

    Default Re: Using SEROUT and SERIN

    Welcome to the forum.
    It looks like you have SERIN mixed up with SERIN2. Take a close look at SERIN2 and SEROUT2 and use those commands.

    Here is an example(s)
    http://melabs.com/samples/PBP-mixed/ser2mod.htm
    Dave
    Always wear safety glasses while programming.

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