Self-clocking signal protocol
A signal encoding and decoding protocol to transmit both clock information and a data payload in a single line is disclosed. Data may be encoded in a unipolar non-return-to-zero line in which an initial pulse width determines a clock frequency, followed by a series of pulses indicating the data payload. Each clock transition following an initial synchronization pulse indicates a data bit in which the value of the bit is determined in relation to the previous bit. Edge information may indicate a change in bit value from the previous bit. If the transmission signal remains at the same level for a subsequent clock period, the bit value remains the same.
1 . An apparatus comprising:
a clock signal generator configured to generate a clock signal having a period; and
a processor responsive to the clock signal generator and configured to generate an encoded signal comprising a first pulse having a width representative of the period of the clock signal followed by data bits, wherein each edge of the clock signal is associated with a different data bit and wherein the encoded signal comprises edge information indicative of a value of the data bit; and
a decoder operable to decode the encoded signal to determine the value of each data bit, wherein the decoder is configured to:
measure the width of the first pulse,
store a period of a decoder clock signal represented by the width of the first pulse,
determine a first time interval from the first pulse to a first rising edge following the first pulse;
calculate a first number of equal consecutive bit values by dividing the first time interval by the period to determine a quotient:
determine a first bit value of one for each of the first number of equal consecutive bit values if the quotient is equal to one;
determine the first bit value of zero for each of the first number of equal consecutive bit values if the quotient is greater than one;
determine a first updated period of the decoder clock signal based on a time of the first rising edge and the first number of consecutive bit values;
determine a second time interval from an end of the first time interval to a proximate signal edge;
calculate a second number of equal consecutive bit values by dividing the second time interval by the first updated period of the decoder clock signal;
determine a second bit value of one for each of the second number of equal consecutive bit values if a prior transition was a rising edge;
determine the second bit value of zero for each of the second number of equal consecutive bit values if the prior transition was a falling edge; and
generate a second updated period based on the time of the proximate signal edge and the second number of consecutive bit values.
2 . The apparatus of claim 1 wherein the encoded signal is at a low level after the first pulse and before the data bits.
3 . The apparatus of claim 1 wherein the edge information comprises a presence of the rising edge, a presence of the falling edge, or an absence of an edge.
4 . The apparatus of claim 3 wherein the presence of the rising edge is indicative of a first change in the value of a data bit from a first value to a second value.
5 . The apparatus of claim 4 wherein the presence of the falling edge is indicative of a second change in the value of a data bit from the second value to the first value.
6 . The apparatus of claim 5 wherein the first value is ‘0’ and the second value is ‘1’.
7 . The apparatus of claim 3 wherein the absence of an edge is indicative of a first bit and a second, consecutive bit having the same value.
8 . The apparatus of claim 1 further comprising at least one sensing element operable to generate and transmit at least one sensor signal to the processor.
9 . The apparatus of claim 8 wherein the at least one sensing element comprises one or more of a magnetic field sensing element, an inductive sensing element, a resistive sensing element, an optical sensing element, a pressure sensing element, a motor control element, or a temperature sensing element.
10 . The apparatus of claim 9 wherein the at least one sensing element comprises a magnetic field sensing element operable to generate the at least one sensor signal, wherein the at least one sensor signal is indicative of a magnetic field associated with an object.
11 . The apparatus of claim 1 wherein the first updated period is determined by dividing the time of the first rising edge by the first number of consecutive bit values.
12 . The apparatus of claim 1 wherein the second updated period is determined by dividing the time of the proximate signal edge by the second number of consecutive bit values.
13 . A method of communicating a signal, the method comprising:
receiving a clock signal having a period;
receiving a data signal including data bits;
generating an encoded signal comprising a first pulse having a width representative of the period of the clock signal followed by one or more subsequent pulses representative of the data bits, wherein each edge of the clock signal is associated with a different data bit and wherein the one or more subsequent pulses comprise edge information indicative of a value of the data bit; and
decoding the encoded signal to determine the value of each data bit, wherein the decoding includes:
measuring the width of the first pulse;
storing a period of a decoder clock signal represented by the width of the first pulse;
determining a first time interval from the first pulse to a first rising edge following the first pulse;
calculating a first number of equal consecutive bit values by dividing the first time interval by the period to determine a quotient;
determining a first bit value of one for each of the first number of equal consecutive bit values if the quotient is equal to one;
determining the first bit value of zero for each of the first number of equal consecutive bit values if the quotient is greater than one;
determining a first updated period of the decoder clock signal based on a time of the first rising edge and the first number of consecutive bit values;
determining a second time interval from an end of the first time interval to a proximate signal edge;
calculating a second number of equal consecutive bit values by dividing the second time interval by the first updated period of the decoder clock signal;
determining a second bit value of one for each of the second number of equal consecutive bit values if a prior transition was a rising edge,
determining the second bit value of zero for each of the second number of equal consecutive bit values if the prior transition was a falling edge; and
generating a second updated period based on the time of the proximate signal edge and the second number of consecutive bit values.
14 . The method of claim 13 wherein the encoded signal is at a low level after the first pulse and before the data bits.
15 . The method of claim 13 wherein the edge information comprises a presence of the rising edge, a presence of the falling edge, or an absence of an edge.
16 . The method of claim 15 wherein the presence of the rising edge is indicative of a first change in the value of a data bit from a first value to a second value.
17 . The method of claim 16 wherein the presence of the falling edge is indicative of a second change in the value of a data bit from the second value to the first value.
18 . The method of claim 17 wherein the first value is ‘0’ and the second value is ‘1’.
19 . The method of claim 15 wherein the absence of an edge is indicative of a first bit and a second, consecutive bit having the same value.
20 . The method of claim 13 further comprising receiving at least one sensor signal from at least one sensing element operable to generate and transmit at least one sensor representing the data signal.
21 . The method of claim 13 wherein the first updated period is determined by dividing the time of the first rising edge by the first number of consecutive bit values.
22 . The method of claim 13 wherein the second updated period is determined by dividing the time of the proximate signal edge by the second number of consecutive bit values.
23 . A decoding apparatus comprising:
a clock; and
a processor responsive to the clock and configured to receive an encoded signal comprising a first pulse followed by one or more subsequent pulses, wherein the processor is further configured to decode the encoded signal by:
measuring a width of the first pulse of the encoded signal;
storing the width of the first pulse as a decoder clock period;
determining a first time interval from the first pulse to a first rising edge following the first pulse;
calculating a first number of equal consecutive bit values by dividing the first time interval by the decoder clock period to determine a quotient;
determining a first bit value of one for each of the first number of equal consecutive bit values if the quotient is equal to one;
determining the first bit value of zero for each of the first number of equal consecutive bit values if the quotient is greater than one;
determining a first updated period of the decoder clock period based on a time of the first rising edge and the first number of consecutive bit values;
determining a second time interval from an end of the first time interval to a proximate signal edge;
calculating a second number of equal consecutive bit values by dividing the second time interval by the first updated period of the of the-decoder clock period;
determining a second bit value of one for each of the second number of equal consecutive bit values if a prior transition was a rising edge;
determining the second bit value of zero for each of the second number of equal consecutive bit values if the prior transition was a falling edge; and
generating a second updated period based on the time of the proximate signal edge and the second number of consecutive bit values.
24 . The decoding apparatus of claim 23 wherein the first updated period is determined by dividing the time of the first rising edge by the first number of consecutive bit values.
25 . The decoding apparatus of claim 23 wherein the second updated period is determined by dividing the time of the proximate signal edge by the second number of consecutive bit values.