Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Simple Decoder
tems. The decoder supports the Microchip HCS200, MCLR 4 15 OSC IN
PIC16C54
HCS300, HCS301, HCS360, HCS361 and HCS410 GND 5 14 Vcc
KEELOQ Code Hopping Encoders.
S0 6 13 NC
S1 7 12 EE CS
S2 8 11 EE CK
S3 9 10 EE DIO
Notice:
This is a non-restricted version of Application Note AN659 which is available under the KEELOQ
License Agreement. The license agreement can be ordered from the Microchip Literature Center as
DS40149.
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
The confidential and proprietary information contained in this section of AN659 has
been removed. The full application note is available under a license agreement and
can be ordered as DS40149 from Microchip Technology Inc.
PIN PIC16C54 Function Decoder Function PIN PIC16C54 Function Decoder Function
1 Port A Bit 2 LEARN Input 18 Port A Bit 1 RF Input
2 Port A Bit 3 LEARN Indicator 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 10: TIMING PARAMETERS
12V 1 VI VO
2 G
1N4004/7 N
3 C2 C3
GND D
APPENDIX A:
POWER SUPPLY
R4 D1 S0
R1 1 U5 R5 D3 S1
10K 4
SCHEMATIC DIAGRAMS
4 17 R6 D4 S2
MCLR V RA0 18
3 C RA1 1 R7 D2 S3
RTCC C RA2
RA3 2
16 R9 D7 BUT LRNT
OSC1
RB0 6
15 7
CLKOUT RB1 8
RB2 9
RB3 10
RB4 11
C1 G RB5 12
10pF N RB6 13
D RB7
PIC16C56
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
DS00663B-page 13
AN663
VCC
FIGURE 9:
12V U2 12V
J1 D5 LM7805 J2
AN663
DS00663B-page 14
1 VI G VO 1
2 K2
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 RF INPUT 13 12V V1
RA1 18 14 110V AC
3 RTCC CC RA2 1 15
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 100 nF 47k SOT23 2.2pF
HCS300 1206 0805 VCC
NP0
R1
PGM CLK PGM DATA 1
VCC U1 47R
2 SAW 1206
42527 R3
R02101 220R C4 C2
12pF 100 pF
1234 0805 0805
3
J1 NP0
HCS200/300/301/360/361 TRANSMITTER DESIGN
PROGRAMMING PADS
DS00663B-page 15
AN663
Note the following details of the code protection feature on PICmicro® MCUs.
• The PICmicro family meets the specifications contained in the Microchip Data Sheet.
• Microchip believes that its family of PICmicro microcontrollers is one of the most secure products of its kind on the market today,
when used in the intended manner and under normal conditions.
• There are dishonest and possibly illegal methods used to breach the code protection feature. All of these methods, to our knowl-
edge, require using the PICmicro microcontroller in a manner outside the operating specifications contained in the data sheet.
The person doing so may be engaged in theft of intellectual property.
• Microchip is willing to work with the customer who is concerned about the integrity of their code.
• Neither Microchip nor any other semiconductor manufacturer can guarantee the security of their code. Code protection does not
mean that we are guaranteeing the product as “unbreakable”.
• Code protection is constantly evolving. We at Microchip are committed to continuously improving the code protection features of
our product.
If you have any further questions about this matter, please contact the local sales office nearest to you.
01/18/02