REKLAMA

AN661.pdf

Jak zaimplementować Keeloq na PIC16C54XT bez doświadczenia w PIC?

Witam. Może algorytm opisany w poniższym pdf, będzie pomocny.


Pobierz plik - link do postu

AN661
Code Hopping Decoder Using a PIC16C56
Author:

Steven Dawson
Microchip Technology Inc.

OVERVIEW
This application note fully describes the working of a
code hopping decoder implemented on a Microchip
PIC16C56 microcontroller. Background is given on the
various KEELOQ® code hopping encoders that can be
used with the decoder, the decoder hardware described,
and descriptions of the various software modules comprising the system. The software can be used to implement a stand-alone decoder or integrated with full
function security systems. The decoder supports the
Microchip HCS200, HCS201, HCS300, HCS301,
HCS360, HCS361 and HCS410 KEELOQ Code Hopping
Encoders.

KEY FEATURES
• Stand-alone decoder
• Compatible with Microchip HCS200, HCS201,
HCS300, HCS301, HCS360, HCS361 and
HCS410 encoders
• Automatic baud rate detection
• Automatic encoder type detection
• Four function outputs
• Six learnable transmitters
• RC Oscillator

Notice:
This is a non-restricted version of Application Note AN642 which is available under the KEELOQ
License Agreement. The license agreement can be ordered from the Microchip Literature Center as
DS40149.

KEELOQ is a registered trademark of Microchip Technology, Inc.
Microchip’s Secure Data Products are covered by some or all of the following patents:
Code hopping encoder patents issued in Europe, U.S.A., and R.S.A. — U.S.A.: 5,517,187; Europe: 0459781; R.S.A.: ZA93/4726
Secure learning patents issued in the U.S.A. and R.S.A. — U.S.A.: 5,686,904; R.S.A.: 95/5429

© 1998 Microchip Technology Inc.

DS00661B-page 1

AN661
INTRODUCTION TO KEELOQ
ENCODERS

Synch
ronization Counte
rs

All KEELOQ encoders use the KEELOQ code hopping technology to make each transmission by an encoder unique.
The encoder transmissions have two parts. The first part
changes each time the encoder is activated and is called
the hopping code part. The second part is the serial number of the encoder, identifying it to a decoder.

The transmitted word contains a 16-bit synchronization
counter. The synchronization information is used at the
decoder to determine whether a transmission is valid, or a
repetition of a previous transmission. Previous codes are
rejected to safeguard against code grabbers. The
HCS300/301 encoder transmits two overflow bits which
may be used to extend the range of the synchronization
counter from 65,536 to 196,608 button operations.

Hopping Code

Fixed Code

The Hopping Code contains function information, a
discrimination value, and a synchronization counter. This
information is encrypted by an encryption algorithm before
being transmitted. A 64-bit encryption key is used by the
encryption algorithm. If one bit in the data that is encrypted
changes, the result is that an average of half the bits in the
output will change. As a result, the hopping code changes
dramatically for each transmission and can not be predicted.

Serial Number

Function In
formation
The encoder transmits up to four bits of function
information. Up to 15 different functions are available
(0000 is related to the reset condition in all the current
encoders, and can never be transmitted).

Discrimination
Value
Stored in the encoder EEPROM, this information is used to
check integrity of decryption operation in the decoder. If
known information is inserted into the transmitted string
before encryption, the same information can be used at the
decoder to check whether the information has been
decrypted correctly. In the Microchip HCS encoders, up
to 12 bits (including overflow bits) are available.

FIGURE 1:

The encoder’s serial number is transmitted every time the
button is pressed. The serial number is transmitted unencrypted as part of the transmission, and serves to identify
the encoder to the decoder. The number can be used during learning operations to calculate the key to be used for
decrypting the transmissions.

Other Status and Function formation
In
The HCS300/301 encoders include provision for four bits
of function information and two status bits in the fixed code
portion of its transmission. The two status bits indicate
whether a repeated transmission is being sent, and
whether the battery voltage is low. The HCS200/201 does
not send repeated transmission information and the bit is
permanently set to ‘0’.

Transmission Format
Table 1 contains a summary of the information contained in
transmissions from each of the KEELOQ encoders that can
be learned by the Microchip decoder.

