Assembly - Manchester Clock Recovery

Discussion in 'Embedded Systems and Microcontrollers' started by Neoaikon, Mar 28, 2008.

  1. Neoaikon

    Thread Starter New Member

    Mar 28, 2008
    9
    0
    I'm trying to create a tx/rx project using 16f84 micro controllers. I have the encode/decode, and send routines. My problem comes to the receiver side, I'm trying to recover the clock from the signal in software, and I've been coming up with different ways of trying it. This algorithm seems like it would work.

    Each byte lasts 100us, so at 50us is where my edge would lie. I plan to sample the signal every 10us, using the starting 10us to store the starting edge, and the last 10us to calculate the error. This means I sample the signal 8 times, each time the sample matches the starting edge, I increase its counter.

    When we're done sampling, I check this counter, if the edge fell on target, then the counter should equal 4. if it falls short, I know I'm sampling too to late, and I should sample earlier. I don't worry about sampling too late, since to the algorithm it would seem that it was still sampling too early, but the bits would be shifted.

    What do you guys think about this? is 8 samples going to be sufficient? am I completely wrong? thanks.
     
  2. beenthere

    Retired Moderator

    Apr 20, 2004
    15,815
    282
  3. Neoaikon

    Thread Starter New Member

    Mar 28, 2008
    9
    0
    I'm aware of various hardware solutions to recover the clock signal, however like I said I wish to try to do this in software. Is that possible? or would I be better off doing that in hardware? The reason I want to do it in software is not only for the challenge, but i'd like to have the bare minimum components in the circuit.
     
  4. beenthere

    Retired Moderator

    Apr 20, 2004
    15,815
    282
    If you can get the signal from the receiver to the computer, then there's no reason why the data can't get recovered in software. There are some practical problems with synchronization, so a unambiguous leader of several words length might be a good idea.
     
Loading...