Professional Documents
Culture Documents
HCS512 Ip
HCS512 Ip
MCLR 4 15 OSCOUT
Other
HCS512
GND 5 14 VDD
• Stand-alone decoder
• On-chip EEPROM for transmitter storage S0 6 13 DATA
• Four binary function outputs–15 functions
S1 7 12 CLK
• 18-pin DIP/SOIC package
S2 8 11 SLEEP
Typical Applications
S3 9 10 VLOW
• Automotive remote entry systems
• Automotive alarm systems
• Automotive immobilizers BLOCK DIAGRAM
• Gate and garage openers RFIN Reception Register
• Electronic door locks
• Identity tokens DECRYPTOR
• Burglar alarm systems DATA
EEPROM CONTROL
CLK
Compatible Encoders
LRNIN
All KEELOQ encoders and transponders configured for OSCIN OSCILLATOR MCLR
the following setting: SLEEP
Production HCS512
Programmer Transmitter
Serial Number EEPROM Array
Serial Number
Crypt Key
Sync Counter
Key .
Manufacturer’s Generation Crypt .
Code Algorithm Key .
The 16-bit synchronization counter is the basis behind A receiver may use any type of controller as a decoder,
the transmitted code word changing for each transmis- but it is typically a microcontroller with compatible firm-
sion; it increments each time a button is pressed. Due ware that allows the decoder to operate in conjunction
to the code hopping algorithm’s complexity, each incre- with an HCS512 based transmitter. Section 5.0
ment of the synchronization value results in greater provides detail on integrating the HCS512 into a sys-
than 50% of the bits changing in the transmitted code tem.
word. A transmitter must first be ‘learned’ by the receiver
Figure 1-2 shows how the key values in EEPROM are before its use is allowed in the system. Learning
used in the encoder. Once the encoder detects a button includes calculating the transmitter’s appropriate crypt
press, it reads the button inputs and updates the syn- key, decrypting the received hopping code and storing
chronization counter. The synchronization counter and the serial number, synchronization counter value and
crypt key are input to the encryption algorithm and the crypt key in EEPROM.
output is 32 bits of encrypted information. This data will In normal operation, each received message of valid
change with every button press, its value appearing format is evaluated. The serial number is used to deter-
externally to ‘randomly hop around’, hence it is referred mine if it is from a learned transmitter. If from a learned
to as the hopping portion of the code word. The 32-bit transmitter, the message is decrypted and the synchro-
hopping code is combined with the button information nization counter is verified. Finally, the button status is
and serial number to form the code word transmitted to checked to see what operation is requested. Figure 1-3
the receiver. The code word format is explained in shows the relationship between some of the values
greater detail in Section 8.2. stored by the receiver and the values received from
the transmitter.
EEPROM Array
KEELOQ
Crypt Key Encryption
Algorithm
Sync Counter
Serial Number
Transmitted Information
1 Received Information
EEPROM Array
Button Press Serial Number 32 Bits of Manufacturer Code
Information Encrypted Data
3
KEELOQ
Decryption
Algorithm
LOGIC “1”
LOGIC “0”
1200 µs
600 µs
CLK
DATA
START S3 S2 S1 S0 VLOW RPT Reserved Reserved STOP
1200 µs
Note: The Decoder output PWM format logic (“1” / “0”) is reversed with respect of the Encoder modulation format.
Yes
Save Counter
in Temp Location
4.5 SLEEP Mode The device will not enter SLEEP mode when:
• A function output is active
The SLEEP mode of the HCS512 is used to reduce • Learn sequence active
current consumption when no RF input signal is • Device is in Programming mode
present. SLEEP mode will only be effective in systems
where the RF receiver is relatively quiet when no signal The device will wake-up from SLEEP when:
is present. During SLEEP, the clock stops, thereby sig- • The SLEEP input pin changes state
nificantly reducing the operating current. SLEEP mode • The CLOCK line changes state
is enabled by the SLEEP bit in the configuration byte.
Note: During SLEEP mode the CLK line will
The HCS512 will enter SLEEP mode when: change from an output line to an input line
• The RF line is low that can be used to wake-up the device.
• After a function output is switched off Connect CLK to LRNIN via a 100K resistor
• Learn mode is terminated (time-out reached) to reliably enter the Learn mode whenever
SLEEP mode is active.
MCLR
TCKL
TPS TPH1 TPH2 TCKH TACK TACKH
CLK
(Clock)
DAT
(Data) Bit0 Bit1 Bit78 Bit79 Ack
Acknowledge
Enter Program Mode 80-bit Data Package pulse
FIGURE 7-1:
Serial
Patched
Number
Key Generation
Algorithms
Manufacturer’s Encoder
-------------------
Key Key
Decrypt
XOR
Seed
LRN0 = 0
Normal Learn (SC_LRN = 0)
Padding 28-bit Serial Number
2 KEELOQ LS 32 bits of crypt key
Decryption
Algorithm
Padding
6 28-bit Serial Number MS 32 bits of crypt key
The KEELOQ encoder transmission is made up of sev- 8.2 Code Word Organization
eral parts (Figure 8-1). Each transmission begins with
a preamble and a header, followed by the encrypted The HCSXXX encoder transmits a 66/69-bit code word
and then the fixed data. The actual data is 66/69 bits when a button is pressed. The 66/69-bit word is con-
which consists of 32 bits of encrypted data and 34/37 structed from an encryption portion and a non-
bits of non-encrypted data. Each transmission is fol- encrypted code portion (Figure 8-2).
lowed by a guard period before another transmission The Encrypted Data is generated from four button bits,
can begin. The encrypted portion provides up to four two overflow counter bits, ten discrimination bits, and
billion changing code combinations and includes the the 16-bit synchronization value.
button status bits (based on which buttons were acti-
The Non-encrypted Data is made up from 2 status
vated) along with the synchronization counter value
bits, 4 function bits, and the 28/32-bit serial number.
and some discrimination bits. The non-encrypted por-
tion is comprised of the status bits, the function bits,
LOGIC "0"
LOGIC "1"
TBP
Repeat VLOW Button Serial Number Button OVR DISC Sync Counter
(1-bit) (1-bit) Status (28 bits) Status (2 bits) (10 bits) (16 bits)
S2 S1 S0 S3 S2 S1 S0 S3
MSb LSb
66 Data bits
Transmitted
LSb first.
FIGURE 9-1: RESET WATCHDOG TIMER, OSCILLATOR START-UP TIMER AND POWER-UP
TIMER TIMING
VDD
MCLR
TMCLR
TOV
I/O Pins
FIGURE 9-2:
1 Code Word 50 ms
OUTPUT ACTIVATION
RFIN
TOD Note 1
S[3,2,1,0]
TA
Note 2
VLOW
TA
LRNOUT
0s 1s 2s 3s 4s 5s
HCS512
DS40151D-page 17
FIGURE 9-3:
HCS512
VDD
LM7805
12V 1 VO
MCP100-450 VI G
VDD 2 N
1N4004/7
10K VDD
1 RECEIVE DATA INPUT
1K
LRNOUT
1K
S0
14 1K S1
4.7K P2
4 MCLR V NC 17 1K
D RFIN 18 S2
3 NC D LRNIN 1 1K
LRNOUT 2 S3
16 OSCIN
S0 6
15 S1 7 1K VLOW
OSCOUT
S2 8
S3 9
VLOW 10
G SLEEP 11
N CLK 12
22 pF 13
D DAT
P3 DATA P4
5 VDD P4
HCS512 CLOCK P3
2002 Microchip Technology Inc.
RESET P2
10K 100K
GND P1
LEARN In-Circuit
BUTTON Programming Pads
HCS512
10.0 PACKAGING INFORMATION
10.1 Package Marking Information
18-Lead PDIP (300 mil) Example
XXXXXXXXXXXXXXXXX HCS512
XXXXXXXXXXXXXXXXX
YYWWNNN 0110017
XXXXXXXXXXXX HCS512
XXXXXXXXXXXX /SO
XXXXXXXXXXXX
YYWWNNN 0110017
Note: In the event the full Microchip part number cannot be marked on one line, it will
be carried over to the next line thus limiting the number of available characters
for customer specific information.
* Standard PICmicro device marking consists of Microchip part number, year code, week code, and
traceability code. For PICmicro device marking beyond this, certain price adders apply. Please check
with your Microchip Sales Office. For QTP devices, any special marking adders are included in QTP
price.
E1
n 1 α
E A2
c L
A1
B1
β
B p
eB
E
p
E1
2
B n 1
h
α
45 °
c
A A2
φ
β L A1
From: Name
Company
Address
City / State / ZIP / Country
Telephone: (_______) _________ - _________ FAX: (______) _________ - _________
Application (optional):
Would you like a reply? Y N
Questions:
2. How does this document meet your hardware and software development needs?
3. Do you find the organization of this data sheet easy to follow? If not, why?
4. What additions to the data sheet do you think would enhance the structure and subject?
5. What deletions from the data sheet could be made without affecting the overall usefulness?
8. How would you improve our software, systems, and silicon products?
HCS512 — /P
Package: P = Plastic DIP (300 mil Body), 18-lead
SO = Plastic SOIC (300 mil Body), 18-lead
Please specify which device, revision of silicon and Data Sheet (include Literature #) you are using.
01/18/02