BLOCK DIAGRAM

RF
Receiver

S0
S1
S2
S3

RFIN

PIC16C56

EEPROM

DS00661B-page 2

CS
CLK
DIO

Learn
Indication
Learn
Init

© 1998 Microchip Technology Inc.

AN661
TABLE 1:

KEELOQ ENCODER TRANSMISSION SUMMARY
HCS200/201
# of bits

TABLE 2:

HCS360/361
# of bits

HCS410
# of bits

66
32
16
12
0
0
0
4
34
28
4
1
1
0
0

Total Transmission Length
Code Hopping Portion
Sync Counter
Discrimination bits
User Bits
Overflow Bits
Independent Mode
Function Code
Fixed Portion
Serial number
Function Code
Low Voltage Indicator
Repeat Bit
CRC
Queue Bits

HCS300/301
# of bits
66
32
16
10
0
2
0
4
34
28
4
1
1
0
0

67
32
16
8
2
1
1
4
35
28/32
4/0
1
0
2
0

69
32
16
10
0
2
0
4
37
28/32
4/0
1
0
2
2

HCS200/201 AND HCS300/301 CODE HOPPING TRANSMISSION FORMAT
Code Hopping Portion

Sync Counter

TABLE 3:

Fixed Portion

Discrimination

Func

Serial Number

VLOW
REPT

HCS360/361 CODE HOPPINGTRANSMISSION FORMAT

Sync Counter

Fixed Portion

Discrimination
OVR, IND

Func

Serial Number
(28/32 bits)

HCS360/361 SEED TRANSMISSION FORMAT
Seed Portion

Fixed Portion

Seed
(48 bits)

Serial Number
(12/16 MS bits)

Func
(4/0
bits)

VLOW
REPT

Func
(4/0
bits)

VLOW
CRC
QUE

HCS410 CODE HOPPING TRANSMISSION FORMAT
Code Hopping Portion

Sync Counter

TABLE 7:

VLOW
REPT

Func
(4/0
bits)

Serial Number

Code Hopping Portion

TABLE 6:

Func

Fixed Portion

Seed

TABLE 5:

VLOW
REPT

HCS200/201 AND HCS300/301 SEED TRANSMISSION FORMAT
Seed Portion

TABLE 4:

Func

Fixed Portion

Discrimination
OVR

Func

Serial Number
(28/32 bits)

HCS410 SEED TRANSMISSION FORMAT
Seed Portion
Seed
(60 bits)

© 1998 Microchip Technology Inc.

Fixed Portion
Func
(4/0
bits)

VLOW
CRC
QUE

DS00661B-page 3

AN661
PWM Format
In general, all KEELOQ encoders share a common
transmission format.
• A preamble to improve biasing of decision
thresholds in super-regenerative receivers. The preamble consists of alternate on and off periods, each
lasting as long as a single elemental period.
• A calibration header, consisting of a low period of 10
elemental periods. Calibration actions should be
performed on the low period of the header to ensure
correct operation with header chopping.
• A string of 66 pulse width modulated bits, each consisting of three elements. The first element is high,
the second contains the data transmitted and is
either high or low, the third element is always low.
• A guard period is usually left between the
transmissions. During this period nothing is
transmitted by the encoder.

FIGURE 2:

Figure 2 shows the sampling points when sampling data.
The first and last elements are used exclusively to verify
the integrity of the received signal. The first element
(sample point A) is always high, the second (sample point
B) is the complement of the data bit being sent, and the
final element (sample point C) is always low. Because the
period between the low portion of a bit (sample point C)
and the rising edge of the following bit (sample point X)
can vary somewhat, the rising edge of the first element
(sample point X) is used to resynchronize the receiving
routine to each incoming bit.
If random noise is being received, the probability of a set
of three samples producing a valid combination is only 2-2
= 1/4. For a string of 56 bits, the corresponding figure is
2-134. For longer strings, the probability is considerably
less.
Integrity checking on incoming signals is important. Code
hopping signals require significant processing, as well as
EEPROM access, to decrypt. Unnecessary processing
can be avoided by not attempting to decrypt incoming
codes that have bit errors.

KEELOQ PWM TRANSMISSION FORMAT
Bit Format I

Sampling Points

