help with SERIN & SEROUT


Closed Thread
Results 1 to 6 of 6

Hybrid View

  1. #1
    Join Date
    Sep 2005
    Posts
    7


    Did you find this post helpful? Yes | No

    Thumbs up Danke

    thank you.
    I will test with your code or similar, but i dont understand the syncrho data. the transmitter and recivier works with asyncronous data too.

  2. #2
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    Code:
    SEROUT SerPin,BAUD,["UUUUUSYNCHRO",YourByte]
    RECEIVER SIDE
    Code:
    SERIN2 SerPin,BAUD,[WAIT ("SYNCHRO"),YourByte]
    Or a variant of it.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  3. #3
    Join Date
    Sep 2005
    Posts
    7


    Did you find this post helpful? Yes | No

    Red face Hi

    well, i tested the first program and doestn works, then I use a LCD (16X2) for view the variable in the Reciever, the lcd show me the number and show me how works my program and i can view that my program is wrong because the data is send time and time again, and before a while the data changes. I mean first put p.e.: 0,0,0,0,0,3,3,3,0,0,0,0 during the switch is off an suposed the lcd put only zeros. and "viceversa"

    Then i try to fix the problem but now i doesnt pass anything, i cant recieve or i cant transmitt, i testes the pics and works perfectly, I thought that modules RF had been disturbed, And I connected pics directly and even so it does not pass anything, then I believe that it is my program and at this point already my mind is blocked some help?

    here the two codes: (when it worked )

    transmitter code:'TX CODIGO TRANSMISOR

    INCLUDE "modedefs.bas"

    TRISA=6

    DATOUT VAR PORTA.0
    ONN VAR PORTA.1
    OF1 VAR PORTA.2
    C VAR BYTE

    TX:


    IF OF1=1 THEN
    C=2
    ENDIF



    IF ONN=1 THEN
    C=5
    ENDIF



    IF C=2 THEN
    SEROUT DATOUT,N1200,[0]
    ENDIF

    IF C=5 THEN
    SEROUT DATOUT,N1200,[7]
    ENDIF


    GOTO TX



    reciever code:'RX CODIGO RECEPTOR

    INCLUDE "modedefs.bas"

    TRISB=1

    DATAIN VAR PORTB.0
    LEDVER VAR PORTB.1
    DATO VAR WORDS


    RX:

    SERIN DATAIN,N1200,DATO

    IF DATO=0 THEN
    LOW LEDVER
    ENDIF

    IF DATO=7 THEN
    HIGH LEDVER
    ENDIF

    goto rx

  4. #4
    Join Date
    Sep 2005
    Posts
    7


    Did you find this post helpful? Yes | No

    Thumbs down my mind is dead

    Hola, mi cabeza ya de plano tiene muchos golpes, como volví hacer todo, hagamos de cuenta que no uso los modulos rf, ahora solo comunico los pics con un cable directamente, pero no me sale nada. se supone que con un switch mando un dato para prender un led y si esta cerrado mando otro para apagarlo y no lo hace. ya revise los pics y si funcionan, ya me canse de cambiar el programa y nada la verdad ya no se que hacer. les juro que ya me duele la cabeza de estar piense y piense y nada mas no me queda. he hecho otros programas pero este en particular como me ha dado dolores de cabeza

    alguna ayuda aqui los codigos:

    'TX CODIGO TRANSMISOR

    INCLUDE "MODEDEFS.BAS"


    TRISA=1

    BOTON VAR PORTA.0
    VIATX VAR PORTA.1
    LEDVE VAR PORTA.2
    LEDRO VAR PORTA.3

    pause 500
    TX:


    IF BOTON=1 THEN
    GOSUB SEND1
    ENDIF



    IF BOTON=0 THEN
    GOSUB SEND2
    ENDIF


    GOTO TX


    SEND1:
    SEROUT VIATX,N9600,[7]
    LOW LEDRO
    HIGH LEDVE
    RETURN

    SEND2:
    SEROUT VIATX,N9600,[0]
    LOW LEDVE
    HIGH LEDRO
    RETURN
    .............................................
    ' RX CODIGO RECEPTOR


    INCLUDE "MODEDEFS.BAS"

    TRISB=1

    VIARX VAR PORTB.0
    LEDRO VAR PORTB.1
    LEDVE VAR PORTB.2
    DATO VAR BYTE

    RX:

    SERIN VIARX,N9600,DATO

    IF DATO=0 THEN
    HIGH LEDVE
    LOW LEDRO
    ENDIF


    IF DATO=7 THEN
    LOW LEDVE
    HIGH LEDRO
    ENDIF



    GOTO RX:
    .......................................

    ya no puedo mas estoy frito alguna ayuda porfavor

Similar Threads

  1. A Serial GLCD 128x64 Simple Project
    By Oldspring in forum Off Topic
    Replies: 0
    Last Post: - 8th March 2010, 20:58
  2. Serout to serial servo
    By azmax100 in forum mel PIC BASIC Pro
    Replies: 20
    Last Post: - 12th August 2009, 16:46
  3. PIC16f877 code crosses boundary @800h
    By inventosrl in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 6th April 2009, 22:03
  4. Advice-scrutiny for my serial controller
    By kevlar129bp in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 13th December 2008, 17:11
  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