Hardware Reference
In-Depth Information
The waveform diagrams at the website are pleasant to look at, but the essential
ingredients boil down to the timings of three or four waveform components, which are
listed in Table 5-3 .
Table 5-3. Waveform Components
Component
Description
Start bit
Marks the start of a key-code
0 bit
0 bit for the code
1 bit
1 bit for the code
Stop bit
Stop bit (end of code)
Table 5-1 shows that only the NEC and the Samsung signals use a stop bit. In both
cases, each stop bit is simply an extra 0 bit added onto the end of the stream.
All protocols use a special “start bit” to identify where the code transmission begins.
RC5 just uses a 0-bit waveform (in other words, the start and the 0 bits are identical).
A signal component always begins with a burst (seen as a GPIO low) followed by a
time of no carrier (GPIO high). The only thing that varies among manufacturers is the
timings of these two signal components.
The RC5 protocol is unusual by allowing a start- or 0-bit transmission to begin with
no carrier (GPIO high). Only the 1 bit begins with an IR burst followed by no carrier. So
if the remote is going from idle to transmission, the first half of the bit cell for the start bit
is unseen . But after the first transition, to mark the start, the receiver need only expect a
transition every 0.889 ms for 0 bits, and double that if the bits are changing state.
Looking at Table 5-1 again, notice that the shortest signal time occurs for type 7 (Japan)
with a time of 0.42 ms. The smallest detectable unit of time for the GPIO signal changes
approaches 150 μs (0.15 ms) for the Raspberry Pi. But if the Linux kernel is busy with
other events, 420 μs events may not be reliably detected. Expect some trouble with that
particular protocol. Otherwise, the smallest unit of time shown is 560 μs for the other
protocols.
Code Organization
If you experiment, you may find occurrences of other pulses within the IR data stream.
For example, the Samsung remote occasionally included a 46.5 ms pulse. Others may do
something similar. I believe that these are key repeat signals, which happen when you
hold down a remote key.
In the Samsung bit stream, the bits gather into a 32-bit code. Your remote might use
a different code length, but 32 bits is a convenient storage unit for a key code. For that
reason, I expect that you'll find that in other brands as well.
 
 
Search WWH ::




Custom Search