0

2te

te

1

X

te

DS00661B-page 4

A

B

C

2te

© 1998 Microchip Technology Inc.

AN661
The Microchip decoder’s primary hardware componenets
are a PIC16C56 RISC microcontroller and a 93LC46B
EEPROM. However, this solution can be implemented in
any PICmicro® microcontroller with at least 1K words of
programming. The operating frequency of the controller is
4 MHz. The microcontroller is used to capture transmissions from the various encoders, decrypt transmissions
captured, and check the validity of the transmission
based on the information in the decrypted transmission
and information stored in the EEPROM. If a transmission
from a valid encoder is received, the Microchip decoder
activates the outputs dictated by the transmission.
Encoder information, such as serial number, synchronization information, and decryption key are stored externally in an EEPROM. The EEPROM used is a Microchip
93LC46B CMOS serial EEPROM. The information stored
in the EEPROM is encrypted to protect the decoders from
cloning. The EEPROM encryption is less secure than the
KEELOQ code hopping algorithm.
A more secure implementation of the decoder would be
to modify the software in the application note and use a
PIC16CXX with an internal EEPROM such as a
PIC16C84. In this way communication between the
PIC16C56 and EEPROM cannot be monitored.

ber and decryption key. In other words, the serial number
is stored with the key. When a transmission is received,
the decoder finds the correct memory block by checking
all blocks until a matching serial number is found. The key
is then retrieved from that particular memory block. A
serial number of 000000016 is considered invalid.
Validation of a received transmission consists of two
parts. The first includes checking the integrity of the
decryption operation. Here the decoder compares the
12-bit discrimination value received with the stored discrimination value. The discrimination value stored for the
HCS300/301 includes the overflow bits.
The second portion of validation involves checking synchronization information for that particular encoder. The
synchronization counter transmitted by all encoders is 16
bits long. Two copies of the full synchronization counter
are stored for all valid encoders. The storing of two copies
of the synchronization information protects the decoder
from loosing synchronization with an encoder if one of the
counters is corrupted.

FIGURE 3:

As can be seen from the section on encoder transmissions there are differences in the transmission formats of
the different encoders that are compatible with the system. The following section summarizes how the differences in transmitted data are dealt with by the decoder.

PINOUTS OF MICROCHIP
KEELOQ DECODER

LEARN INIT

1

18

RFIN

LEARN IND

2

17

NC

VDD

3

16

OSC OUT

MCLR

4

15

OSC IN

GND

5

14

VDD

S0

6

13

FUNC OK

S1

7

12

EE CS

S2

8

11

EE CK

S3

9

10

EE DIO

As the serial number information follows after the code hopping portion of the transmission, any number of serial number bits can be received and processed. In the Microchip
decoder described 28 bits of the serial number are stored.
The serial number is used to identify the memory block
used to store the 64-bit decryption key for a particular
encoder because of the relationship between serial num-

PIC16C56

IMPLEMENTATION

FUNCTIONAL INPUTS AND OUTPUTS
TABLE 8:

MICROCHIP DECODER FUNCTIONAL INPUTS AND OUTPUTS
Pin
Number

Input /
Output

RF IN

18

I

Demodulated PWM signal from RF receiver. The decoder uses this
input to receive encoder transmissions.

LEARN INIT

1

I

Input to initiate learning.

LEARN INDICATION

2

O

Output to show the status of the learn process (in an integrated
system this will be combined with the system status indicator).

FUNC OK

13

O

Indication that the received button code matches the learned
button code.

6, 7, 8, 9

O

Function outputs, correspond to encoder input pins.

EE DIO

10

I/O

EEPROM Data.

EE CK

11

O

EEPROM Clock.

EE CS

12

I

EEPROM Chip Select.

Mnemonic

S0, S1, S2, S3

© 1998 Microchip Technology Inc.

Function

DS00661B-page 5

AN661
PROGRAM FLOW
The software for the Microchip decoder has been written for the PIC16C56 microcontroller. The compiler
used is MPASM. The operating frequency of the
PIC16C56 is 4 MHz. The clock speed is important as
the reception routine (RECEIVE) has some critical timing specifications. Other decoder functions that rely on
a 4 MHz clock speed are the hold times of the various
outputs, time-outs, etc.
The main program flow is described here. More
detailed descriptions of the modules can be found further in the application note. On power-up the decoder
reads the learn indicator from the external EEPROM.
The status flags are checked to see if a learn routine
was interrupted when the microcontroller was reset. If

