Manchester Coding / Decodeing for RF Modules


Closed Thread
Results 1 to 24 of 24

Hybrid View

  1. #1
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    ByteOut.0[Index] = ~Manch.0[Index<<1]

    This just shifts the bit index pointer left by 1. If you run this with a serial connection, MCS ICD, or through MPLAB sim you can see how everything is working.
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

  2. #2
    a_critchlow's Avatar
    a_critchlow Guest


    Did you find this post helpful? Yes | No

    Post hmmm

    to if index starts off and is equal to 0, this is shifted left to 1 and invert the value at 1 to give you the value for 0? this done each time to make up the 8bits.

    If you take the encoded bit stream(example): 100110 and run it through the code it will come out like this: 100 (this is wrong as it should be 101)?



    many thanks

  3. #3
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    How did you get 100 from %00100110?

    The routines I posted take an 8-bit number as the input, and return a 16-bit encoded result.

    ASCII characters A to F
    ..................... input............encoded output..........
    Encoded A = %01000001 = %01 10 01 01 01 01 01 10
    Encoded B = %01000010 = %01 10 01 01 01 01 10 01
    Encoded C = %01000011 = %01 10 01 01 01 01 10 10
    Encoded D = %01000100 = %01 10 01 01 01 10 01 01
    Encoded E = %01000101 = %01 10 01 01 01 10 01 10
    Encoded F = %01000110 = %01 10 01 01 01 10 10 01

    If I feed in your value %00100110. I get %0101100101101001
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

  4. #4
    a_critchlow's Avatar
    a_critchlow Guest


    Did you find this post helpful? Yes | No

    Post <<1

    i going from encoded to decoding..

    the code says at counter 0 put into byteout.0 = invert of index pointer left 1.

    this inverts a 1 to give you 0 when it should be 1.

    it seems that you need to invert the first bit of the encoded data before you start moving through the rest of the code with <<1






    regards
    andrew

  5. #5
    kireytir's Avatar
    kireytir Guest


    Did you find this post helpful? Yes | No

    Unhappy

    Encode:
    For d = 0 to 3 ' 4 bit
    if v.0[d]=0 Then
    encoded.0[d*2]=0
    encoded.0[d*2+1]=1
    else
    encoded.0[d*2]=1
    encoded.0[d*2+1]=0
    endif
    next
    serout2 portb.0,396,[%1000,encoded]
    goto basla
    'd: number of bits to encode (8 bits)
    'v: byte to BE encoded
    'encoded: WORD sized variable holding the encoded
    'byte v.


    im using this manchester encoding but i didnt decode this pls help..

  6. #6
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,170


    Did you find this post helpful? Yes | No

    Default

    Here are the two subroutines to encode and decode the bi-phase or manchester scheme.

    It works for sure.

    Ioannis
    Attached Files Attached Files

  7. #7
    Skyjumper's Avatar
    Skyjumper Guest


    Did you find this post helpful? Yes | No

    Default

    Even after years still usefull... I was reading this topic, cause I am searching for a true solution. In this topic I miss the 90 degrees phase shifting, I think only bytesize is doubled here. I read somewhere else that Manchester code is a bi-phase code with not only transitions on the beginning of a bit, but at the center of a bit as well. It is defined as a transition orientated code, not a bit orientated. But maybe I am wrong here, cause I am quite new to this, so can anyone explain me please ?

Similar Threads

  1. Reading in Manchester code
    By brid0030 in forum Code Examples
    Replies: 0
    Last Post: - 10th March 2009, 22:55
  2. Manchester coding question
    By oneohthree in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 5th May 2007, 18:35
  3. 433MHz RF PIC2PIC connection
    By NavMicroSystems in forum mel PIC BASIC Pro
    Replies: 21
    Last Post: - 5th February 2006, 16:44
  4. Manchester coding
    By micro in forum General
    Replies: 1
    Last Post: - 13th January 2006, 04:40

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