|
The HomeLink® unit uses Microchip’s KEELOQ® rolling code technology[1] to access some brands of garage door openers. Every KEELOQ®-based HomeLink® transmission includes 5 parts:
- Serial Number
- Button/Function Code
- Status Code
- Counter Value
- Discrimination Bits
In a given message to be transmitted, these portions are organized as follows:
| Unencrypted |
Encrypted |
|
Status
Code
|
Button
Code
|
Serial
Number
|
Button
Code
|
Discrimination
Bits
|
Counter
Value
|
The HomeLink® unit transmits an unencrypted portion and an encrypted portion. The message is transmitted starting with the bit furthest to the right in the above figure and ending with the first bit furthest to the left.
Unencrypted Portion of the Transmission
The unencrypted portion of the transmission includes the status code, the button code, and the serial number.
Serial Number (24 or 28 bits)
Each HomeLink® unit has a serial number which the garage door opener reads to distinguish the HomeLink® unit from other HomeLink® units or other transmitters. The serial number can be 24 or 28 bits long, depending on the garage door opener system, and the lower 8 bits are used to form the discrimination bits (described below). The serial number is loaded from memory for each transmission.
Button Code (4 bits)
The button code identifies which button of the HomeLink® unit was pressed. The button codes are stored in memory and the HomeLink® unit will load the appropriate button code for each transmission. For more on how the button code is formed, see the HomeLink® Button Code.[2] Not all garage door opener systems require the button code be in the unencrypted portion of the message.
Status Code (2 bits)
The Status Code precedes the serial number and is uniform for each transmission to the garage door opener.
Encrypted Portion of the Transmission
The encrypted portion of the transmission is transmitted in an altered, encrypted, form. The encrypted portion is assembled as shown above and is then encrypted by the Keeloq® encryption algorithm. The encryption algorithm is controlled by a 64-bit encryption key, which is a code that is unique to each individual HomeLink® unit. After encryption, the encrypted portion of the message is 32 bits long.
Discrimination Bits (12 bits)
The Discrimination Bits consist of two parts the upper four bits and the lower eight bits.
The upper four bits of each HomeLink® unit transmission are the same. These bits are 1 0 1 0 (corresponding to hex value ‘A’).
The lower eight discrimination bits are formed in the HomeLink® unit by mathematically adding the lower eight bits of the serial number of that unit (transmitted as part of the unencrypted portion of the message) and the button code. The lower eight bits are not stored by the HomeLink® unit in memory. Rather, the HomeLink® unit generates these bits each time a HomeLink® unit button is pressed.
For more on how the Discrimination Bits are formed, see the HomeLink® Discrimination Bits.[3]
Button Code (4 bits)
The Button Code transmitted in the encrypted portion of the message is the same as the Button Code transmitted in the unencrypted portion of the message (discussed above).
Counter Value (16 bits)
The Counter Value is stored in memory in the HomeLink® transmitter. The Counter Value changes each time the HomeLink® unit button that is used to control the particular garage door opener is pushed.
HomeLink® Button Code
The button codes are as follows:
Channel 1: 1000 (hex 8)
Channel 2: 1011 (hex B)
Channel 3: 1010 (hex A)
Channel 4: 1001 (hex 9)
When the button codes are loaded into the unencrypted and encrypted portions of the message, the order of the bits is modified slightly. Specifically, the bits are rotated left once, so that the button codes which are sent with the transmission are, in fact:
Channel 1: 0001 (hex 1)
Channel 2: 0111 (hex 7)
Channel 3: 0101 (hex 5)
Channel 4: 0011 (hex 3)
HomeLink® Discrimination Bits
As mentioned, the discrimination bits are comprised of an upper four bits which are always 1 0 1 0 (hex A), and a lower eight bits. The lower eight bits are formed in the HomeLink® unit by mathematically adding the lower eight bits of the serial number of that unit and the button code. The button codes are as follows:
Channel 1: 1000 (hex 8)
Channel 2: 1011 (hex B)
Channel 3: 1010 (hex A)
Channel 4: 1001 (hex 9)
For example, if the last eight bits of the serial number are:
0 0 0 1 0 0 0 1 (hex 1 1)
. . . and the first HomeLink button (Channel 1) is pressed, the discriminator bits will be:
1 0 1 0 0 0 0 1 0 0 0 1 (hex A 1 1)
+ _ 1 0 0 0 (hex 0 0 8)
= 1 0 1 0 0 0 0 1 1 0 0 1 (hex A 1 9)
Note that the lower 8 bits of the serial number will be the first 8 bits of the serial number (in reverse order) that are transmitted since the HomeLink® unit transmits the message in reverse order.
|