HCS515
K
EE
L
OQ
®
Code Hopping Decoder
FEATURES
Security
• Encrypted storage of manufacturer’s code
• Encrypted storage of encoder decryption keys
• Up to seven transmitters can be learned code
hopping technology
• Normal and secure learning mechanisms
DESCRIPTION
The Microchip Technology Inc. HCS515 is a code hop-
ping decoder designed for secure Remote Keyless
Entry (RKE) systems. The HCS515 utilizes the pat-
ented code hopping system and high security learning
mechanisms to make this a canned solution when used
with the HCS encoders to implement a unidirectional
remote and access control systems. The HCS515 can
be used as a stand-alone decoder or in conjunction
with a microcontroller.
Operating
• 4.5V – 5.5V operation
• Internal oscillator
• Auto bit rate detection
PACKAGE TYPE
PDIP, SOIC
NC
1
2
3
4
5
6
7
14
13
12
11
10
9
8
NC
NC
Vss
RF_IN
S_CLK
S_DAT
NC
Other
NC
•
•
•
•
•
Stand-alone decoder
Internal EEPROM for transmitter storage
Synchronous serial interface
1 Kbit user EEPROM
14-pin DIP/SOIC package
V
DD
S1
S0
MCLR
HCS515
Typical Applications
NC
•
•
•
•
•
•
•
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
EE_DAT
Internal
EEPROM
CONTROL
EE_CLK
S_DAT
S_CLK
S0
S1
MCLR
Compatible Encoders
All encoders and transponders configured for the fol-
lowing setting:
•
•
•
•
•
•
•
PWM modulation format (1/3-2/3)
T
E
in the range from 100
µs
to 400
µs
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.
OSCILLATOR
The manufacturer’s code, encoder decryption keys,
and synchronization information are stored in
encrypted form in internal EEPROM. The HCS515
uses the
S_DAT
and
S_CLK
inputs to communicate
with a host controller device.
The HCS515 operates over a wide voltage range of
4.5V – 5.5V. The decoder employs automatic bit rate
detection, which allows it to compensate for wide vari-
©
2002 Microchip Technology Inc.
DS40183D-page 1
HCS515
ations in transmitter data rate. The decoder contains
sophisticated error checking algorithms to ensure only
valid codes are accepted.
-
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.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.
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.
DS40183D-page 2
©
2002 Microchip Technology Inc.
HCS515
FIGURE 1-1:
Production
Programmer
CREATION AND STORAGE OF CRYPT KEY DURING PRODUCTION
HCS515
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 HCS515 based transmitter. Section 3.0
provides detail on integrating the HCS515 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
©
2002 Microchip Technology Inc.
DS40183D-page 3
HCS515
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
9
10
11
12
13
14
Note:
PIN ASSIGNMENT
Decoder
Function
NC
NC
V
DD
S1
S0
MCLR
NC
NC
S_DAT
S_CLK
RF_IN
GND
NC
NC
I/O
(1)
—
—
—
O
O
I
—
—
I/O
I
I
—
—
—
Buffer
Type
(1)
—
—
—
TTL
TTL
ST
—
—
TTL
TTL
TTL
—
—
—
No connection
No connection
Power connection
S1 function output
S0 function output
Master clear input
No connection
No connection
Synchronous data from controller
Synchronous clock from controller
Input from RF receiver
Ground connection
No connection
No connection
Description
P = power, I = in, O = out, and ST = Schmitt Trigger input.
DS40183D-page 4
©
2002 Microchip Technology Inc.
HCS515
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 encoder decryption 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 HCS515 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
command (C3H).
3:
Learning a transmitter with an encoder
decryption key that is identical to a
transmitter already in memory
replaces the existing transmitter. In
practice, this means that all transmit-
ters should have unique encoder
decryption 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 encoder decryption key is generated accord-
ing 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.1.1
Learning
LEARNING PROCEDURE
is
initiated
by
sending
the
ACTIVATE_LEARN
(D2H) command to the decoder.
The decoder acknowledges reception of the command
by pulling the data line high.
For the HCS515 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 HCS515 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.
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
3.
4.
5.
Equal?
No
Yes
Learn Successful Store:
Serial Number Check Value
Encoder Decryption Key
Sync. Counter Value
Exit
Learn
Unsuccessful
©
2002 Microchip Technology Inc.
DS40183D-page 5