Professional Documents
Culture Documents
PIC16C56 Secure
Learn Decoder
MCLR 4 15 OSC IN
GND 5 14 Vcc
S0 6 13 BUT LRNT
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 AN652 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
PIC16C56
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
PIC16C56 Secure
Learn Decoder
hopping portion of the transmission, any number of MCLR 4 15 OSC IN
serial number bits can be received and processed. In
GND 5 14 VDD
the Microchip decoder described, the complete serial
number (28 bits) is stored. S0 6 13 BUT LRNT
The serial number is used to identify the memory block S1 7 12 EE CS
used to store the 64-bit decryption key for a particular
encoder because of the relationship between serial S2 8 11 EE CK
number, seed, and the decryption key. In other words, S3 9 10 EE DIO
the serial number is stored with the key. When a trans-
mission is received, the decoder finds the correct mem-
ory block by checking all blocks until a matching serial
NO
Check for
Encoder TX
RECEIVE
Received
Transmission? Transmission
M_LOOP2 Validation
YES
NO
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 AN652 has
been removed. The full application note is available under a license agreement and
can be ordered as DS40149 from Microchip Technology Inc.
PIN PIC16C56 Function Decoder Function PIN PIC16C56 Function Decoder Function
1 Port A Bit 2 LEARN Input 18 Port A Bit 1 RF Input
2 Port A Bit 3 LRN 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 BUT LRNT
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 11: 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
DS00662B-page 13
AN662
VCC
FIGURE 10:
12V U2 12V
J1 D5 LM7805 J2
AN662
DS00662B-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
HCS200/300/301 TRANSMITTER DESIGN
2 SAW 1206
42527 R3
R02101 220R C4 C2
R02101 12 pF 100 pF
1234 0805 0805
3
J1 NP0
PROGRAMMING PADS
DS00662B-page 15
AN662
FIGURE 12:
AN662
DS00662B-page 16
VCC
RF CIRCUITRY (433MHz)
S1 D1
1 2 LED
U2
1 S0 VCC 8
2 S1 LED 7 LED R2
3 6 PWM Q1 L1
BT1 C1 S2 PWM BFR92A C3 20mm PCB TRACK
4 S3 GND 5
6V 100 nF 47k SOT23 2.2pF
HCS360/361 1206 0805 VCC
NP0
R1
PGM CLK PGM DATA 1
VCC U1 47R
2 SAW 1206
42527 R3
R02101 220R C4 C2
R02101 12pF 100 pF
1234 0805 0805
3
J1 NP0
PROGRAMMING PADS
HCS360/361 SINGLE BUTTON TRANSMITTER DESIGN
• 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