English
Language : 

HCS360 Datasheet, PDF (15/24 Pages) Microchip Technology – KEELOQ CODE HOPPING ENCODER
7.2 Decoder Operation
In a typical decoder operation (Figure 7-2), the key gen-
eration on the decoder side is done by taking the serial
number from a transmission and combining that with
the manufacturer’s code to create the same secret key
that was used by the transmitter. Once the secret key is
obtained, the rest of the transmission can be decrypted.
The decoder waits for a transmission and immediately
can check the serial number to determine if it is a
learned transmitter. If it is, it takes the encrypted portion
of the transmission and decrypts it using the stored key
It uses the discrimination bits to determine if the
decryption was valid. If everything up to this point is
valid, the synchronization value is evaluated.
FIGURE 7-2: TYPICAL DECODER
OPERATION
Start
No Transmission
Received
?
Yes
No
Does
Serial Number
Match
?
Yes
Decrypt Transmission
Is
No Decryption
Valid
?
Yes
No
Is
Counter
Within 16
Execute
Yes Command
and
?
Update
Counter
No
Is
No
Counter
Within 32K
?
Yes
Save Counter
in Temp Location
HCS360
7.3 Synchronization with Decoder
The KEELOQ technology features a sophisticated
synchronization technique (Figure 7-3) which does not
require the calculation and storage of future codes. If
the stored counter value for that particular transmitter
and the counter value that was just decrypted are within
a formatted window of say 16, the counter is stored and
the command is executed. If the counter value was not
within the single operation window, but is within the
double operation window of say 32K window, the trans-
mitted synchronization value is stored in temporary
location and it goes back to waiting for another trans-
mission. When the next valid transmission is received,
it will check the new value with the one in temporary
storage. If the two values are sequential, it is assumed
that the counter had just gotten out of the single opera-
tion ‘window’, but is now back in sync, so the new syn-
chronization value is stored and the command
executed. If a transmitter has somehow gotten out of
the double operation window, the transmitter will not
work and must be relearned. Since the entire window
rotates after each valid transmission, codes that have
been used are part of the ‘blocked’ (32K) codes and are
no longer valid. This eliminates the possibility of grab-
bing a previous code and retransmitting to gain entry.
Note:
The synchronization method described in
this section is only a typical implementation
and because it is usually implemented in
firmware, it can be altered to fit the needs
of a particular system
FIGURE 7-3: SYNCHRONIZATION WINDOW
Entire Window
rotates to eliminate
use of previously
used codes
Blocked
(32K Codes)
Current
Position
Double
Operation
(32K Codes)
Single Operation
Window (16 Codes)
© 1996 Microchip Technology Inc.
Preliminary
DS40152C-page 15