433mhz


Closed Thread
Results 1 to 7 of 7

Thread: 433mhz

  1. #1
    Join Date
    Sep 2006
    Location
    Venezuela - Caracas
    Posts
    48

    Thumbs up 433mhz (solved)

    i use 2 circuits

    1 - 16F628
    1 - Transmiter

    2 - 16F628
    2 - Receive

    1 - code - Transmit
    Code:
       INCLUDE "modedefs.bas"
    
       Transmissor_Saida       VAR    PORTA.2 '
    
       Dados              var    byte
       Sincronismo        var    byte
       Codigo_Teste       var    byte
       
       CMCON          =     7                 ' PortA = digital I/O
       VRCON          =     0                 ' Voltage reference disabled
       OPTION_REG.7   =     0                 ' Enable PORTB pull-ups
    
       codigo_Teste   =     "©"
       Sincronismo    =     "®"
     
    Inicio:
       pause 100
       
       for dados =  33 to 255
          serout Transmissor_Saida, T2400, [codigo_Teste, sincronismo, dados, codigo_Teste]
          PAUSE 1
       next
       serout Transmissor_Saida, T2400, ["END", 13, 10]
    goto inicio
    
    end

    2 - code - Receive
    Code:
       INCLUDE "modedefs.bas"
    
       Serial_Entrada     VAR    PORTA.3      ' 2 Pic Rx -> 9  Max 232 Tx Marron
       Serial_Saida       VAR    PORTA.2      ' 1 Pic Tx -> 10 Max 232 Rx Laranja
       Receptor_Entrada   VAR    PORTA.1      ' 1 Pic Rx -> 9  Receptor data
    
       Dados              var    byte
       Sincronismo        var    byte
       Codigo_Teste       var    byte
       
       CMCON          =     7                 ' PortA = digital I/O
       VRCON          =     0                 ' Voltage reference disabled
       OPTION_REG.7   =     0                 ' Enable PORTB pull-ups
       
       codigo_Teste   =     "©"
       Sincronismo    =     "®"
    
       serout serial_saida, T2400, ["Inicio", 13, 10]
       
    Inicio:
          
       'SERIN serial_entrada, T2400, [CODIGO_TESTE, SINCRONISMO], DAdos
       'SERIN receptor_entrada, T2400, [CODIGO_TESTE, SINCRONISMO], DAdos
       
       SERIN receptor_entrada, T2400, DAdos
       SEROUT SERIAL_SAIDA, T2400, [DAdos, 13, 10]
       
    gOTO inicio
    my problem is than in receive,
    Dados = "["
    i not receive "[", "]", A
    in hyperterminal i receivce 10 caracter "["


    i use this code for test http://www.rentron.com/Stamp_RF.htm
    Last edited by mpardinho; - 4th December 2006 at 19:39.

  2. #2
    Join Date
    Jan 2006
    Location
    Istanbul
    Posts
    1,185


    Did you find this post helpful? Yes | No

    Default

    I am no expert but,

    1. You send three variables : T1, T2, and A.

    Then you have one variable, DAdos, in your receiver to receive them.
    You should have three variables in receiver.

    2. You use T2400 in your sender.
    But you have T1200 in your receiver.



    ---------------------------------
    "If the Earth were a single state, Istanbul would be its capital." Napoleon Bonaparte

  3. #3
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,604


    Did you find this post helpful? Yes | No

    Default

    Hi,
    Well, according to your code you are sending at 2400baud and recieving at 1200. That will not work....

    Also, on your reciever, you are telling SERIN to recieve one byte (DAdos). If you are sending three bytes you need to tell SERIN to recieve 3 bytes.
    Code:
    DAdos var byte
    Temp1 var byte
    Temp2 var byte
    
    SERIN SER_IN, T1200, DAdos, Temp1, Temp2
    SEROUT SER_OUT, T1200, DAdos, Temp1, Temp2, 10, 13
    
    '....and so on
    You can also try:
    Code:
    DEFINE CHAR_PACING 1000    'Serout character pacing in us
    Perhaps that will help.

    /Henrik Olsson.

  4. #4
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by mpardinho
    i use 2 circuits

    1 - 16F628
    1 - Transmiter

    2 - 16F628
    2 - Receive

    1 - code - Transmit
    T1 = "["
    T2 = "]"

    start:
    For A = 1 to 10
    SEROUT SERIAL_OUT, T2400, [T1, T2, A]
    next
    goto start

    2 - code - Receive

    start:
    SERIN SER_IN, T1200, DAdos
    SEROUT SER_OUT, T1200, [DAdos, 13, 10]
    goto start


    my problem is than in receive,
    Dados = "["
    i not receive "[", "]", A
    in hyperterminal i receivce 10 caracter "["


    i use this code for test http://www.rentron.com/Stamp_RF.htm


    You send 3 numbers and only receive one...how's that going to work?
    You send at 2400, receive at 1200...how's that going to work?
    Also, I don't see anything set up to synchronize the receiver, nothing relating to manchester encoding your data, and I could go on.
    Read thru the example at Rentron's site a bit more before you start in again.
    JDG

  5. #5
    Join Date
    Sep 2006
    Location
    Venezuela - Caracas
    Posts
    48


    Did you find this post helpful? Yes | No

    Default

    pardon....both are T2400.. rewrite post...my real code

    i will try DEFINE CHAR_PACING 1000 and post the results

    many thanks brothers
    Last edited by mpardinho; - 4th December 2006 at 15:04.

  6. #6
    Join Date
    Jan 2006
    Location
    Istanbul
    Posts
    1,185


    Did you find this post helpful? Yes | No

    Default

    Don't scare him skimask!

    Not having that much experience is not a crime nor is making mistakes.


    -----------------------------
    "If the Earth were a single state, Istanbul would be its capital." Napoleon Bonaparte

  7. #7
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by sayzer
    Don't scare him skimask!

    Not having that much experience is not a crime nor is making mistakes.


    -----------------------------

    No scaring going on here. Just pointing out the blatently obvious...again.
    JDG

Similar Threads

  1. Replies: 2
    Last Post: - 29th September 2007, 06:49
  2. 433MHz RF PIC2PIC connection
    By NavMicroSystems in forum mel PIC BASIC Pro
    Replies: 21
    Last Post: - 5th February 2006, 15:44

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