FIGURE 4:

so, it is assumed the learn cycle was not successfully
completed and the encoder at the learn indicator subsequently deleted (WIPE_TX).
The encoder then enters the main loop where it spends
most of its time. The main loop checks to see if the
learn button is being activated (TST_LEARN). If so, the
decoder enters the learn mode.
If learn has not been initiated, the microcontroller then
checks for transmissions from encoders (RECEIVE). If
64 bits (HCS encoders) are received, the microcontroller validates the transmission received. If the transmission received is a valid transmission from an encoder
learned into the system, the system sets the appropriate outputs (M_BUT).

MICROCHIP DECODER MAIN PROGRAM FLOW
Reset

Get Learn
Pointer
MAIN

Reset Due To
Failed Learn?

Yes

Delete TX
At Learn
Position
WIPE_TX

No

Loop Back
Point
MAIN2

Learn
Pressed?
M_LOOP2- & gt;
TST_LEARN

Learn Routine
Yes

No
Check For
Encoder TX
RECEIVE

No

Received 56
Or 66 Bits?
M_LOOP2
Yes
Transmission
Validation

DS00661B-page 6

© 1998 Microchip Technology Inc.

AN661
FUNCTIONAL MODULES
Reception
The reception routine (RECEIVE) is based on a reliable
algorithm which has successfully been used in previous
implementations of KEELOQ decoders. Automatic baud
rate detection is used to compensate for variations in
baud rate of different encoders of a specific type, as well
as the difference in baud rate between different encoders
(HCS200 and HCS300). The reception routine is able to
handle 64-bit transmissions. This is easily extended to
receive more bits. The reception routine is able to determine the type of encoder by the number of bits in the
transmission.
The reception algorithm performs the following functions
when an output is detected from the receiver:
1.

2.

3.

Calibrate on the header low period to determine
the actual elemental period for the transmission
being received. The required elemental period is
10% of the low header period. In the diagram
below (Figure 5) the header calibration sample
points are marked 1 through 3. The calibration flow
chart (Figure 6) shows at what points in the source
code samples 1, 2, and 3 are taken.
Elemental periods outside the capture range of the
algorithm (either too long or too short) should be
rejected, since they would be due either to noise or
to reception of an incomplete signal.
Using the determined elemental period, three
samples after the first rising edge following the
header are taken. The first sample is taken half an
elemental period after the rising edge (Sample 4);
the second, one elemental period later (Sample 5),
and the third, another one elemental period later
(Sample 6). The first sample must be high, the second could be either high or low, and the third sample must be low. If either the first or the third
sample is not as expected, the attempt at capturing a transmission is abandoned. In the diagram
below (Figure 5), the data sample points are
points 4 through 6. The flow chart describing data
reception (Figure 7) shows where in the code the
samples are taken.
If all 64 bits have been captured, each with the correct first and third elements, the transmission can
be assumed to be correct, and decryption can
commence.

© 1998 Microchip Technology Inc.

The receiving routine should be called often enough to
ensure that the high portion in the header is not missed
(Sample 1, Figure 5).
In systems where the receive routine is called to check if
there is activity on the receiver input, the routine should
poll the input for a valid transmission for at least the time
taken to complete one transmission if activity is detected
on the input line. This makes provision for the receive routine being called while a transmission is in progress. Having missed the first header, the first transmission will be
invalid and be discarded. The decoder should continue
sampling the input through the guard time in order to
catch the next header and transmission (i.e., for a
decoder designed to capture HCS300 transmissions the
time spent polling for a valid transmission should be at
least 100 ms if activity is detected in the input line).
The diagram below (Figure 5) gives all the major sampling points in the receive algorithm.
Note:

The sample points are labeled in the
receive routine flow diagrams that follow.

FIGURE 5:

SAMPLING POINTS USED IN
RECEIVE ALGORITHM

Preamble

12

Header

Data

3 4

5

6 74

5

DS00661B-page 7

