Manchester and baud [II]


Results 1 to 4 of 4

Threaded View

  1. #4
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    We've been over this before, but I'll do it again....

    -----------------
    Transmitter Code:
    -----------------
    include "modedefs.bas"
    cmcon=7:current var byte:dataout var byte

    'pick a serial output pin and set it to an output here ---- ouput someregister.somepin

    input PORTA.0:input PORTA.1:input PORTA.2:input PORTA.3

    converts var byte[15]
    converts[0]=$55 : converts[1]=$56 : converts[2]=$59 : converts[3]=$5a : converts[4]=$65 : converts[5]=$66 : converts[6]=$69 : converts[7]=$6a
    converts[8]=$95 : converts[9]=$96 : converts[10]=$99 : converts[11]=$9a : converts[12]=$a5 : converts[13]=$a6 : converts[14]=$a9 : converts[15]=$aa

    Main:
    current=porta:dataout=converts[current]

    'pick your serial output pin and change it to match
    serout someport.somepin , n2400 , dataout

    goto main

    --------------
    Receiver Code:
    --------------
    cmcon = 7:Current var byte:datain var byte:temp var byte
    output PORTA.0 : output PORTA.1 : output PORTA.2 : output PORTA.3 : low PORTA.0 : low PORTA.1 : low PORTA.2 : low PORTA.3 : low PORTB.4

    'pick a serial input pin and set it to an input here ---- inut someregister.somepin

    converts var byte[15]
    converts[0]=$55 : converts[1]=$56 : converts[2]=$59 : converts[3]=$5a : converts[4]=$65 : converts[5]=$66 : converts[6]=$69 : converts[7]=$6a
    converts[8]=$95 : converts[9]=$96 : converts[10]=$99 : converts[11]=$9a : converts[12]=$a5 : converts[13]=$a6 : converts[14]=$a9 : converts[15]=$aa

    Main:

    'pick your serial input pin and change it
    serin someport.somepin , n2400 , datain

    for temp = 0 to 15
    if datain = converts[temp] then porta=temp
    next temp

    goto loop


    All the transmit program does is send out the present position of the inputs repeatedly to the receiver in manchester format. The receiver ends up getting trained eventually, but might 'freak out' a bit for the first few cycles.

    The reason why your other program didn't work is because you aren't sending the data in correct 'manchester format'. You lock bits to 1's and make others change. That won't work. The receiver won't get 'trained' right.

    And I've been a bit wrong in the past. Calling it 'manchester format' is wrong....it's actually called 'bi-phase encoding', but manchester is close enough.
    Last edited by skimask; - 23rd December 2006 at 22:39.

Similar Threads

  1. Help with RF transmittions
    By mbw123 in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 11th December 2006, 04:09

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