DS00659c C Simple Code Hopping Decoder
DS00659c C Simple Code Hopping Decoder
PIC16C54 Secure
decoder or integrated with full function security sys-
Simple Decoder
tems. The decoder supports the Microchip HCS200, MCLR 4 15 OSC IN
S1 7 12 EE CK
S2 8 11 EE CK
S3 9 10 EE DIO
RF S0
Receiver RFIN S1
S2
S3
PIC16C54
Learn
CS Indication
EEPROM CLK
DIO
Learn
Init
2 te te 2 te 4 te
1 X A B C
1 te 2 te te 5 te
Learn
button Learn Routine
pressed? YES LEARN
NO
Update Timer
TST_RTCC
Handle Timer
TST_TIMER
NO Received
Transmission?
RECEIVE
YES
Transmission
Validation
Calibrate
RECEIVE
1
HIGH
Reset Time-out
Counter
NO
Input? HIGH
RCV1 Time-Out?
2 YES
LOW
Clear Calibration
Counter
RCV2
NO
HIGH 3
YES
Calibration
Counter/10
RCV6
NO
Load Cal
Counter
RCV7
Receive Data
DL1
Receive Data
RCV7
Input LOW
SAMPLE1
HIGH 4
Input HIGH
SAMPLE2
LOW
Data = 0
Data = 1
HIGH 7
Input HIGH
RCV8/RCV9/ Input
RVC10 SAMPLE3
LOW NO LOW 6
NO
Time-out? Last Bit?
YES YES
NO Received
Invalid 56 Bits?
RMT01
YES
Transmission Return To
Main Loop
Validation M_LOOP
Get Serial #
From EEPROM
M_SERIAL
Same As
Serial # NO Checked all? NO Point to Next
Received? M_NEXT Transmitter
YES YES
Decrypt Transmission
M_HOP
Discrim Value NO
equal lower byte of
Serial #?
M_DIS
YES
YES YES
YES
NLF
XOR
1,7
7 6 5 4 3 2 1 0
MSB Key Register LSB
I4 I3 I2 I1 I0 NLF
0 0 0 0 0 0
0 0 0 0 1 1
0 0 0 1 0 1
0 0 0 1 1 1
0 0 1 0 0 0
0 0 1 0 1 1
0 0 1 1 0 0
0 0 1 1 1 0
0 1 0 0 0 0
0 1 0 0 1 0
0 1 0 1 0 1
0 1 0 1 1 0
0 1 1 0 0 1
0 1 1 0 1 1
0 1 1 1 0 1
0 1 1 1 1 0
1 0 0 0 0 0
1 0 0 0 1 0
1 0 0 1 0 1
1 0 0 1 1 1
1 0 1 0 0 1
1 0 1 0 1 0
1 0 1 1 0 1
1 0 1 1 1 0
1 1 0 0 0 0
1 1 0 0 1 1
1 1 0 1 0 0
1 1 0 1 1 1
1 1 1 0 0 1
1 1 1 0 1 1
1 1 1 1 0 0
1 1 1 1 1 0
YES
Clear
Timer Transmitter NO Read Learn
LEARN Already Learnt? indicator
M_SEARCH LEARN_NF
YES
Write Serial
LED On Number
in EEPROM
LEARN_F
YES
Reset
RESET Return to
Main Loop
M_LOOP
PIN PIC16C54 Function Decoder Function PIN PIC16C54 Function Decoder Function
1 Port A Bit 2 LEARN Input Act Low 18 Port A Bit 1 RF Input
2 Port A Bit 3 LRN IND Output High 17 Port A Bit 0 Not used
3 TIMER0 Connect to VDD 16 Osc In RC osc (4 MHz)
4 MCLR Brown out detect 15 Osc Out
5 GND Ground 14 VDD +5V supply
6 Port B Bit 0 S0 13 Port B Bit 7 Not Used
7 Port B Bit 1 S1 12 Port B Bit 6 CS (93LC46B,
pin 1))
8 Port B Bit 2 S2 11 Port B Bit 5 CLK (93LC46B,
pin 2)
9 Port B Bit 3 S3 10 Port B Bit 4 DIO (93LC46B,
pin 3 & 4)
TIMING PARAMETERS
TABLE 16: TIMING PARAMETERS
1 G
2 1N4004/7
3 N
GND C2 D C3
APPENDIX A:
POWER SUPPLY
R4 D1 S0
R1 1 U5 R5 D2 S1
10K 4
SCHEMATIC DIAGRAMS
4 17 R6 D3 S2
MCLR V RA0 18
3 C RA1 1 R7 D4 S3
RTCC C RA2
RA3 2
16
Confidential
OSC1
RB0 6
15 7
CLKOUT RB1 8
RB2 9
RB3 10
RB4 11
C1 G RB5 12
10pF N RB6 13
D RB7
PIC16C54
5 VCC
U1
SCHEMATIC DIAGRAM OF MICROCHIP KEELOQ DECODER
VCC 1 CS VCC 8
2 SK NC 7
R2 3 6
DI NC
4 DO GND 5
1K 93LC46B
47K
2 SERIAL EEPROM
S1
LEARN INIT
1
DS00659C_C-page 23
AN659
VCC
FIGURE 14:
12V U2 12V
J1 D5 LM7805 J2
AN659
DS00659C_C-page 24
C2 N C3 D8 CON1
GND 3 1N4004/7 100uF D 100uF
CON3
1N4004/7
RELAY SPST
Power Supply
S0 Q1
NPN
Door Motor
VCC
U4
LOW VOLTAGE DETECTOR Vcc
ANTENNA
VI G VO J3
N 1
D R3 2
100R 3
Vcc 4 L1
5 GARAGE LIGHT
6
7
8
9
R1 1 U5 10
10K 4 11
4 17 12
MCLR V RA0 13
Confidential
RA1 18 RF INPUT 14 12V V1
3 RTCC CC RA2 1 15 110V AC
RA3 2
16 OSC1
6 S0 RF RECEIVER MODULE K1
15 CLKOUT RB0 7 S1 D9
TYPICAL GARAGE DOOR OPENER SCHEMATIC
RB1 8
RB2 9
RB3 10 1N4004/7
C1 G RB4
RB5 11 RELAY SPST
10pF VCC R6
N RB6 12 U1 R7
D RB7 13 1 CS VCC 8 D6 100R 1M Q2
PIC16C54 2 SK NC 7 S1 NPN
5 3 DI NC 6
4 DO GND 5 1N4004/7
VCC
1K 93LC46B C5
R4 R2 10µF
47K
1K SERIAL EEPROM Garage light
D10
LEARN 2
S1
LEARN INIT
1
RF CIRCUITRY (433MHz)
S1 D1
1 2 LED
S2 U2
1 2 S0 1 S0 VCC 8
S1 2 S1 LED 7 LED R2
S2 3 S2 PWM 6 PWM Q1 L1
BT1 C1 S3 4 S3 GND 5 BFR92A C3 20mm PCB TRACK
6V 100nF 47k SOT23 2.2pF
HCS300 1206 0805 VCC
NP0
R1
PGM CLK PGM DATA 1
VCC U1 47R
2 SAW 1206
Confidential
42527 R3
R02101 220R C4 C2
12pF 100 pF
1234 0805 0805
3
J1 NP0
HCS200/300/301/360/361 TRANSMITTER DESIGN
PROGRAMMING PADS
DS00659C_C-page 25
AN659
AN659
NOTES:
All rights reserved. © 1998 Microchip Technology Incorporated. Printed in the USA. 10/98 Printed on recycled paper.
Information contained in this publication regarding device applications and the like is intended for suggestion only and may be superseded by updates. No representation or warranty is given and no
liability is assumed by Microchip Technology Incorporated with respect to the accuracy or use of such information, or infringement of patents or other intellectual property rights arising from such use
or otherwise. Use of Microchip’s products as critical components in life support systems is not authorized except with express written approval by Microchip. No licenses are conveyed, implicitly or
otherwise, under any intellectual property rights. The Microchip logo and name are registered trademarks of Microchip Technology Inc. in the U.S.A. and other countries. All rights reserved. All other
trademarks mentioned herein are the property of their respective companies.