AN661
Flow Diagrams
The first flow diagram (Figure 6) describes the calibration
routine which is used to determine the actual transmission rate of the encoder so that the decoder can compensate for deviations from nominal timing. There are four
different exit points, each of which should branch to a
point in the program where housekeeping and input monitoring can be resumed. There is only one exit point for a
valid calibration operation (RCV7). At this point, it is
assumed that a valid header has been received and that
a string of data bits will follow.
The second flow diagram (Figure 7) handles the
reception of bits once the calibration routine has been
successfully completed. The data bits are all sampled
three times each to ensure that a noise free transmission
has been received. The receive routine uses the calibrated elemental period, determined in the calibration
routine, to ensure that the samples are spaced correctly.
The routine resynchronizes itself on the rising flank of
each bit. Provision for identification of the encoder type,
based on the number of bits received, is included. Keeloq
encoders transmit at least 66 bits. The decoder only
receives 64 bits of the transmission, the remaining status
bits aren’t used by the decoder.
If all of the control samples in all of the bits are sampled
correctly (i.e., the first element is high and the last element is low), the routine checks whether 56 bits have
been received correctly. If not, the routine returns to the
calling procedure.

FIGURE 6:

CALIBRATION FLOW CHART

Calibrate
RECEIVE

Low

Invalid
Header
RMT_0

Input?

High

1

Reset Time-out
Counter

No
High

Input?
RCV1
Low

Time-out?
Yes
2

Clear Calibration
Counter
RCV2
Update Time-out
Counter
RCV5
Low

Input?
RCV3
High

No
Too
Long?
RCV4
Yes

3

Calibration
Counter/10
RCV6

Too
Short?
RCV6

Yes

Invalid
Header
RMT_0

No
Load
Cal Counter
RCV7

Receive
Data
DL1

DS00661B-page 8

© 1998 Microchip Technology Inc.

AN661
FIGURE 7:

DATA RECEPTION IN RECEIVE
Receive
Data
RCV7
3
Wait Half
Bit Period
DL1

Low
Input?
High

4

Wait Full
Bit Period
DL2

High
Input?
Low

5

Data = 1

Data = 0

Wait Full
Bit Period
DL3

High
7

Input?
Low

High
Low

Input?
RCV9/RCV10
No

6

No
Last Bit?
Yes

Time-out?
Yes

No
Invalid

Received
56 Bits?
RMT0
Yes
Cleanup
RMT2

© 1998 Microchip Technology Inc.

Reception
Complete
RMT1

DS00661B-page 9

AN661
VALIDATION
SYNCHRONIZATION
FUNCTION INTERPRETATION
OUTPUT ACTIVATION
KEY GENERATION
DECRYPTION
LEARN
ROM MEMORY MAP
EEPROM MEMORY MAP
RAM MEMORY MAP

The confidential and proprietary information contained in this section of AN642 has
been removed. The full application note is available under a license agreement and
can be ordered as DS40149 from Microchip Technology Inc.

DS00661B-page 10

© 1998 Microchip Technology Inc.

AN661
DEVICE PINOUTS
The device used in the application note is a PIC16C56 PDIP.

TABLE 9:
PIN

DEVICE PINOUTS

PIC16C56 Function

1
2

PORTA Bit3

3
4
5
6
7
8
9

TIME
MCLR
GND
PORTB Bit0
PORTB Bit1
PORTB Bit2
PORTB Bit3

Decoder Function

PIN

LEARN Input Active
Low
LRN IND Output Active
High
Connect to VDD
Brown out detect
Ground
S0
S1
S2
S3

PORTA Bit2

18

PORTA Bit1

PIC16C56 Function

RF Input

Decoder Function

17

PORTA Bit0

Not used

16
15
14
13
12
11
10

Osc In
Osc Out
VDD
PORTB Bit7
PORTB Bit6
PORTB Bit5
PORTB Bit4

RC osc (4 MHz)
+5V supply
FUNC OK
EEPROM CS (1)
EEPROM CLK (2)
EEPROM DIO (3+4)

TIMING PARAMETERS
TABLE 10:

TIMING PARAMETERS
Parameter

Output activation duration
Output pause if new function code received
Erase all duration
Learn mode time-out
Learn successful LED flash duration
Learn successful LED flash rate
Learn failure LED on duration

