HCS500
K
EE
L
OQ®
Code Hopping Decoder
FEATURES
Security
•
•
•
•
•
Encrypted storage of manufacturer’s code
Encrypted storage of crypt keys
Up to seven transmitters can be learned
K
EE
L
OQ
®
code hopping technology
Normal and Secure learning mechanisms
DESCRIPTION
The Microchip Technology Inc. HCS500 is a code hop-
ping decoder designed for secure Remote Keyless
Entry (RKE) systems. The HCS500 utilizes the pat-
ented K
EE
L
OQ
code hopping system and high security
learning mechanisms to make this a canned solution
when used with the HCS encoders to implement a uni-
directional remote and access control systems. The
HCS500 can be used as a stand-alone decoder or in
conjunction with a microcontroller.
Operating
• 3.0V—5.5V operation
• Internal oscillator
• Auto bit rate detection
PACKAGE TYPE
PDIP, SOIC
V
DD
EE_CLK
EE_DAT
MCLR
1
HCS500
2
3
4
8
7
6
5
V
SS
RFIN
S_CLK
S_DAT
Other
•
•
•
•
•
Stand-alone decoder chipset
External EEPROM for transmitter storage
Synchronous serial interface
1 Kbit user EEPROM
8-pin DIP/SOIC package
Typical Applications
•
•
•
•
•
•
•
Automotive remote entry systems
Automotive alarm systems
Automotive immobilizers
Gate and garage openers
Electronic door locks
Identity tokens
Burglar alarm systems
BLOCK DIAGRAM
RFIN
Reception Register
DECRYPTOR
CONTROL
EE_CLK
S_DAT
S_CLK
EE_DAT
External
EEPROM
OSCILLATOR
MCLR
Compatible Encoders
All K
EE
L
OQ
encoders and transponders configured for
the following setting:
•
•
•
•
•
•
•
PWM modulation format (1/3-2/3)
T
E
in the range from 100us to 400us
10 x T
E
Header
28-bit Serial Number
16-bit Synchronization counter
Discrimination bits equal to Serial Number 8 LSbs
66- to 69-bit length code word.
The manufacturer’s code, crypt keys, and synchroniza-
tion information are stored in encrypted form in external
EEPROM. The HCS500 uses the S_DAT and S_CLK
inputs to communicate with a host controller device.
The HCS500 operates over a wide voltage range of
3.0 volts to 5.5 volts. The decoder employs automatic
bit-rate detection, which allows it to compensate for
wide variations in transmitter data rate. The decoder
contains sophisticated error checking algorithms to
ensure only valid codes are accepted.
©
2011 Microchip Technology Inc.
DS40153D-page 1
HCS500
1.0
SYSTEM OVERVIEW
Key Terms
The following is a list of key terms used throughout this
data sheet. For additional information on K
EE
L
OQ
and
Code Hopping, refer to Technical Brief 3 (TB003).
•
RKE
- Remote Keyless Entry
•
Button Status
- Indicates what button input(s)
activated the transmission. Encompasses the 4
button status bits S3, S2, S1 and S0 (Figure 7-2).
•
Code Hopping
- A method by which a code,
viewed externally to the system, appears to
change unpredictably each time it is transmitted.
•
Code word
- A block of data that is repeatedly
transmitted upon button activation (Figure 7-1).
•
Transmission
- A data stream consisting of
repeating code words (Figure 7-1).
•
Crypt key
- A unique and secret 64-bit number
used to encrypt and decrypt data. In a symmetri-
cal block cipher such as the K
EE
L
OQ
algorithm,
the encryption and decryption keys are equal and
will therefore be referred to generally as the crypt
key.
•
Encoder
- A device that generates and encodes
data.
•
Encryption Algorithm
- A recipe whereby data is
scrambled using a crypt key. The data can only be
interpreted by the respective decryption algorithm
using the same crypt key.
•
Decoder
- A device that decodes data received
from an encoder.
•
Decryption algorithm
- A recipe whereby data
scrambled by an encryption algorithm can be
unscrambled using the same crypt key.
•
Learn
– Learning involves the receiver calculating
the transmitter’s appropriate crypt key, decrypting
the received hopping code and storing the serial
number, synchronization counter value and crypt
key in EEPROM. The K
EE
L
OQ
product family facil-
itates several learning strategies to be imple-
mented on the decoder. The following are
examples of what can be done.
-
Simple Learning
The receiver uses a fixed crypt key, common
to all components of all systems by the same
manufacturer, to decrypt the received code
word’s encrypted portion.
-
Normal Learning
The receiver uses information transmitted
during normal operation to derive the crypt
key and decrypt the received code word’s
encrypted portion.
-
Secure Learn
The transmitter is activated through a special
button combination to transmit a stored 60-bit
seed value used to generate the transmitter’s
crypt key. The receiver uses this seed value
to derive the same crypt key and decrypt the
received code word’s encrypted portion.
•
Manufacturer’s code
– A unique and secret 64-
bit number used to generate unique encoder crypt
keys. Each encoder is programmed with a crypt
key that is a function of the manufacturer’s code.
Each decoder is programmed with the manufac-
turer code itself.
1.1
HCS Encoder Overview
The HCS encoders have a small EEPROM array which
must be loaded with several parameters before use.
The most important of these values are:
• A crypt key that is generated at the time of pro-
duction
• A 16-bit synchronization counter value
• A 28-bit serial number which is meant to be
unique for every encoder
The manufacturer programs the serial number for each
encoder at the time of production, while the ‘Key Gen-
eration Algorithm’ generates the crypt key (Figure 1-1).
Inputs to the key generation algorithm typically consist
of the encoder’s serial number and a 64-bit manufac-
turer’s code, which the manufacturer creates.
Note:
The manufacturer code is a pivotal part of
the system’s overall security. Conse-
quently, all possible precautions must be
taken and maintained for this code.
DS40153D-page 2
©
2011 Microchip Technology Inc.
HCS500
FIGURE 1-1:
Production
Programmer
CREATION AND STORAGE OF CRYPT KEY DURING PRODUCTION
HCS500
EEPROM Array
Serial Number
Crypt Key
Sync Counter
Transmitter
Serial Number
Manufacturer’s
Code
Key
Generation
Algorithm
Crypt
Key
.
.
.
The 16-bit synchronization counter is the basis behind
the transmitted code word changing for each transmis-
sion; it increments each time a button is pressed. Due
to the code hopping algorithm’s complexity, each incre-
ment of the synchronization value results in greater
than 50% of the bits changing in the transmitted code
word.
Figure 1-2 shows how the key values in EEPROM are
used in the encoder. Once the encoder detects a button
press, it reads the button inputs and updates the syn-
chronization counter. The synchronization counter and
crypt key are input to the encryption algorithm and the
output is 32 bits of encrypted information. This data will
change with every button press, its value appearing
externally to ‘randomly hop around’, hence it is referred
to as the hopping portion of the code word. The 32-bit
hopping code is combined with the button information
and serial number to form the code word transmitted to
the receiver. The code word format is explained in
greater detail in Section 7.2.
A receiver may use any type of controller as a decoder,
but it is typically a microcontroller with compatible firm-
ware that allows the decoder to operate in conjunction
with an HCS500 based transmitter. Section 3.0
provides detail on integrating the HCS500 into a sys-
tem.
A transmitter must first be ‘learned’ by the receiver
before its use is allowed in the system. Learning
includes calculating the transmitter’s appropriate crypt
key, decrypting the received hopping code and storing
the serial number, synchronization counter value and
crypt key in EEPROM.
In normal operation, each received message of valid
format is evaluated. The serial number is used to deter-
mine if it is from a learned transmitter. If from a learned
transmitter, the message is decrypted and the synchro-
nization counter is verified. Finally, the button status is
checked to see what operation is requested. Figure 1-3
shows the relationship between some of the values
stored by the receiver and the values received from
the transmitter.
FIGURE 1-2:
EEPROM Array
Crypt Key
Sync Counter
Serial Number
BUILDING THE TRANSMITTED CODE WORD (ENCODER)
K
EE
L
OQ
®
Encryption
Algorithm
Button Press
Information
Serial Number
32 Bits
Encrypted Data
Transmitted Information
©
2011 Microchip Technology Inc.
DS40153D-page 3
HCS500
FIGURE 1-3:
BASIC OPERATION OF RECEIVER (DECODER)
1 Received Information
EEPROM Array
Button Press
Information
Serial Number
32 Bits of
Encrypted Data
Manufacturer Code
2
Check for
Match
Serial Number
Sync Counter
Crypt Key
3
K
EE
L
OQ
®
Decryption
Algorithm
Decrypted
Synchronization
Counter
Perform Function
5 Indicated by
button press
4
Check for
Match
Note:
Circled numbers indicate the order of execution.
2.0
PIN
1
2
3
4
5
6
7
8
PIN ASSIGNMENT
Decoder
Function
V
DD
EE_CLK
EE_DAT
MCLR
S_DAT
S_CLK
RFIN
GND
I/O
(1)
P
O
I/O
I
I/O
I
I
P
Buffer
Type
(1)
—
TTL
TTL
ST
TTL
TTL
TTL
—
Power Connection
Clock to I
2
C
™
EEPROM
Data to I
2
C EEPROM
Master clear input
Synchronous data from controller
Synchronous clock from controller
RF input from receiver
Ground connection
Description
Note:
P = power, I = in, O = out, and ST = Schmitt Trigger input.
DS40153D-page 4
©
2011 Microchip Technology Inc.
HCS500
3.0
3.1
DECODER OPERATION
Learning a Transmitter to a
Receiver (Normal or Secure Learn)
Before the transmitter and receiver can work together,
the receiver must first ‘learn’ and store the following
information from the transmitter in EEPROM:
• A check value of the serial number
• The crypt key
• The current synchronization counter value
The decoder must also store the manufacturer’s code
(Section 1.1) in protected memory. This code will
typically be the same for all of the decoders in a sys-
tem.
The HCS500 has seven memory slots, and, conse-
quently, can store up to seven transmitters. During the
learn procedure, the decoder searches for an empty
memory slot for storing the transmitter’s information.
When all of the memory slots are full, the decoder will
overwrite the last transmitter’s information. To erase all
of the memory slots at once, use the ERASE_ALL com-
mand (C3H).
3:
Learning a transmitter with a crypt key that
is identical to a transmitter already in mem-
ory replaces the existing transmitter. In
practice, this means that all transmitters
should have unique crypt keys. Learning a
previously learned transmitter does not use
any additional memory slots.
The following checks are performed by the decoder to
determine if the transmission is valid during learn:
• The first code word is checked for bit integrity.
• The second code word is checked for bit integrity.
• The crypt key is generated according to the
selected algorithm.
• The hopping code is decrypted.
• The discrimination value is checked.
• If all the checks pass, the key, serial number
check value, and synchronization counter values
are stored in EEPROM memory.
Figure 3-1 shows a flow chart of the learn sequence.
FIGURE 3-1:
LEARN SEQUENCE
3.2
LEARNING PROCEDURE
Enter Learn
Mode
Wait for Reception
of a Valid Code
Wait for Reception
of Second
Non-Repeated
Valid Code
Generate Key
from Serial Number/
Seed Value
Use Generated Key
to Decrypt
Compare Discrimination
Value with Serial Number
Learning is initiated by sending the ACTIVATE_LEARN
(D2H) command to the decoder. The decoder acknowl-
edges reception of the command by pulling the data
line high.
For the HCS500 decoder to learn a new transmitter, the
following sequence is required:
1.
2.
Activate the transmitter once.
Activate the transmitter a second time. (In
Secure Learning mode, the seed transmission
must be transmitted during the second stage of
learn by activating the appropriate buttons on
the transmitter.)
The HCS500 will transmit a learn-status string,
indicating that the learn was successful.
The decoder has now learned the transmitter.
Repeat steps 1-3 to learn up to seven
transmitters
Note 1:
Learning will be terminated if two
nonsequential codes were received or if
two acceptable codes were not decoded
within 30 seconds.
2:
If more than seven transmitters are
learned, the new transmitter will replace
the last transmitter learned. It is, therefore,
not possible to erase lost transmitters by
repeatedly learning new transmitters. To
remove lost or stolen transmitters,
ERASE_ALL transmitters and relearn all
available transmitters.
3.
4.
Equal?
No
Yes
Learn successful. Store:
Serial number check value
crypt key
Sync. counter value
Exit
Learn
Unsuccessful
©
2011 Microchip Technology Inc.
DS40153D-page 5