English
Language : 

HCS370_11 Datasheet, PDF (18/42 Pages) Microchip Technology – KEELOQ® Code Hopping Encoder Four selectable baud rates
HCS370
7.0 INTEGRATING THE HCS370
INTO A SYSTEM
Use of the HCS370 in a system requires a compatible
decoder. This decoder is typically a microcontroller with
compatible firmware. Microchip will provide (via a
license agreement) firmware routines that accept
transmissions from the HCS370 and decrypt the
hopping code portion of the data stream. These
routines provide system designers the means to
develop their own decoding system.
7.1 Learning a Transmitter to a
Receiver
A transmitter must first be 'learned' by a decoder before
its use is allowed in the system. Several learning strat-
egies are possible. Figure 7-1 details a typical learn
sequence. The decoder must minimally store each
learned transmitter's serial number and current syn-
chronization counter value in EEPROM. Additionally,
the decoder typically stores each transmitter's unique
crypt key. The maximum number of learned transmit-
ters will therefore be relative to the available EEPROM.
A transmitter's serial number is transmitted in the 32-bit
fixed code, but the synchronization counter only exists
in the code word's encrypted portion. The decoder
obtains the counter value by decrypting using the same
key used to encrypt the information. The KEELOQ algo-
rithm is a symmetrical block cipher so the encryption
and decryption keys are identical and referred to gen-
erally as the crypt key. The encoder receives its crypt
key during manufacturing. The decoder typically calcu-
lates the crypt key by running the encoder serial num-
ber or seed through the key generation routine.
Figure 7-1 summarizes a typical learn sequence. The
decoder receives and authenticates a first transmis-
sion; first button press. Authentication involves gener-
ating the appropriate crypt key, decrypting, validating
the correct key usage via the discrimination bits, and
buffering the counter value. A second transmission is
received and authenticated. A final check verifies the
counter values were sequential; consecutive button
presses. If the learn sequence is successfully com-
pleted, the decoder stores the learned transmitter's
serial number, current synchronization counter value,
and appropriate crypt key. From now on, the crypt key
will be retrieved from EEPROM during normal opera-
tion instead of recalculating it for each transmission
received.
Certain learning strategies have been patented by 3rd
parties and care must be taken not to infringe.
FIGURE 7-1:
TYPICAL LEARN
SEQUENCE
Enter Learn
Mode
Wait for Reception
of a Valid Code
Generate Key
from Serial Number
Use Generated Key
to Decrypt
Compare Discrimination
Value with Fixed Value
Equal
No
?
Yes
Wait for Reception
of Second Valid Code
Use Generated Key
to Decrypt
Compare Discrimination
Value with Fixed Value
Equal
No
?
Yes
Counters No
Sequential
?
Yes
Learn successful Store:
Serial number
Encryption key
Synchronization counter
Learn
Unsuccessful
Exit
DS41111E-page 18
2011 Microchip Technology Inc.