Typical

Unit

524

ms

131
8.4
33.6
4.2
3.8
1

ms
s
s
s
Hz
s

SOURCE CODE LISTING
A diskette is supplied containing source code for the Microchip decoder in the file mcdec12.asm. The code has been
compiled using MPASM v02.13.00. Certain functions are dependent on the oscillator speed for correct functioning.
Examples of time dependent functions include RECEIVE and TST_RTCC. The PIC16C56 Microcontroller should run at
4 MHz.

LIST OF IMPORTANT FUNCTIONS
Function Name

Description

CALC_KEY
DECRYPT
EEREAD

Key generation routine.
Decryption routine for Code Hop.
The data in the EEPROM at ADDRESS is read and decrypted to TMP1
and TMP2. Note that TMP1, TMP2 and ADDRESS are user defined registers.
The data in TMP1 and TMP2 is encrypted and written to the EEPROM at
ADDRESS. Note that TMP1, TMP2 and ADDRESS are user defined registers.
Check discrimination value.
Check synchronization (counter) values.
Start of the RF receive routine.
Check for learn mode and entry to learn.
Check TIMER0 and do whatever real time tasks are required.

EEWRITE

M_DIS
M_CNT
RECEIVE
TST_LEARN1
TST_RTCC

© 1998 Microchip Technology Inc.

Function Length
62
61
31

48

19
69
121
21
38

DS00661B-page 11

DS00661B-page 12

C1
10 pF

R1
10k

VO

15

16

3

4

CLKOUT

OSC1

T0CKI

MCLR

PIC16C56

R3
1k

5

G
N
D

C
C

V

14

VCC

RB0
RB1
RB2
RB3
RB4
RB5
RB6
RB7

RA0
RA1
RA2
RA3
6
7
8
9
10
11
12
13

17
18
1
2

U5

1

2

VCC

S1
LEARN INIT

R2
10k

J2
1
RF INPUT

CON3

1
2
3

1
2
3
4

VO
C3
100 µF

VCC
NC
NC
GND

LEARN

U1
CS
SK
DI
DO

G
N
D

VCC

1k

R9

R7

R6

93LC46B
SERIAL EEPROM

8
7
6
5

D7

D2

D4

VCC

FUNC OK

S3

S2

S1

R4

D3

D1

R8

R5

S0

D6

C2
100 µF

POWER SUPPLY

1N4004/7

VI

U2
LM7805

FIGURE A1:

G
N
D

GND

12V

D5

APPENDIX A:

VI

VCC U4
LOW VOLTAGE DETECTOR

J1

AN661
APPENDIX SCHEMATIC DIAGRAMS

SCHEMATIC DIAGRAM OF MICROCHIP KEELOQ DECODER

© 1998 Microchip Technology Inc.

CON3

1
2
3

12V

© 1998 Microchip Technology Inc.

C1
10 pF

R1
10k

VI

15

16

3

4

G
N
D
R3
1K

PIC16C56

CLKOUT

OSC1

T0CKI

MCLR

VO

C2
100 µF

5

G
N
D

C
C

V

14

VCC

RB0
RB1
RB2
RB3
RB4
RB5
RB6
RB7

RA0
RA1
RA2
RA3

POWER SUPPLY

1N4004/7

D5

LEARN

6
7
8
9
10
11
12
13

17
18
1
2

U5

VI
G
N
D

U2
LM7805

D10

R4
1k

ANTENNA

C3
100 µF

S1
LEARN INIT
1

2

R2
10k

VCC

S0
S1

RF INPUT

VO

VCC

1
2
3
4

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15

J3

VCC
NC
NC
GND

8
7
6
5
93LC46B
SERIAL EEPROM

U1
CS
SK
DI
DO

D8

S0

VCC

D9

Q2
NPN

RELAY SPST

K1

V1
110VAC

GARAGE LIGHT

12V

L1
GARAGE LIGHT

DOOR MOTOR

Q1
NPN

RELAY SPST

MOTOR CONTROL OUT J2
1
CON1
K2

1N4004/7

S1

1N4004/7

RF RECEIVER MODULE

VCC

12V

FIGURE A2:

VCC U4
LOW VOLTAGE DETECTOR

GND

12V

J1

AN661

TYPICAL GARAGE DOOR OPENER SCHEMATIC

DS00661B-page 13

AN661
NOTES:

DS00661B-page 14

© 1998 Microchip Technology Inc.

AN661
NOTES:

© 1998 Microchip Technology Inc.

DS00661B-page 15

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 knowledge, 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.

Information contained in this publication regarding device
applications and the like is intended through suggestion only
and may be superseded by updates. It is your responsibility to
ensure that your application meets with your specifications.
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.

Trademarks
The Microchip name and logo, the Microchip logo, FilterLab,
KEELOQ, microID, MPLAB, PIC, PICmicro, PICMASTER,
PICSTART, PRO MATE, SEEVAL and The Embedded Control
Solutions Company are registered trademarks of Microchip Technology Incorporated in the U.S.A. and other countries.
dsPIC, ECONOMONITOR, FanSense, FlexROM, fuzzyLAB,
In-Circuit Serial Programming, ICSP, ICEPIC, microPort,
Migratable Memory, MPASM, MPLIB, MPLINK, MPSIM,
MXDEV, PICC, PICDEM, PICDEM.net, rfPIC, Select Mode
and Total Endurance are trademarks of Microchip Technology
Incorporated in the U.S.A.
Serialized Quick Turn Programming (SQTP) is a service mark
of Microchip Technology Incorporated in the U.S.A.
All other trademarks mentioned herein are property of their
respective companies.
© 2002, Microchip Technology Incorporated, Printed in the
U.S.A., All Rights Reserved.
Printed on recycled paper.

Microchip received QS-9000 quality system
certification for its worldwide headquarters,
design and wafer fabrication facilities in
Chandler and Tempe, Arizona in July 1999. The
Company’s quality system processes and
procedures are QS-9000 compliant for its
PICmicro® 8-bit MCUs, KEELOQ® code hopping
devices, Serial EEPROMs and microperipheral
products. In addition, Microchip’s quality
system for the design and manufacture of
development systems is ISO 9001 certified.

 2002 Microchip Technology Inc.

M
WORLDWIDE SALES AND SERVICE
AMERICAS

ASIA/PACIFIC

Japan

Corporate Office

Australia

2355 West Chandler Blvd.
Chandler, AZ 85224-6199
Tel: 480-792-7200 Fax: 480-792-7277
Technical Support: 480-792-7627
Web Address: http://www.microchip.com

Microchip Technology Australia Pty Ltd
Suite 22, 41 Rawson Street
Epping 2121, NSW
Australia
Tel: 61-2-9868-6733 Fax: 61-2-9868-6755

Microchip Technology Japan K.K.
Benex S-1 6F
3-18-20, Shinyokohama
Kohoku-Ku, Yokohama-shi
Kanagawa, 222-0033, Japan
Tel: 81-45-471- 6166 Fax: 81-45-471-6122

Rocky Mountain

China - Beijing

2355 West Chandler Blvd.
Chandler, AZ 85224-6199
Tel: 480-792-7966 Fax: 480-792-7456

Microchip Technology Consulting (Shanghai)
Co., Ltd., Beijing Liaison Office
Unit 915
Bei Hai Wan Tai Bldg.
No. 6 Chaoyangmen Beidajie
Beijing, 100027, No. China
Tel: 86-10-85282100 Fax: 86-10-85282104

Atlanta
500 Sugar Mill Road, Suite 200B
Atlanta, GA 30350
Tel: 770-640-0034 Fax: 770-640-0307

Boston
2 Lan Drive, Suite 120
Westford, MA 01886
Tel: 978-692-3848 Fax: 978-692-3821

Chicago
333 Pierce Road, Suite 180
Itasca, IL 60143
Tel: 630-285-0071 Fax: 630-285-0075

Dallas
4570 Westgrove Drive, Suite 160
Addison, TX 75001
Tel: 972-818-7423 Fax: 972-818-2924

Detroit
Tri-Atria Office Building
32255 Northwestern Highway, Suite 190
Farmington Hills, MI 48334
Tel: 248-538-2250 Fax: 248-538-2260

Kokomo
2767 S. Albright Road
Kokomo, Indiana 46902
Tel: 765-864-8360 Fax: 765-864-8387

Los Angeles
18201 Von Karman, Suite 1090
Irvine, CA 92612
Tel: 949-263-1888 Fax: 949-263-1338

China - Chengdu
Microchip Technology Consulting (Shanghai)
Co., Ltd., Chengdu Liaison Office
Rm. 2401, 24th Floor,
Ming Xing Financial Tower
No. 88 TIDU Street
Chengdu 610016, China
Tel: 86-28-6766200 Fax: 86-28-6766599

China - Fuzhou
Microchip Technology Consulting (Shanghai)
Co., Ltd., Fuzhou Liaison Office
Unit 28F, World Trade Plaza
No. 71 Wusi Road
Fuzhou 350001, China
Tel: 86-591-7503506 Fax: 86-591-7503521

China - Shanghai
Microchip Technology Consulting (Shanghai)
Co., Ltd.
Room 701, Bldg. B
Far East International Plaza
No. 317 Xian Xia Road
Shanghai, 200051
Tel: 86-21-6275-5700 Fax: 86-21-6275-5060

China - Shenzhen

150 Motor Parkway, Suite 202
Hauppauge, NY 11788
Tel: 631-273-5305 Fax: 631-273-5335

Microchip Technology Consulting (Shanghai)
Co., Ltd., Shenzhen Liaison Office
Rm. 1315, 13/F, Shenzhen Kerry Centre,
Renminnan Lu
Shenzhen 518001, China
Tel: 86-755-2350361 Fax: 86-755-2366086

San Jose

Hong Kong

Microchip Technology Inc.
2107 North First Street, Suite 590
San Jose, CA 95131
Tel: 408-436-7950 Fax: 408-436-7955

Microchip Technology Hongkong Ltd.
Unit 901-6, Tower 2, Metroplaza
223 Hing Fong Road
Kwai Fong, N.T., Hong Kong
Tel: 852-2401-1200 Fax: 852-2401-3431

New York

Toronto
6285 Northam Drive, Suite 108
Mississauga, Ontario L4V 1X5, Canada
Tel: 905-673-0699 Fax: 905-673-6509

India
Microchip Technology Inc.
India Liaison Office
Divyasree Chambers
1 Floor, Wing A (A3/A4)
No. 11, O’Shaugnessey Road
Bangalore, 560 025, India
Tel: 91-80-2290061 Fax: 91-80-2290062

Korea
Microchip Technology Korea
168-1, Youngbo Bldg. 3 Floor
Samsung-Dong, Kangnam-Ku
Seoul, Korea 135-882
Tel: 82-2-554-7200 Fax: 82-2-558-5934

Singapore
Microchip Technology Singapore Pte Ltd.
200 Middle Road
#07-02 Prime Centre
Singapore, 188980
Tel: 65-334-8870 Fax: 65-334-8850

Taiwan
Microchip Technology Taiwan
11F-3, No. 207
Tung Hua North Road
Taipei, 105, Taiwan
Tel: 886-2-2717-7175 Fax: 886-2-2545-0139

EUROPE
Denmark
Microchip Technology Nordic ApS
Regus Business Centre
Lautrup hoj 1-3
Ballerup DK-2750 Denmark
Tel: 45 4420 9895 Fax: 45 4420 9910

France
Microchip Technology SARL
Parc d’Activite du Moulin de Massy
43 Rue du Saule Trapu
Batiment A - ler Etage
91300 Massy, France
Tel: 33-1-69-53-63-20 Fax: 33-1-69-30-90-79

Germany
Microchip Technology GmbH
Gustav-Heinemann Ring 125
D-81739 Munich, Germany
Tel: 49-89-627-144 0 Fax: 49-89-627-144-44

Italy
Microchip Technology SRL
Centro Direzionale Colleoni
Palazzo Taurus 1 V. Le Colleoni 1
20041 Agrate Brianza
Milan, Italy
Tel: 39-039-65791-1 Fax: 39-039-6899883

United Kingdom
Arizona Microchip Technology Ltd.
505 Eskdale Road
Winnersh Triangle
Wokingham
Berkshire, England RG41 5TU
Tel: 44 118 921 5869 Fax: 44-118 921-5820
01/18/02

 2002 Microchip Technology Inc.