You are on page 1of 24

2000 Microchip Technology Inc.

Preliminary DS00730A-page 1
AN730
INTRODUCTION
This application note describes the Cyclic Redundancy
Check (CRC) theory and implementation. The CRC
check is used to detect errors in a message. Two imple-
mentations are shown:
Table driven CRC calculation
Loop driven CRC calculation
This application describes the implementation of the
CRC-16 polynomial. However, there are several for-
mats for the implementation of CRC such as
CRC-CCITT, CRC-32 or other polynomials.
CRC is a common method for detecting errors in trans-
mitted messages or stored data. The CRC is a very
powerful, but easily implemented technique to obtain
data reliability.
THEORY OF OPERATION
The theory of a CRC calculation is straight forward. The
data is treated by the CRC algorithm as a binary num-
ber. This number is divided by another binary number
called the polynomial. The rest of the division is the
CRC checksum, which is appended to the transmitted
message. The receiver divides the message (including
the calculated CRC), by the same polynomial the trans-
mitter used. If the result of this division is zero, then the
transmission was successful. However, if the result is
not equal to zero, an error occurred during the trans-
mission.
The CRC-16 polynomial is shown in Equation 1. The
polynomial can be translated into a binary value,
because the divisor is viewed as a polynomial with
binary coefficients. For example, the CRC-16 poly-
nomial translates to 1000000000000101b. All coeffi-
cients, like x
2
or x
15
, are represented by a logical 1 in
the binary value.
The division uses the Modulo-2 arithmetic. Modulo-2
calculation is simply realized by XORing two numbers.
EXAMPLE 1: MODULO-2 CALCULATION
EQUATION 1: THE CRC-16 POLYNOMIAL
Example Calculation
In this example calculation, the message is two bytes
long. In general, the message can have any length in
bytes. Before we can start calculating the CRC value 1,
the message has to be augmented by n-bits, where n
is the length of the polynomial. The CRC-16 polynomial
has a length of 16-bits, therefore, 16-bits have to be
augmented to the original message. In this example
calculation, the polynomial has a length of 3-bits, there-
fore, the message has to be extended by three zeros at
the end. An example calculation for a CRC is shown in
Example 1. The reverse calculation is shown in
Example 2.
Authors: Thomas Schmidt
Microchip Technology Inc.
1 0 0 1 1 0 0 1 0 1
0 1 0 0 1 1 0 1 1 1
1 1 0 1 0 1 0 0 1 0
XOR
=
XOR-Function X1 X2 Y
0 0 0
0 1 1
1 0 1
1 1 0
P(x) = x
16
+x
15
+x
2
+1
CRC Generating and Checking
AN730
DS00730A-page 2 Preliminary 2000 Microchip Technology Inc.
EXAMPLE 2: CALCULATION FOR GENERATING A CRC
EXAMPLE 3: CHECKING A MESSAGE FOR A CRC ERROR
Message = 110101
Polynomial = 101
1 1 0 1 0 1 0 0 : 1 0 1 = 1 1 1 0 1
1 0 1
1 1 1
1 0 1
1 0 0
Remainder = CRC checksum
Message with CRC = 1 1 0 1 0 1 1 1
1 0 1
1 1 0
1 0 1
1 1 0
1 0 1
1 1
Quotient (has no function in CRC calculation)
Message with CRC = 11010111
Polynomial = 101
1 1 0 1 0 1 1 1 : 1 0 1 = 1 1 1 0 1
1 0 1
1 1 1
1 0 1
1 0 0
Checksum is zero, therefore, no transmission error
1 0 1
1 1 1
1 0 1
1 0 1
1 0 1
0 0
Quotient
2000 Microchip Technology Inc. Preliminary DS00730A-page 3
AN730
FIGURE 1: HARDWARE CRC-16 GENERATOR
FIGURE 2: LOOP DRIVEN CRC IMPLEMENTATION
CRC Hardware Implementation
The CRC calculation is realized with a shift register and
XOR gates. Figure 1 shows a CRC generator for the
CRC-16 polynomial. Each bit of the data is shifted into
the CRC shift register (Flip-Flops) after being XORed
with the CRCs most significant bit.
Software Implementations
There are two different techniques for implementing a
CRC in software. One is a loop driven implementation
and the other is a table driven implementation.
The loop driven implementation works like the calcula-
tion shown in Figure 2. The data is fed through a shift
register. If a one pops out at the MSb, the content is
XORed with the polynomial. In the other, the registers
are shifted by one position to the left.
Another method to calculate a CRC is to use precalcu-
lated values and XOR them to the shift register.
+ + +
Data
x
0
x
2
x
15
x
16
Flip-Flops
CRC_HIGH
CRC_LOW
CRC_BUFF
C
0 7 7 0 0 7
Note: The mathematical details are not given
within this application note. The interested
reader may refer to the material shown in
the Reference section.
AN730
DS00730A-page 4 Preliminary 2000 Microchip Technology Inc.
LOOP DRIVEN CRC
IMPLEMENTATION
This section describes the loop driven CRC implemen-
tation. This implementation is derived from the hard-
ware implementation shown in Figure 1. The program
for the loop driven CRC generation and CRC checking
is shown in Appendix A.
CRC Generation
The implementation of a loop driven CRC generation is
shown in Figure 2. In the first step the registers,
CRC_HIGH and CRC_LOW, are initialized with the first
two bytes of data. CRC_BUFF is loaded with the third
byte of data. After that, the MSb of CRC_BUFF is
shifted into the LSb of CRC_LOW and the MSb of
CRC_LOW is shifted into the LSb of CRC_HIGH. The
MSb of CRC_HIGH, which is now stored in the Carry
flag, is tested to see if it is set. If the bit is set, the reg-
isters, CRC_HIGH and CRC_LOW, will be XORed with
the CRC-16 polynomial. If the bit is not set, the next bit
from CRC_BUFF will be shifted into the LSb of
CRC_LOW.
This process is repeated until all data from CRC_BUFF
is shifted into CRC_LOW. After this, CRC_BUFF is
loaded with the next data byte. Then all data bytes are
processed, and 16 zeros are appended to the mes-
sage. The registers, CRC_HIGH and CRC_LOW, con-
tain the calculated CRC value. The message can have
any length. In this application note, the CRC value for
8 data bytes is calculated.
CRC Checking
The CRC check uses the same technique as the CRC
generation, with the only difference being that zeros
are not appended to the message.
TABLE DRIVEN CRC
IMPLEMENTATION
A table driven CRC routine uses a different technique
than a loop driven CRC routine. The idea behind a
table driven CRC implementation is that instead of cal-
culating the CRC bit by bit, precomputed bytes are
XORed to the data. The source code for the table
driven implementation is given in Appendix B.
The advantage of the table driven implementation is
that it is faster than the loop driven solution. The draw-
back is that it consumes more program memory
because of the size of the look-up table.
CRC Generation
The CRC at the table driven implementation is gener-
ated by reading a precomputed value out of a table and
XOR, the result with the low and high byte of the CRC
shift registers.
In the first step, the registers, CRC_BUFF, CRC_HIGH
and CRC_LOW, are initialized with the first three bytes
of data. After that, the value in CRC_BUFF is used as
an offset to get the value for the precomputed CRC
value out of the look-up table. Since the CRC-16 is 16
bits long, the look-up table is split up into two separate
look-up tables. One for the high byte of the CRC regis-
ter and one for the low byte of the CRC register (see
Figure 3). The result from the look-up table of the high
byte is XORed to the content of the CRC_HIGH regis-
ter. The result for the low byte is XORed to the content
of CRC_LOW. The results are stored back in
CRC_LOW.
The next step is that the content from CRC_HIGH is
shifted into CRC_BUFF and the content from
CRC_LOW is shifted into the register, CRC_HIGH.
Then the register, CRC_LOW, is loaded with the new
data byte.
This process repeats for all data bytes. At the end of the
CRC generation, the message has to be appended by
16 zeros. The 16 zeros are treated like the data bytes.
After the calculation is done, the content of the regis-
ters, CRC_HIGH and CRC_LOW, are appended to the
message.
CRC Checking
The CRC check uses the same technique as the CRC
generation, with the difference being that zeros are not
appended to the message.
COMPARISON
Table 1 shows a comparison between the loop driven
implementation and the table driven implementation.
For the calculation, 8 data bytes were used.
TABLE 1: CRC-16 COMPARISON TABLE
Implementation
CRC
Generation
(in cycles)
CRC
Check
(in
cycles)
Program
Memory
Usage
(words)
Data
Bytes
Loop Driven 865 870 85 6
Table Driven 348 359 612 5
2000 Microchip Technology Inc. Preliminary DS00730A-page 5
AN730
ADVANTAGES OF CRC VS. SIMPLE
SUM TECHNIQUES
The CRC generation has many advantages over sim-
ple sum techniques or parity check. CRC error correc-
tion allows detection of:
1. single bit errors
2. double bit errors
3. bundled bit errors (bits next to each other)
A parity bit check detects only single bit errors. The
CRC error correction is mostly used where large data
packages are transmitted, for example, in local area
networks such as Ethernet.
References
Ross N. Williams - A Painless Guide to CRC Error
Detection Algorithms
Donald E. Knuth - The Art of Computer Programming,
Volume 2, Addisson Wesley
AN730
DS00730A-page 6 Preliminary 2000 Microchip Technology Inc.
FIGURE 3: TABLE DRIVEN CRC CALCULATION IMPLEMENTATION
CRC_BUFF CRC_HIGH
CRC_LOW
0
7
0 0 7 7
TABLE_HIGH
0
0xFF
0 7 TABLE_LOW
0
0xFF
0 7
+
+


2
0
0
0

M
i
c
r
o
c
h
i
p

T
e
c
h
n
o
l
o
g
y

I
n
c
.
P
r
e
l
i
m
i
n
a
r
y
D
S
0
0
7
3
0
A
-
p
a
g
e

7
A
N
7
3
0
APPENDIX A: SOURCE CODE FOR LOOP DRIVEN CRC IMPLEMENATION
MPASM 02.30.11 Intermediate CRC16_04.ASM 3-9-2000 13:00:00 PAGE 1
LOC OBJECT CODE LINE SOURCE TEXT
VALUE
00001 ; ***********************************************************************************************
00002 ; * Title : CRC16 calculation *
00003 ; * Author : Thomas Schmidt *
00004 ; * Date : 15.04.1999 *
00005 ; * Revision : 0.4 *
00006 ; * Last Modified : 15.04.1999 *
00007 ; * Core : 12-bit, 14-bit (12-bit core tested) *
00008 ; * Peripherals used: none *
00009 ; * Registers used : *
00010 ; * Modifications : crc16_01.asm Checksum check was added *
00011 ; * crc16_03.asm Number of data bytes was increased from 2 to 8 bytes *
00012 ; * crc16_04.asm added revers CRC
00013 ; * Description : *
00014 ; * *
00015 ; * This module calculates the checksum for the CRC16 polynom. The CRC16 polynome is defined *
00016 ; * as x16+x15+x2+x0. The calculation is done by bitwise checking. The algorithm is designed *
00017 ; * for a two byte wide message. The algorithm can easily be modified for longer messages. The *
00018 ; * only thing what has to be done is to check after the low byte is shifted into the high byte *
00019 ; * that the low byte is loaded with a new data byte. The number of iteration has to be adjusted*
00020 ; * to the number of extra bytes in the data message. The number is calculated as follows: *
00021 ; * n=16+x*messagebits. For example if the message is 4 bytes long the number of iterations is *
00022 ; * n=16+16bits. The extra iterations have to be done because the message is extended with 16 *
Software License Agreement
The software supplied herewith by Microchip Technology Incorporated (the Company) for its PICmicro Microcontroller is intended
and supplied to you, the Companys customer, for use solely and exclusively on Microchip PICmicro Microcontroller products.
The software is owned by the Company and/or its supplier, and is protected under applicable copyright laws. All rights are reserved.
Any use in violation of the foregoing restrictions may subject the user to criminal sanctions under applicable laws, as well as to civil
liability for the breach of the terms and conditions of this license.
THIS SOFTWARE IS PROVIDED IN AN AS IS CONDITION. NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATU-
TORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICU-
LAR PURPOSE APPLY TO THIS SOFTWARE. THE COMPANY SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR
SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER.
AN730
DS00730A-page 8 Preliminary 2000 Microchip Technology Inc.






















0
0
0
2
3

;

*

z
e
r
o
s

a
t

t
h
e

e
n
d

o
f

t
h
e

m
e
s
s
a
g
e
.




























































*



























































































































*






















0
0
0
2
4

;

*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*






















0
0
0
2
5























0
0
0
2
6























0
0
0
2
7

















L
I
S
T

P
=
1
6
C
5
4
B
,

r
=
h
e
x






















0
0
0
2
8































0
0
0
2
9

















#
i
n
c
l
u
d
e

p
1
6
c
5
x
.
i
n
c























0
0
0
0
1









L
I
S
T






















0
0
0
0
2

;

P
1
6
C
5
X
.
I
N
C


S
t
a
n
d
a
r
d

H
e
a
d
e
r

F
i
l
e
,

V
e
r
s
i
o
n

4
.
0
0




M
i
c
r
o
c
h
i
p

T
e
c
h
n
o
l
o
g
y
,

I
n
c
.






















0
0
3
1
3









L
I
S
T






















0
0
0
3
0























0
0
0
3
1

















#
d
e
f
i
n
e

P
o
l
y
n
o
m
L
o
w






b

0
0
0
0
0
1
0
1






;

l
o
w

b
y
t
e

o
f

p
o
l
y
n
o
m
e






















0
0
0
3
2

















#
d
e
f
i
n
e

P
o
l
y
n
o
m
H
i
g
h





b

1
0
0
0
0
0
0
0






;

h
i
g
h

b
y
t
e

o
f

p
o
l
y
n
o
m
e






















0
0
0
3
3

















#
d
e
f
i
n
e

P
o
l
y
n
o
m
L
e
n
g
t
h



0
x
1
0












;

1
6
-
b
i
t

p
o
l
y
n
o
m
e

l
e
n
g
t
h






















0
0
0
3
4

















#
d
e
f
i
n
e

D
a
t
a
L
e
n
g
t
h






0
x
0
9












;

D
a
t
a

l
e
n
g
t
h

i
n

B
i
t
s






















0
0
0
3
5

















#
d
e
f
i
n
e

I
t
e
r
a
t
i
o
n
s






0
x
0
8












;

n
u
m
b
e
r

o
f

i
t
e
r
a
t
i
o
n
s

f
o
r

C
R
C

c
a
l
c
u
l
a
t
i
o
n






















0
0
0
3
6























0
0
0
3
7

















c
b
l
o
c
k


0
x
0
7


0
0
0
0
0
0
0
7












0
0
0
3
8

























C
R
C
_
H
I
G
H
















;

C
R
C

s
h
i
f
t

r
e
g
i
s
t
e
r
s


0
0
0
0
0
0
0
8












0
0
0
3
9

























C
R
C
_
L
O
W

















;

s
e
c
o
n
d

C
R
C

s
h
i
f
t

r
e
g
i
s
t
e
r


0
0
0
0
0
0
0
9












0
0
0
4
0

























C
R
C
_
B
U
F
F
















;

C
R
C

b
u
f
f
e
r

r
e
g
i
s
t
e
r


0
0
0
0
0
0
0
A












0
0
0
4
1

























B
I
T
S




















;

n
u
m
b
e
r

o
f

d
a
t
a

b
i
t
s


0
0
0
0
0
0
0
B












0
0
0
4
2

























D
A
T
A
B
Y
T
E
S















;

n
u
m
b
e
r

o
f

b
y
t
e
s

o
f

d
a
t
a


0
0
0
0
0
0
0
C












0
0
0
4
3

























T
E
M
P




















;

t
e
m
p
o
r
a
r
y

r
e
g
i
s
t
e
r






















0
0
0
4
4

















e
n
d
c






















0
0
0
4
5

0
1
F
F


















0
0
0
4
6

















O
R
G

0
x
1
f
f
0
1
F
F



0
A
0
0











0
0
0
4
7

















g
o
t
o




B
e
g
i
n






















0
0
0
4
8























0
0
0
4
9























0
0
0
5
0

0
0
0
0


















0
0
0
5
1

















O
R
G

0
x
0
0
0
0
0
0



0
C
1
0











0
0
0
5
2

B
e
g
i
n











m
o
v
l
w



0
x
1
0




















;

D
a
t
a

f
o
r

C
R
C

g
e
n
e
r
a
t
i
o
n
0
0
0
1



0
0
2
4











0
0
0
5
3

















m
o
v
w
f



F
S
R





















;

S
e
t

p
o
i
n
t

t
o

b
e
g
i
n

o
f

d
a
t
a

b
l
o
c
k
0
0
0
2



0
C
A
A











0
0
0
5
4

















m
o
v
l
w



0
x
A
A




















;

d
a
t
a






















0
0
0
5
5































0
0
0
5
6















































0
0
0
5
7

















;

i
n
i
t
i
a
l
i
z
a
t
i
o
n

w
h
a
t

h
a
s

t
o

b
e

d
o
n
e

b
e
f
o
r
e

C
R
C
1
6

r
o
u
t
i
n
e

c
a
n

b
e






















0
0
0
5
8

















;

c
a
l
l
e
d
.

T
h
e

F
S
R

r
e
g
i
s
t
e
r

c
o
n
t
a
i
n
s

t
h
e

p
o
i
n
t
e
r

t
o

t
h
e

f
i
r
s
t

b
y
t
e

o
f






















0
0
0
5
9

















;

d
a
t
a

a
n
d

t
h
e

r
e
g
i
s
t
e
r

D
A
T
A
B
Y
T
E
S

c
o
n
t
a
i
n
s

t
h
e

n
u
m
b
e
r

o
f

d
a
t
a

b
y
t
e
s






















0
0
0
6
0

















;

o
f

t
h
e

m
e
s
s
a
g
e
.
0
0
0
3



0
C
1
0











0
0
0
6
1

















m
o
v
l
w



0
x
1
0




















;

s
e
t

p
o
i
n
t
e
r

t
o

f
i
r
s
t

d
a
t
a

l
o
c
a
t
i
o
n
0
0
0
4



0
0
2
4











0
0
0
6
2

















m
o
v
w
f



F
S
R





















;

i
n
i
t
i
a
l
i
z
e

F
S
R

r
e
g
i
s
t
e
r






















0
0
0
6
3

































































0
0
0
5



0
9
1
0











0
0
0
6
4

M
a
i
n












c
a
l
l




C
R
C
1
6
G
e
n
e
r
a
t
e











;

c
a
l
c
u
l
a
t
e

C
R
C
1
6

v
a
l
u
e






















0
0
0
6
5

















2000 Microchip Technology Inc. Preliminary DS00730A-page 9
AN730






















0
0
0
6
6

















;

a
p
p
e
n
d

C
R
C

t
o

m
e
s
s
a
g
e
0
0
0
6



0
2
A
4











0
0
0
6
7

















i
n
c
f




F
S
R
,

f


















;

p
o
i
n
t

t
o

p
o
s
i
t
i
o
n

b
e
h
i
n
d

l
a
s
t

d
a
t
a

b
y
t
e
0
0
0
7



0
2
0
7











0
0
0
6
8

















m
o
v
f




C
R
C
_
H
I
G
H
,

w













;

c
o
p
y

C
R
C
_
H
I
G
H

d
a
t
a

i
n
t
o

w
-
r
e
g
i
s
t
e
r
0
0
0
8



0
0
2
0











0
0
0
6
9

















m
o
v
w
f



I
N
D
F




















;

c
o
p
y

C
R
C
_
H
I
G
H

b
e
h
i
n
g

l
a
s
t

d
a
t
a

b
y
t
e
0
0
0
9



0
2
A
4











0
0
0
7
0

















i
n
c
f




F
S
R
,

f


















;

p
o
i
n
t

t
o

n
e
x
t

l
o
c
a
t
i
o
n
0
0
0
A



0
2
0
8











0
0
0
7
1

















m
o
v
f




C
R
C
_
L
O
W
,

w














;

c
o
p
y

C
R
C
_
L
O
W

d
a
t
a

i
n
t
o

w
-
r
e
g
i
s
t
e
r
0
0
0
B



0
0
2
0











0
0
0
7
2

















m
o
v
w
f



I
N
D
F




















;

c
o
p
y

d
a
t
a

i
n
t
o

n
e
x
t

l
o
c
a
t
i
o
n
0
0
0
C



0
C
1
0











0
0
0
7
3

















m
o
v
l
w



0
x
1
0




















;

s
e
t

p
o
i
n
t
e
r

t
o

f
i
r
s
t

d
a
t
a

l
o
c
a
t
i
o
n
0
0
0
D



0
0
2
4











0
0
0
7
4

















m
o
v
w
f



F
S
R





















;

i
n
i
t
i
a
l
i
z
e

F
S
R

r
e
g
i
s
t
e
r
0
0
0
E



0
9
2
4











0
0
0
7
5

















c
a
l
l




C
R
C
1
6
R
e
s
t
o
r
e












;

r
e
s
t
o
r
e

C
R
C
1
6

v
a
l
u
e






















0
0
0
7
6

0
0
0
F



0
A
0
F











0
0
0
7
7

S
t
o
p












g
o
t
o




S
t
o
p




















;

d
o

f
o
r
e
v
e
r






















0
0
0
7
8























0
0
0
7
9

















;

*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*






















0
0
0
8
0

















;

*

T
i
t
l
e
:














C
R
C
1
6

c
a
l
c
u
l
a
t
i
o
n







































*






















0
0
0
8
1

















;

*

I
n
p
u
t

p
a
r
a
m
e
t
e
r
:




P
o
i
n
t
e
r

t
o

f
i
r
s
t

d
a
t
a

b
y
t
e

(
p
o
i
n
t
e
r

i
n

F
S
R

r
e
g
i
s
t
e
r
)




*






















0
0
0
8
2

















;

*





















N
u
m
b
e
r

o
f

d
a
t
a

b
y
t
e
s

s
t
o
r
e
d

i
n

r
e
g
i
s
t
e
r

D
A
T
A
B
Y
T
E
S







*






















0
0
0
8
3

















;

*

O
u
t
p
u
t
:













C
R
C

r
e
s
u
l
t

s
t
o
r
e
d

i
n

C
R
C
_
H
I
G
H

a
n
d

C
R
C
_
L
O
W















*






















0
0
0
8
4

















;

*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
0
0
1
0



0
9
3
8











0
0
0
8
5

C
R
C
1
6
G
e
n
e
r
a
t
e



c
a
l
l




C
R
C
1
6
I
n
i
t















;

i
n
i
t
i
a
l
i
z
e

r
e
g
i
s
t
e
r
s
0
0
1
1



0
C
0
3











0
0
0
8
6

















m
o
v
l
w



0
x
0
3




















;

i
n
i
t
i
a
l
i
z
e

T
E
M
P

r
e
g
i
s
t
e
r

w
i
t
h

2
0
0
1
2



0
0
2
C











0
0
0
8
7

















m
o
v
w
f



T
E
M
P




















;

m
o
v
e

0
x
0
2

i
n
t
o

T
E
M
P

















































0
0
0
8
8

















0
0
1
3



0
9
4
7











0
0
0
8
9

N
e
x
t
C
R
C
1
6







c
a
l
l




C
R
C
1
6
E
n
g
i
n
e













;

C
a
l
c
u
l
a
t
e

C
R
C
1
6

f
o
r

o
n
e

b
y
t
e
0
0
1
4



0
2
E
B











0
0
0
9
0

















d
e
c
f
s
z


D
A
T
A
B
Y
T
E
S
,

f












;

D
e
c
r
e
m
e
n
t

t
h
e

n
u
m
b
e
r

o
f

d
a
t
a

b
y
t
e
s

b
y

o
n
e
0
0
1
5



0
A
1
E











0
0
0
9
1

















g
o
t
o




R
e
l
o
a
d


















;

r
e
l
o
a
d

C
R
C
_
B
U
F
F

r
e
g
i
s
t
e
r

w
i
t
h

n
e
w

d
a
t
a

b
y
t
e






















0
0
0
9
2

















0
0
1
6



0
2
E
C











0
0
0
9
3

















d
e
c
f
s
z


T
E
M
P
,

f

















;

d
e
c
r
e
m
e
n
t

T
E
M
P

r
e
g
i
s
t
e
r
0
0
1
7



0
A
1
9











0
0
0
9
4

















g
o
t
o




A
p
p
e
n
d
Z
e
r
o
s













;

A
p
p
e
n
d

z
e
r
o
s

t
o

m
e
s
s
a
g
e
0
0
1
8



0
8
0
0











0
0
0
9
5

















r
e
t
l
w



0
x
0
0




















;

r
e
t
u
r
n

t
o

m
a
i
n
0
0
1
9



0
0
6
9











0
0
0
9
6

A
p
p
e
n
d
Z
e
r
o
s





c
l
r
f




C
R
C
_
B
U
F
F
















;

a
p
p
e
n
d

d
a
t
a

w
i
t
h

z
e
r
o
s
0
0
1
A



0
C
0
8











0
0
0
9
7

















m
o
v
l
w



I
t
e
r
a
t
i
o
n
s














;

i
n
i
t
i
a
l
i
z
e

B
I
T
S

r
e
g
i
s
t
e
r
0
0
1
B



0
0
2
A











0
0
0
9
8

















m
o
v
w
f



B
I
T
S




















;

w
i
t
h

0
x
0
8
0
0
1
C



0
2
A
B











0
0
0
9
9

















i
n
c
f




D
A
T
A
B
Y
T
E
S
,

f












;

i
n
c
r
e
m
e
n
t

d
a
t
a

b
y
t
e
s

0
0
1
D



0
A
1
3











0
0
1
0
0

















g
o
t
o




N
e
x
t
C
R
C
1
6















;

l
a
s
t

i
t
e
r
a
t
i
o
n






















0
0
1
0
1























0
0
1
0
2























0
0
1
0
3

















;

R
e
l
o
a
d

C
R
C

b
u
f
f
e
r

r
e
g
i
s
t
e
r

w
i
t
h

n
e
w

d
a
t
a

w
o
r
d
.
0
0
1
E



0
2
A
4











0
0
1
0
4

R
e
l
o
a
d










i
n
c
f




F
S
R
,

f


















;

p
o
i
n
t

t
o

n
e
x
t

d
a
t
a

b
y
t
e
0
0
1
F



0
2
0
0











0
0
1
0
5

















m
o
v
f




I
N
D
F
,

w

















;

c
o
p
y

d
a
t
a

i
n
t
o

w
-
r
e
g
i
s
t
e
r
0
0
2
0



0
0
2
9











0
0
1
0
6

















m
o
v
w
f



C
R
C
_
B
U
F
F
















;

m
o
v
e

d
a
t
a

i
n
t
o

C
R
C
_
B
U
F
F

r
e
g
i
s
t
e
r
0
0
2
1



0
C
0
8











0
0
1
0
7

















m
o
v
l
w



I
t
e
r
a
t
i
o
n
s














;

i
n
i
t
i
a
l
i
z
e

r
e
g
i
s
t
e
r

B
I
T
S

w
i
t
h

8
0
0
2
2



0
0
2
A











0
0
1
0
8

















m
o
v
w
f



B
I
T
S




















;

m
o
v
e

8

i
n
t
o

r
e
g
i
s
t
e
r

B
I
T
S
0
0
2
3



0
A
1
3











0
0
1
0
9

















g
o
t
o




N
e
x
t
C
R
C
1
6















;

c
a
l
c
u
l
a
t
e

n
e
x
t

C
R
C


































0
0
1
1
0























0
0
1
1
1























0
0
1
1
2

















;

*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
AN730
DS00730A-page 10 Preliminary 2000 Microchip Technology Inc.






















0
0
1
1
3

















;

*

T
i
t
e
l
:

R
e
s
t
o
r
e

C
R
C

f
u
n
c
t
i
o
n

















































*






















0
0
1
1
4

















;

*

I
n
p
u
t
:

P
o
i
n
t
e
r

t
o

f
i
r
s
t

d
a
t
a

b
y
t
e

i
n

F
S
R

r
e
g
i
s
t
e
r



























*






















0
0
1
1
5

















;

*

O
u
t
p
u
t
:

w
=
0

C
R
C

w
a
s

r
e
s
t
o
r
e

s
u
c
e
s
s
f
u
l
l






































*






















0
0
1
1
6

















;

*









w
=
1

C
R
C

w
a
s

n
o
t

r
e
s
t
o
r
e
d

s
u
c
e
s
s
f
u
l
l

































*






















0
0
1
1
7

















;

*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
0
0
2
4



0
9
3
8











0
0
1
1
8

C
R
C
1
6
R
e
s
t
o
r
e




c
a
l
l




C
R
C
1
6
I
n
i
t















;

i
n
i
t
i
a
l
i
z
e

C
R
C

r
e
g
i
s
t
e
r
s
0
0
2
5



0
C
0
2











0
0
1
1
9

















m
o
v
l
w



0
x
0
2




















;

a
d
d

o
f
f
s
e
t

t
o

D
A
T
A
B
Y
T
E
S
0
0
2
6



0
1
E
B











0
0
1
2
0

















a
d
d
w
f



D
A
T
A
B
Y
T
E
S
,

f












;

a
d
d

o
f
f
s
e
t

t
o

r
e
g
i
s
t
e
r

D
A
T
A
B
Y
T
E
S






















0
0
1
2
1

















0
0
2
7



0
9
4
7











0
0
1
2
2

N
e
x
t
C
R
C
R
e
s
t
o
r
e


c
a
l
l




C
R
C
1
6
E
n
g
i
n
e
0
0
2
8



0
2
E
B











0
0
1
2
3

















d
e
c
f
s
z


D
A
T
A
B
Y
T
E
S
,

f












;

D
e
c
r
e
m
e
n
t

t
h
e

n
u
m
b
e
r

o
f

d
a
t
a

b
y
t
e
s

b
y

o
n
e
0
0
2
9



0
A
3
2











0
0
1
2
4

















g
o
t
o




R
e
l
o
a
d
R
e
s
t
o
r
e











;

r
e
l
o
a
d

C
R
C
_
B
U
F
F

r
e
g
i
s
t
e
r

w
i
t
h

n
e
w

d
a
t
a

b
y
t
e






















0
0
1
2
5







































0
0
1
2
6

















;

c
h
e
c
k

i
f

C
R
C
_
H
I
G
H

a
n
d

C
R
C
_
L
O
W

e
q
u
a
l

t
o

z
e
r
o
0
0
2
A



0
2
2
7











0
0
1
2
7

















m
o
v
f




C
R
C
_
H
I
G
H
,

f













;

c
o
p
y

C
R
C
_
H
I
G
H

o
n
t
o

i
t
s
e
l
f
0
0
2
B



0
7
4
3











0
0
1
2
8

















b
t
f
s
s



S
T
A
T
U
S
,

Z















;

i
s

c
o
n
t
e
n
t

z
e
r
o
?
0
0
2
C



0
A
3
1











0
0
1
2
9

















g
o
t
o




C
R
C
E
r
r
o
r
















;

n
o
,

C
R
C

e
r
r
o
r

o
c
c
u
r
e
d
0
0
2
D



0
2
2
8











0
0
1
3
0

















m
o
v
f




C
R
C
_
L
O
W
,

f














;

c
o
p
y

C
R
C
_
L
O
W

r
e
g
i
s
t
e
r

o
n
t
o

i
t
s
e
l
f
0
0
2
E



0
7
4
3











0
0
1
3
1

















b
t
f
s
s



S
T
A
T
U
S
,

Z















;

i
s

c
o
n
t
e
n
t

z
e
r
o
?
0
0
2
F



0
A
3
1











0
0
1
3
2

















g
o
t
o




C
R
C
E
r
r
o
r
















;

n
o
,

C
R
C

e
r
r
o
r

o
c
c
u
r
e
d
0
0
3
0



0
8
0
0











0
0
1
3
3

















r
e
t
l
w



0
x
0
0




















;

r
e
t
u
r
n

t
o

m
a
i
n

(
0
=

n
o

e
r
r
o
r
)






















0
0
1
3
4

0
0
3
1



0
8
0
1











0
0
1
3
5

C
R
C
E
r
r
o
r








r
e
t
l
w



0
x
0
1




















;

r
e
t
u
r
n

t
o

m
a
i
n

w
i
t
h

e
r
r
o
r

c
o
d
e

1






















0
0
1
3
6























0
0
1
3
7























0
0
1
3
8

















;

R
e
l
o
a
d

C
R
C

b
u
f
f
e
r

r
e
g
i
s
t
e
r

w
i
t
h

n
e
w

d
a
t
a

w
o
r
d
.
0
0
3
2



0
2
A
4











0
0
1
3
9

R
e
l
o
a
d
R
e
s
t
o
r
e



i
n
c
f




F
S
R
,

f


















;

p
o
i
n
t

t
o

n
e
x
t

d
a
t
a

b
y
t
e
0
0
3
3



0
2
0
0











0
0
1
4
0

















m
o
v
f




I
N
D
F
,

w

















;

c
o
p
y

d
a
t
a

i
n
t
o

w
-
r
e
g
i
s
t
e
r
0
0
3
4



0
0
2
9











0
0
1
4
1

















m
o
v
w
f



C
R
C
_
B
U
F
F
















;

m
o
v
e

d
a
t
a

i
n
t
o

C
R
C
_
B
U
F
F

r
e
g
i
s
t
e
r
0
0
3
5



0
C
0
8











0
0
1
4
2

















m
o
v
l
w



I
t
e
r
a
t
i
o
n
s














;

i
n
i
t
i
a
l
i
z
e

r
e
g
i
s
t
e
r

B
I
T
S

w
i
t
h

8
0
0
3
6



0
0
2
A











0
0
1
4
3

















m
o
v
w
f



B
I
T
S




















;

m
o
v
e

8

i
n
t
o

r
e
g
i
s
t
e
r

B
I
T
S
0
0
3
7



0
A
2
7











0
0
1
4
4

















g
o
t
o




N
e
x
t
C
R
C
R
e
s
t
o
r
e










;

c
a
l
c
u
l
a
t
e

n
e
x
t

C
R
C


































0
0
1
4
5























0
0
1
4
6























0
0
1
4
7

















;

*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*






















0
0
1
4
8

















;

*

T
i
t
e
l
:

C
R
C
1
6

I
n
i
t
i
a
l
i
z
a
t
i
o
n

















































*






















0
0
1
4
9

















;

*

I
n
p
u
t
:

P
o
i
n
t
e
r

t
o

f
i
r
s
t

d
a
t
a

b
y
t
e

i
n

F
S
R

r
e
g
i
s
t
e
r



























*






















0
0
1
5
0

















;

*

O
u
t
p
u
t
:

n
o
n
e
































































*






















0
0
1
5
1

















;

*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
0
0
3
8



0
2
0
0











0
0
1
5
2

C
R
C
1
6
I
n
i
t







m
o
v
f




I
N
D
F
,

w

















;

c
o
p
y

d
a
t
a

i
n
t
o

W
-
r
e
g
i
s
t
e
r
0
0
3
9



0
0
2
7











0
0
1
5
3

















m
o
v
w
f



C
R
C
_
H
I
G
H
















;

c
o
p
y

w
-
r
e
g
i
s
t
e
r

i
n
t
o

C
R
C
_
H
I
G
H

r
e
g
i
s
t
e
r
0
0
3
A



0
2
A
4











0
0
1
5
4

















i
n
c
f




F
S
R
,

f


















;

s
e
t

p
o
i
n
t
e
r

t
o

n
e
x
t

l
o
c
a
t
i
o
n
0
0
3
B



0
2
0
0











0
0
1
5
5

















m
o
v
f




I
N
D
F
,

w

















;

c
o
p
y

d
a
t
a

i
n
t
o

w
-
r
e
g
i
s
t
e
r
0
0
3
C



0
0
2
8











0
0
1
5
6

















m
o
v
w
f



C
R
C
_
L
O
W

















;

c
o
p
y

w
-
r
e
g
i
s
t
e
r

i
n
t
o

C
R
C
_
L
O
W
0
0
3
D



0
2
A
4











0
0
1
5
7

















i
n
c
f




F
S
R
,

f


















;

s
e
t

p
o
i
n
t
e
r

t
o

n
e
x
t

l
o
c
a
t
i
o
n
0
0
3
E



0
2
0
0











0
0
1
5
8

















m
o
v
f




I
N
D
F
,

w

















;

c
o
p
y

n
e
x
t

d
a
t
a

i
n
t
o

w
-
r
e
g
i
s
t
e
r
2000 Microchip Technology Inc. Preliminary DS00730A-page 11
AN730
0
0
3
F



0
0
2
9











0
0
1
5
9

















m
o
v
w
f



C
R
C
_
B
U
F
F
















;

c
o
p
y

d
a
t
a

i
n
t
o

C
R
C

b
u
f
f
e
r

r
e
g
i
s
t
e
r
0
0
4
0



0
C
0
8











0
0
1
6
0

















m
o
v
l
w



I
t
e
r
a
t
i
o
n
s














;

i
n
i
t
i
a
l
i
z
e

r
e
g
i
s
t
e
r

B
I
T
s

w
i
t
h
0
0
4
1



0
0
2
A











0
0
1
6
1

















m
o
v
w
f



B
I
T
S




















;

l
e
n
g
t
h

o
f

p
o
l
y
n
o
m
e

f
o
r

i
t
e
r
a
t
i
o
n
0
0
4
2



0
C
0
9











0
0
1
6
2

















m
o
v
l
w



D
a
t
a
L
e
n
g
t
h














;

c
o
p
y

n
u
m
b
e
r

o
f

d
a
t
a

b
y
t
e
s
0
0
4
3



0
0
2
B











0
0
1
6
3

















m
o
v
w
f



D
A
T
A
B
Y
T
E
S















;

i
n
t
o

r
e
g
i
s
t
e
r

D
a
t
a
B
y
t
e
s
0
0
4
4



0
C
0
3











0
0
1
6
4

















m
o
v
l
w



0
x
0
3




















;

d
e
c
r
e
m
e
n
t

t
h
r
e
e

f
r
o
m

t
h
e

n
u
m
b
e
r
0
0
4
5



0
0
A
B











0
0
1
6
5

















s
u
b
w
f



D
A
T
A
B
Y
T
E
S
,

f












;

o
f

d
a
t
a

b
y
t
e
s
,

b
e
c
a
u
s
e

t
h
r
e
e

r
e
g
i
s
t
e
r






















0
0
1
6
6

















































;

a
r
e

n
o
w

i
n
i
t
i
a
l
i
z
e
d
0
0
4
6



0
8
0
0











0
0
1
6
7

















r
e
t
l
w



0
x
0
0




















;

r
e
t
u
r
n

f
r
o
m

s
u
b
r
o
u
t
i
n
e






















0
0
1
6
8























0
0
1
6
9























0
0
1
7
0























0
0
1
7
1

















;

*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*






















0
0
1
7
2

















;

*

T
i
t
e
l
:

C
R
C
1
6

E
n
g
i
n
e

























































*






















0
0
1
7
3

















;

*

I
n
p
u
t
:

P
o
i
n
t
e
r

t
o

f
i
r
s
t

d
a
t
a

b
y
t
e

i
n

F
S
R

r
e
g
i
s
t
e
r



























*






















0
0
1
7
4

















;

*

O
u
t
p
u
t
:

n
o
n
e
































































*






















0
0
1
7
5

















;

*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
0
0
4
7



0
4
0
3











0
0
1
7
6

C
R
C
1
6
E
n
g
i
n
e





b
c
f





S
T
A
T
U
S
,

C















;

c
l
e
a
r

c
a
r
r
y

f
l
a
g
0
0
4
8



0
3
6
9











0
0
1
7
7

















r
l
f





C
R
C
_
B
U
F
F
,

f













;

s
h
i
f
t

b
i
t
7

o
f

C
R
C
_
B
U
F
F

i
n
t
o

c
a
r
r
y

f
l
a
g
0
0
4
9



0
3
6
8











0
0
1
7
8

















r
l
f





C
R
C
_
L
O
W
,

f














;

s
h
i
f
t

b
i
t
7

o
f

C
R
C
_
L
O
W

i
n
t
o

c
a
r
r
y

f
l
a
g






















0
0
1
7
9

















































;

a
n
d

s
h
i
f
t

0

i
n
t
o

b
i
t
7

o
f

C
R
C
_
L
O
W
0
0
4
A



0
3
6
7











0
0
1
8
0

















r
l
f





C
R
C
_
H
I
G
H
,

f













;

r
o
t
a
t
e

c
a
r
r
y

f
l
a
g

i
n
t
o

b
i
t
0

o
f

C
R
C
_
H
I
G
H






















0
0
1
8
1

















































;

a
n
d

r
o
t
a
t
e

b
i
t
7

o
f

C
R
C
_
H
I
G
H

i
n
t
o

c
a
r
r
y






















0
0
1
8
2

















































;

f
l
a
g
0
0
4
B



0
7
0
3











0
0
1
8
3

















b
t
f
s
s



S
T
A
T
U
S
,

C















;

i
s

c
a
r
r
y

f
l
a
g

s
e
t
?
0
0
4
C



0
A
5
1











0
0
1
8
4

















g
o
t
o




N
e
x
t
B
i
t
E
n
g
i
n
e











;

c
a
r
r
y

f
l
a
g

i
s

c
l
e
a
r

t
h
e
r
e

n
e
x
t

r
o
t
a
t
i
o
n
0
0
4
D



0
C
8
0











0
0
1
8
5

















m
o
v
l
w



P
o
l
y
n
o
m
H
i
g
h













;

c
a
r
r
y

f
l
a
g

i
s

s
e
t

t
h
e
r
e
f
o
r
e

X
O
R

C
R
C
S
H
I
F
T






















0
0
1
8
6

















































;

r
e
g
i
s
t
e
r
s
0
0
4
E



0
1
A
7











0
0
1
8
7

















x
o
r
w
f



C
R
C
_
H
I
G
H
,

f













;

X
O
R

C
R
C
_
H
I
G
H

r
e
g
i
s
t
e
r
0
0
4
F



0
C
0
5











0
0
1
8
8

















m
o
v
l
w



P
o
l
y
n
o
m
L
o
w














;

l
o
a
d

w
-
r
e
g
i
s
t
e
r

w
i
t
h

l
o
w

b
y
t
e

o
f

p
o
l
y
n
o
m
0
0
5
0



0
1
A
8











0
0
1
8
9

















x
o
r
w
f



C
R
C
_
L
O
W
,

f














;

X
O
R

C
R
C
_
L
O
W

r
e
g
i
s
t
e
r
0
0
5
1



0
2
E
A











0
0
1
9
0

N
e
x
t
B
i
t
E
n
g
i
n
e



d
e
c
f
s
z


B
I
T
S
,

f

















;

d
o

f
o
r

a
l
l

b
i
t
s
0
0
5
2



0
A
4
7











0
0
1
9
1

















g
o
t
o




C
R
C
1
6
E
n
g
i
n
e













;

c
a
l
c
u
l
a
t
e

C
R
C

f
o
r

n
e
x
t

b
i
t
0
0
5
3



0
8
0
0











0
0
1
9
2

















r
e
t
l
w



0
x
0
0




















;

r
e
t
u
r
n

f
r
o
m

S
u
b
r
o
u
t
i
n
e






















0
0
1
9
3































0
0
1
9
4

















E
N
D
P
r
o
g
r
a
m

M
e
m
o
r
y

W
o
r
d
s

U
s
e
d
:




8
5
P
r
o
g
r
a
m

M
e
m
o
r
y

W
o
r
d
s

F
r
e
e
:



4
2
7
E
r
r
o
r
s



:





0
W
a
r
n
i
n
g
s

:





0

r
e
p
o
r
t
e
d
,





0

s
u
p
p
r
e
s
s
e
d
M
e
s
s
a
g
e
s

:





0

r
e
p
o
r
t
e
d
,





0

s
u
p
p
r
e
s
s
e
d
A
N
7
3
0
D
S
0
0
7
3
0
A
-
p
a
g
e

1
2
P
r
e
l
i
m
i
n
a
r
y


2
0
0
0

M
i
c
r
o
c
h
i
p

T
e
c
h
n
o
l
o
g
y

I
n
c
.
APPENDIX B: SOURCE CODE TABLE DRIVEN CRC IMPLEMENTATION
MPASM 02.30.11 Intermediate CRCTAB01.ASM 3-9-2000 13:02:59 PAGE 1
LOC OBJECT CODE LINE SOURCE TEXT
VALUE
00001 ; ***********************************************************************************************
00002 ; * Title : CRC16 calculation table driven implementation *
00003 ; * Author : Thomas Schmidt *
00004 ; * Date : 22.03.1999 *
00005 ; * Revision : 0.1 *
00006 ; * Last Modified : 15.04.1999 *
00007 ; * Core : 12-bit, 14-bit (12-bit core tested) *
00008 ; * Peripherals used: none *
00009 ; * Registers used : *
00010 ; * Modifications : crctab01.asm: first program CRC generation *
00011 ; * Description : *
00012 ; * *
00013 ; * This module calculates the checksum for the CRC16 polynom. The CRC16 polynome is defined *
00014 ; * as x16+x15+x2+x0. The calculation is done by bitwise checking. The algorithm is designed *
00015 ; * for a two byte wide message. The algorithm can easily be modified for longer messages. The *
00016 ; * only thing what has to be done is to check after the low byte is shifted into the high byte *
00017 ; * that the low byte is loaded with a new data byte. The number of iteration has to be adjusted*
00018 ; * to the number of extra bytes in the data message. The number is calculated as follows: *
00019 ; * n=16+x*messagebits. For example if the message is 4 bytes long the number of iterations is *
00020 ; * n=16+16bits. The extra iterations have to be done because the message is extended with 16 *
00021 ; * zeros at the end of the message. *
*
00022 ; ***********************************************************************************************
00023
00024 LIST P=16C58B, r=hex
00025
00026 #include p16c5x.inc
00001 LIST
00002 ; P16C5X.INC Standard Header File, Version 4.00 Microchip Technology, Inc.
00313 LIST
00027
00028 #define DataLength 0x09 ; length of data field
00029 #define LastTableElementHigh 0x2 ; last table element of high byte
00030 #define LastTableElementLow 0x2 ; last table element of low byte
00031
00032 cblock 0x07
00000007 00033 CRC_LOW ; low byte of CRC register
00000008 00034 CRC_HIGH ; high byte of CRC register
2000 Microchip Technology Inc. Preliminary DS00730A-page 13
AN730


0
0
0
0
0
0
0
9












0
0
0
3
5

























C
R
C
_
B
U
F
F








;

C
R
C

b
u
f
f
e
r

r
e
g
i
s
t
e
r


0
0
0
0
0
0
0
A












0
0
0
3
6

























D
A
T
A
B
Y
T
E
S







;

c
o
n
t
a
i
n
s

n
u
m
b
e
r

o
f

d
a
t
a

b
y
t
e
s


0
0
0
0
0
0
0
B












0
0
0
3
7

























T
E
M
P












;

t
e
m
p
o
r
a
r
y

r
e
g
i
s
t
e
r






















0
0
0
3
8

















e
n
d
c






















0
0
0
3
9









0
7
F
F


















0
0
0
4
0

















o
r
g

0
x
7
f
f
0
7
F
F



0
A
0
0











0
0
0
4
1

















g
o
t
o




B
e
g
i
n






















0
0
0
4
2

0
0
0
0


















0
0
0
4
3

















o
r
g

0
x
0
0
0
0
0
0


















0
0
0
4
4

B
e
g
i
n

























































0
0
0
4
5

















;

i
n
i
t
i
a
l
i
z
a
t
i
o
n

w
h
a
t

h
a
s

t
o

b
e

d
o
n
e

b
e
f
o
r
e

C
R
C
1
6

r
o
u
t
i
n
e

c
a
n

b
e






















0
0
0
4
6

















;

c
a
l
l
e
d
.

T
h
e

F
S
R

r
e
g
i
s
t
e
r

c
o
n
t
a
i
n
s

t
h
e

p
o
i
n
t
e
r

t
o

t
h
e

f
i
r
s
t

b
y
t
e

o
f






















0
0
0
4
7

















;

d
a
t
a

a
n
d

t
h
e

r
e
g
i
s
t
e
r

D
A
T
A
B
Y
T
E
S

c
o
n
t
a
i
n
s

t
h
e

n
u
m
b
e
r

o
f

d
a
t
a

b
y
t
e
s






















0
0
0
4
8

















;

o
f

t
h
e

m
e
s
s
a
g
e
.
0
0
0
0



0
C
1
0











0
0
0
4
9

















m
o
v
l
w



0
x
1
0




















;

s
e
t

p
o
i
n
t
e
r

t
o

f
i
r
s
t

d
a
t
a

l
o
c
a
t
i
o
n
0
0
0
1



0
0
2
4











0
0
0
5
0

















m
o
v
w
f



F
S
R





















;

i
n
i
t
i
a
l
i
z
e

F
S
R

r
e
g
i
s
t
e
r






















0
0
0
5
1

































































0
0
0
2



0
9
0
C











0
0
0
5
2

M
a
i
n












c
a
l
l




C
R
C
1
6
G
e
n
e
r
a
t
e











;

c
a
l
c
u
l
a
t
e

C
R
C
1
6

v
a
l
u
e






















0
0
0
5
3

0
0
0
3



0
2
0
8











0
0
0
5
4

















m
o
v
f




C
R
C
_
H
I
G
H
,

w













;

c
o
p
y

C
R
C
_
H
I
G
H

d
a
t
a

i
n
t
o

w
-
r
e
g
i
s
t
e
r
0
0
0
4



0
0
2
0











0
0
0
5
5

















m
o
v
w
f



I
N
D
F




















;

c
o
p
y

C
R
C
_
H
I
G
H

b
e
h
i
n
g

l
a
s
t

d
a
t
a

b
y
t
e
0
0
0
5



0
2
A
4











0
0
0
5
6

















i
n
c
f




F
S
R
,

f


















;

p
o
i
n
t

t
o

n
e
x
t

l
o
c
a
t
i
o
n
0
0
0
6



0
2
0
7











0
0
0
5
7

















m
o
v
f




C
R
C
_
L
O
W
,

w














;

c
o
p
y

C
R
C
_
L
O
W

d
a
t
a

i
n
t
o

w
-
r
e
g
i
s
t
e
r
0
0
0
7



0
0
2
0











0
0
0
5
8

















m
o
v
w
f



I
N
D
F




















;

c
o
p
y

d
a
t
a

i
n
t
o

n
e
x
t

l
o
c
a
t
i
o
n
0
0
0
8



0
C
1
0











0
0
0
5
9

















m
o
v
l
w



0
x
1
0




















;

s
e
t

p
o
i
n
t
e
r

t
o

f
i
r
s
t

d
a
t
a

l
o
c
a
t
i
o
n
0
0
0
9



0
0
2
4











0
0
0
6
0

















m
o
v
w
f



F
S
R





















;

i
n
i
t
i
a
l
i
z
e

F
S
R

r
e
g
i
s
t
e
r
0
0
0
A



0
9
3
A











0
0
0
6
1

T
e
s
t
P
o
i
n
t







c
a
l
l




C
R
C
1
6
R
e
s
t
o
r
e












;

R
e
s
t
o
r
e

C
R
C
0
0
0
B



0
A
0
B











0
0
0
6
2

S
t
o
p












g
o
t
o




S
t
o
p




















;

d
o

f
o
r
e
v
e
r






















0
0
0
6
3























0
0
0
6
4























0
0
0
6
5

















;

*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*






















0
0
0
6
6

















;

*

T
i
t
l
e
:














C
R
C
1
6

T
a
b
l
e

d
r
i
v
e
n

c
a
l
c
u
l
a
t
i
o
n


























*






















0
0
0
6
7

















;

*

I
n
p
u
t

p
a
r
a
m
e
t
e
r
:




P
o
i
n
t
e
r

t
o

f
i
r
s
t

d
a
t
a

b
y
t
e

(
p
o
i
n
t
e
r

i
n

F
S
R

r
e
g
i
s
t
e
r
)




*






















0
0
0
6
8

















;

*





















N
u
m
b
e
r

o
f

d
a
t
a

b
y
t
e
s

s
t
o
r
e
d

i
n

r
e
g
i
s
t
e
r

D
A
T
A
B
Y
T
E
S







*






















0
0
0
6
9

















;

*

O
u
t
p
u
t
:













C
R
C

r
e
s
u
l
t

s
t
o
r
e
d

i
n

C
R
C
_
H
I
G
H

a
n
d

C
R
C
_
L
O
W















*






















0
0
0
7
0

















;

*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
0
0
0
C



0
9
5
E











0
0
0
7
1

C
R
C
1
6
G
e
n
e
r
a
t
e



c
a
l
l




C
R
C
1
6
I
n
i
t















;

i
n
i
t
i
a
l
i
z
e

C
R
C

r
e
g
i
s
t
e
r
s
0
0
0
D



0
C
0
3











0
0
0
7
2

















m
o
v
l
w



0
x
0
3




















;

i
n
i
t
i
a
l
i
z
e

T
E
M
P

r
e
g
i
s
t
e
r
0
0
0
E



0
0
2
B











0
0
0
7
3

















m
o
v
w
f



T
E
M
P




















;

w
i
t
h

0
x
0
2






















0
0
0
7
4























0
0
0
7
5

















;

c
h
e
c
k

i
f

l
a
s
t

C
R
C
_
B
U
F
F

p
o
i
n
t
s

t
o

l
a
s
t

e
l
e
m
e
n
t

i
n

t
a
b
l
e
.

T
h
e
s
e

e
l
e
m
e
n
t
s






















0
0
0
7
6

















;

c
a
n
n
o
t

b
e

r
e
a
d

f
r
o
m

t
h
e

l
o
o
k

u
p

t
a
b
l
e
,

b
e
c
a
u
s
e

t
h
e
y

a
r
e

b
e
y
o
n
d

t
h
e






















0
0
0
7
7

















;

p
r
o
g
r
a
m

m
e
m
o
r
y

p
a
g
e
.
0
0
0
F



0
2
0
9











0
0
0
7
8

N
e
x
t
V
a
l
u
e
G
e
n




m
o
v
f




C
R
C
_
B
U
F
F
,

w













;

l
o
a
d

C
R
C
_
B
U
F
F

i
n
t
o

w
-
r
e
g
i
s
t
e
r
0
0
1
0



0
F
F
F











0
0
0
7
9

















x
o
r
l
w



0
x
f
f




















;

c
h
e
c
k

i
f

c
o
n
t
e
n
t

e
q
u
a
l
s

t
o

0
x
f
f
0
0
1
1



0
7
4
3











0
0
0
8
0

















b
t
f
s
s



S
T
A
T
U
S
,

Z















;

i
s

r
e
s
u
l
t

f
r
o
m

X
O
R

=

0
?
0
0
1
2



0
A
1
8











0
0
0
8
1

















g
o
t
o




C
a
l
c
u
l
a
t
e
C
R
C












;

n
o
,

c
a
l
c
u
l
a
t
e

C
R
C
AN730
DS00730A-page 14 Preliminary 2000 Microchip Technology Inc.
0
0
1
3



0
C
0
2











0
0
0
8
2

















m
o
v
l
w



L
a
s
t
T
a
b
l
e
E
l
e
m
e
n
t
H
i
g
h




;

y
e
s
,

g
e
t

l
a
s
t

t
a
b
l
e

e
l
e
m
e
n
t

f
o
r

h
i
g
h

b
y
t
e
0
0
1
4



0
1
A
8











0
0
0
8
3

















x
o
r
w
f



C
R
C
_
H
I
G
H
,

f













;

X
O
R

w
i
t
h

h
i
g
h

b
y
t
e
0
0
1
5



0
C
0
2











0
0
0
8
4

















m
o
v
l
w



L
a
s
t
T
a
b
l
e
E
l
e
m
e
n
t
L
o
w





;

g
e
t

l
a
s
t

t
a
b
l
e

e
l
e
m
e
n
t

f
o
r

l
o
w

b
y
t
e
0
0
1
6



0
1
A
7











0
0
0
8
5

















x
o
r
w
f



C
R
C
_
L
O
W
,

f














;

X
O
R

w
i
t
h

l
o
w

b
y
t
e
0
0
1
7



0
A
2
2











0
0
0
8
6

















g
o
t
o




D
e
c
D
A
T
A
B
Y
T
E
S












;

g
o
t
o

e
n
d

o
f

l
o
o
p






















0
0
0
8
7

















0
0
1
8



0
2
0
9











0
0
0
8
8

C
a
l
c
u
l
a
t
e
C
R
C




m
o
v
f




C
R
C
_
B
U
F
F
,

w













;

c
o
p
y

h
i
g
h

b
y
t
e

o
f

C
R
C

i
n
t
o

w
-
r
e
g
i
s
t
e
r
0
0
1
9



0
4
C
3











0
0
0
8
9

















b
c
f





S
T
A
T
U
S
,

P
A
1













;

s
e
l
e
c
t

p
a
g
e

1
0
0
1
A



0
5
A
3











0
0
0
9
0

















b
s
f





S
T
A
T
U
S
,

P
A
0













;

s
e
l
e
c
t

p
a
g
e

1
0
0
1
B



0
9
0
0











0
0
0
9
1

















c
a
l
l




C
R
C
1
6
T
a
b
l
e
H
i
g
h










;

g
e
t

v
a
l
u
e

f
o
r

h
i
g
h

b
y
t
e
0
0
1
C



0
1
A
8











0
0
0
9
2

















x
o
r
w
f



C
R
C
_
H
I
G
H
,
f














;

X
O
R

t
a
b
l
e

e
l
e
m
e
n
t

w
i
t
h

h
i
g
h

b
y
t
e
0
0
1
D



0
2
0
9











0
0
0
9
3

















m
o
v
f




C
R
C
_
B
U
F
F
,

w













;

g
e
t

v
a
l
u
e

f
o
r

l
o
w

b
y
t
e
0
0
1
E



0
5
C
3











0
0
0
9
4

















b
s
f





S
T
A
T
U
S
,

P
A
1













;

s
e
l
e
c
t

p
a
g
e

2
0
0
1
F



0
4
A
3











0
0
0
9
5

















b
c
f





S
T
A
T
U
S
,

P
A
0













;

s
e
l
e
c
t

p
a
g
e

2
0
0
2
0



0
9
0
0











0
0
0
9
6

















c
a
l
l




C
R
C
1
6
T
a
b
l
e
L
o
w











;

g
e
t

v
a
l
u
e

o
u
t

o
f

t
a
b
l
e
0
0
2
1



0
1
A
7











0
0
0
9
7

















x
o
r
w
f



C
R
C
_
L
O
W
,
f















;

X
O
R

w
i
t
h

l
o
w

b
y
t
e
0
0
2
2



0
4
A
3











0
0
0
9
8

D
e
c
D
A
T
A
B
Y
T
E
S




b
c
f





S
T
A
T
U
S
,

P
A
0













;

s
e
l
e
c
t

p
a
g
e

0
0
0
2
3



0
4
C
3











0
0
0
9
9

















b
c
f





S
T
A
T
U
S
,

P
A
1













;

s
e
l
e
c
t

p
a
g
e

0
0
0
2
4



0
2
E
A











0
0
1
0
0

















d
e
c
f
s
z


D
A
T
A
B
Y
T
E
S
,

f












;

d
e
c
r
e
m
e
n
t

d
a
t
a

b
y
t
e
s
0
0
2
5



0
A
3
0











0
0
1
0
1

















g
o
t
o




R
e
l
o
a
d
G
e
n















;

r
e
l
o
a
d

v
a
l
u
e
s






















0
0
1
0
2

















0
0
2
6



0
2
E
B











0
0
1
0
3

















d
e
c
f
s
z


T
E
M
P
,

f

















;

a
p
p
e
n
d

t
w
o

b
y
t
e
s

w
i
t
h

z
e
r
o
s
0
0
2
7



0
A
2
9











0
0
1
0
4

















g
o
t
o




A
p
p
e
n
d
Z
e
r
o
s













;

a
p
p
e
n
d

z
e
r
o
s

t
o

m
e
s
s
a
g
e

(
d
o

t
w
i
c
e
)
0
0
2
8



0
8
0
0











0
0
1
0
5

















r
e
t
l
w



0
x
0
0




















;

r
e
t
u
r
n

t
o

m
a
i
n
0
0
2
9



0
2
0
8











0
0
1
0
6

A
p
p
e
n
d
Z
e
r
o
s





m
o
v
f




C
R
C
_
H
I
G
H
,

w













;

c
o
p
y

h
i
g
h

b
y
t
e

i
n
t
o

w
-
r
e
g
i
s
t
e
r
0
0
2
A



0
0
2
9











0
0
1
0
7

















m
o
v
w
f



C
R
C
_
B
U
F
F
















;

a
n
d

f
r
o
m

t
h
e
r
e

t
o

C
R
C
_
B
U
F
F
0
0
2
B



0
2
0
7











0
0
1
0
8

















m
o
v
f




C
R
C
_
L
O
W
,
w















;

C
o
p
y

l
o
w

b
y
t
e

i
n
t
o

w
-
r
e
g
i
s
t
e
r
0
0
2
C



0
0
2
8











0
0
1
0
9

















m
o
v
w
f



C
R
C
_
H
I
G
H
















;

a
n
d

f
r
o
m

t
h
e
r
e

i
n
t
o

C
R
C
_
H
I
G
H
0
0
2
D



0
0
6
7











0
0
1
1
0

















c
l
r
f




C
R
C
_
L
O
W

















;

a
n
d

f
r
o
m

t
h
e
r
e

i
n
t
o

C
R
C
_
L
O
W
0
0
2
E



0
2
A
A











0
0
1
1
1

















i
n
c
f




D
A
T
A
B
Y
T
E
S
,

f












;

i
n
c
r
e
m
e
n
t

f
o
r

a
d
d
i
t
o
n
a
l

i
t
e
r
a
t
i
o
n
0
0
2
F



0
A
0
F











0
0
1
1
2

















g
o
t
o




N
e
x
t
V
a
l
u
e
G
e
n












;

c
a
l
c
u
l
a
t
e

C
R
C

f
o
r

n
e
x
t

b
y
t
e






















0
0
1
1
3

0
0
3
0



0
9
3
2











0
0
1
1
4

R
e
l
o
a
d
G
e
n







c
a
l
l




R
e
l
o
a
d


















;

r
e
l
o
a
d

r
e
g
i
s
t
e
r
s
0
0
3
1



0
A
0
F











0
0
1
1
5

















g
o
t
o




N
e
x
t
V
a
l
u
e
G
e
n












;

c
a
l
c
u
l
a
t
e

n
e
x
t

C
R
C

v
a
l
u
e






















0
0
1
1
6























0
0
1
1
7

















;

*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*






















0
0
1
1
8

















;

*

T
i
t
e
l
:

R
e
l
o
a
d

C
R
C
_
H
I
G
H
,

C
R
C
_
L
O
W

a
n
d

C
R
C
_
B
U
F
F

r
e
g
i
s
t
e
r























*






















0
0
1
1
9

















;

*

I
n
p
u
t
:

P
o
i
n
t
e
r

t
o

n
e
x
t

d
a
t
a

b
y
t
e

i
n

F
S
R

r
e
g
i
s
t
e
r




























*






















0
0
1
2
0

















;

*

O
u
t
p
u
t
:





































































*






















0
0
1
2
1

















;

*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
0
0
3
2



0
2
0
8











0
0
1
2
2

R
e
l
o
a
d










m
o
v
f




C
R
C
_
H
I
G
H
,

w













;

c
o
p
y

h
i
g
h

b
y
t
e

i
n
t
o

w
-
r
e
g
i
s
t
e
r
0
0
3
3



0
0
2
9











0
0
1
2
3

















m
o
v
w
f



C
R
C
_
B
U
F
F
















;

a
n
d

f
r
o
m

t
h
e
r
e

t
o

C
R
C
_
B
U
F
F
0
0
3
4



0
2
0
7











0
0
1
2
4

















m
o
v
f




C
R
C
_
L
O
W
,
w















;

C
o
p
y

l
o
w

b
y
t
e

i
n
t
o

w
-
r
e
g
i
s
t
e
r
0
0
3
5



0
0
2
8











0
0
1
2
5

















m
o
v
w
f



C
R
C
_
H
I
G
H
















;

a
n
d

f
r
o
m

t
h
e
r
e

i
n
t
o

C
R
C
_
H
I
G
H
0
0
3
6



0
2
0
0











0
0
1
2
6

















m
o
v
f




I
N
D
F
,

w

















;

c
o
p
y

n
e
x
t

d
a
t
a

i
n
t
o

w
-
r
e
g
i
s
t
e
r
0
0
3
7



0
0
2
7











0
0
1
2
7

















m
o
v
w
f



C
R
C
_
L
O
W

















;

a
n
d

f
r
o
m

t
h
e
r
e

i
n
t
o

C
R
C
_
L
O
W
0
0
3
8



0
2
A
4











0
0
1
2
8

















i
n
c
f




F
S
R
,

f


















;

p
o
i
n
t

t
o

n
e
x
t

d
a
t
a

b
y
t
e
2000 Microchip Technology Inc. Preliminary DS00730A-page 15
AN730
0
0
3
9



0
8
0
0











0
0
1
2
9

















r
e
t
l
w



0
x
0
0




















;

c
a
l
c
u
l
a
t
e

C
R
C

f
o
r

n
e
x
t

b
y
t
e






















0
0
1
3
0































0
0
1
3
1























0
0
1
3
2

















;

*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*






















0
0
1
3
3

















;

*

T
i
t
e
l
:

R
e
s
t
o
r
e

C
R
C

f
u
n
c
t
i
o
n

















































*






















0
0
1
3
4

















;

*

I
n
p
u
t
:

P
o
i
n
t
e
r

t
o

f
i
r
s
t

d
a
t
a

b
y
t
e

i
n

F
S
R

r
e
g
i
s
t
e
r



























*






















0
0
1
3
5

















;

*

O
u
t
p
u
t
:

w
=
0

C
R
C

w
a
s

r
e
s
t
o
r
e

s
u
c
e
s
s
f
u
l
l






































*






















0
0
1
3
6

















;

*









w
=
1

C
R
C

w
a
s

n
o
t

r
e
s
t
o
r
e
d

s
u
c
e
s
s
f
u
l
l

































*






















0
0
1
3
7

















;

*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*







0
0
3
A



0
9
5
E











0
0
1
3
8

C
R
C
1
6
R
e
s
t
o
r
e




c
a
l
l




C
R
C
1
6
I
n
i
t















;

i
n
i
t
i
a
l
i
z
e

C
R
C

r
e
g
i
s
t
e
r
s
0
0
3
B



0
C
0
2











0
0
1
3
9

















m
o
v
l
w



0
x
0
2




















;

a
d
d

t
w
o

o
n
t
o

0
0
3
C



0
1
E
A











0
0
1
4
0

















a
d
d
w
f



D
A
T
A
B
Y
T
E
S
,

f












;

r
e
g
i
s
t
e
r

D
A
T
A
B
Y
T
E
S






















0
0
1
4
1























0
0
1
4
2

















;

c
h
e
c
k

i
f

l
a
s
t

C
R
C
_
B
U
F
F

p
o
i
n
t
s

t
o

l
a
s
t

e
l
e
m
e
n
t

i
n

t
a
b
l
e
.

T
h
e
s
e

e
l
e
m
e
n
t
s






















0
0
1
4
3

















;

c
a
n
n
o
t

b
e

r
e
a
d

f
r
o
m

t
h
e

l
o
o
k

u
p

t
a
b
l
e
,

b
e
c
a
u
s
e

t
h
e
y

a
r
e

b
e
y
o
n
d

t
h
e






















0
0
1
4
4

















;

p
r
o
g
r
a
m

m
e
m
o
r
y

p
a
g
e
.
0
0
3
D



0
2
0
9











0
0
1
4
5

N
e
x
t
V
a
l
u
e
R
e
s




m
o
v
f




C
R
C
_
B
U
F
F
,

w













;

l
o
a
d

C
R
C
_
B
U
F
F

i
n
t
o

w
-
r
e
g
i
s
t
e
r
0
0
3
E



0
F
F
F











0
0
1
4
6

















x
o
r
l
w



0
x
f
f




















;

c
h
e
c
k

i
f

c
o
n
t
e
n
t

e
q
u
a
l
s

t
o

0
x
f
f
0
0
3
F



0
7
4
3











0
0
1
4
7

















b
t
f
s
s



S
T
A
T
U
S
,

Z















;

i
s

r
e
s
u
l
t

f
r
o
m

X
O
R

=

0
?
0
0
4
0



0
A
4
6











0
0
1
4
8

















g
o
t
o




C
a
l
c
u
l
a
t
e
C
R
C
R
e
s









;

n
o
,

c
a
l
c
u
l
a
t
e

C
R
C
0
0
4
1



0
C
0
2











0
0
1
4
9

















m
o
v
l
w



L
a
s
t
T
a
b
l
e
E
l
e
m
e
n
t
H
i
g
h




;

y
e
s
,

g
e
t

l
a
s
t

t
a
b
l
e

e
l
e
m
e
n
t

f
o
r

h
i
g
h

b
y
t
e
0
0
4
2



0
1
A
8











0
0
1
5
0

















x
o
r
w
f



C
R
C
_
H
I
G
H
,

f













;

X
O
R

w
i
t
h

h
i
g
h

b
y
t
e
0
0
4
3



0
C
0
2











0
0
1
5
1

















m
o
v
l
w



L
a
s
t
T
a
b
l
e
E
l
e
m
e
n
t
L
o
w





;

g
e
t

l
a
s
t

t
a
b
l
e

e
l
e
m
e
n
t

f
o
r

l
o
w

b
y
t
e
0
0
4
4



0
1
A
7











0
0
1
5
2

















x
o
r
w
f



C
R
C
_
L
O
W
,

f














;

X
O
R

w
i
t
h

l
o
w

b
y
t
e
0
0
4
5



0
A
5
0











0
0
1
5
3

















g
o
t
o




D
e
c
D
A
T
A
B
Y
T
E
S
R
e
s









;

g
o
t
o

e
n
d

o
f

l
o
o
p






















0
0
1
5
4

















0
0
4
6



0
2
0
9











0
0
1
5
5

C
a
l
c
u
l
a
t
e
C
R
C
R
e
s

m
o
v
f




C
R
C
_
B
U
F
F
,

w













;

c
o
p
y

h
i
g
h

b
y
t
e

o
f

C
R
C

i
n
t
o

w
-
r
e
g
i
s
t
e
r
0
0
4
7



0
4
C
3











0
0
1
5
6

















b
c
f





S
T
A
T
U
S
,

P
A
1













;

s
e
l
e
c
t

p
a
g
e

1
0
0
4
8



0
5
A
3











0
0
1
5
7

















b
s
f





S
T
A
T
U
S
,

P
A
0













;

s
e
l
e
c
t

p
a
g
e

1
0
0
4
9



0
9
0
0











0
0
1
5
8

















c
a
l
l




C
R
C
1
6
T
a
b
l
e
H
i
g
h










;

g
e
t

v
a
l
u
e

f
o
r

h
i
g
h

b
y
t
e
0
0
4
A



0
1
A
8











0
0
1
5
9

















x
o
r
w
f



C
R
C
_
H
I
G
H
,
f














;

X
O
R

t
a
b
l
e

e
l
e
m
e
n
t

w
i
t
h

h
i
g
h

b
y
t
e
0
0
4
B



0
2
0
9











0
0
1
6
0

















m
o
v
f




C
R
C
_
B
U
F
F
,

w













;

g
e
t

v
a
l
u
e

f
o
r

l
o
w

b
y
t
e
0
0
4
C



0
5
C
3











0
0
1
6
1

















b
s
f





S
T
A
T
U
S
,

P
A
1













;

s
e
l
e
c
t

p
a
g
e

2
0
0
4
D



0
4
A
3











0
0
1
6
2

















b
c
f





S
T
A
T
U
S
,

P
A
0













;

s
e
l
e
c
t

p
a
g
e

2
0
0
4
E



0
9
0
0











0
0
1
6
3

















c
a
l
l




C
R
C
1
6
T
a
b
l
e
L
o
w











;

g
e
t

v
a
l
u
e

o
u
t

o
f

t
a
b
l
e
0
0
4
F



0
1
A
7











0
0
1
6
4

















x
o
r
w
f



C
R
C
_
L
O
W
,
f















;

X
O
R

w
i
t
h

l
o
w

b
y
t
e
0
0
5
0



0
4
A
3











0
0
1
6
5

D
e
c
D
A
T
A
B
Y
T
E
S
R
e
s

b
c
f





S
T
A
T
U
S
,

P
A
0













;

s
e
l
e
c
t

p
a
g
e

0
0
0
5
1



0
4
C
3











0
0
1
6
6

















b
c
f





S
T
A
T
U
S
,

P
A
1













;

s
e
l
e
c
t

p
a
g
e

0
0
0
5
2



0
2
E
A











0
0
1
6
7

















d
e
c
f
s
z


D
A
T
A
B
Y
T
E
S
,

f












;

d
e
c
r
e
m
e
n
t

d
a
t
a

b
y
t
e
s
0
0
5
3



0
A
5
C











0
0
1
6
8

















g
o
t
o




R
e
l
o
a
d
R
e
s















;

c
a
l
c
u
l
a
t
e

n
e
x
t

C
R
C
1
6

v
a
l
u
e






















0
0
1
6
9







































0
0
1
7
0

















;

c
h
e
c
k

i
f

C
R
C
_
H
I
G
H

a
n
d

C
R
C
_
L
O
W

e
q
u
a
l

t
o

z
e
r
o
0
0
5
4



0
2
2
8











0
0
1
7
1

















m
o
v
f




C
R
C
_
H
I
G
H
,

f













;

c
o
p
y

C
R
C
_
H
I
G
H

o
n
t
o

i
t
s
e
l
f
0
0
5
5



0
7
4
3











0
0
1
7
2

















b
t
f
s
s



S
T
A
T
U
S
,

Z















;

i
s

c
o
n
t
e
n
t

z
e
r
o
?
0
0
5
6



0
A
5
B











0
0
1
7
3

















g
o
t
o




C
R
C
E
r
r
o
r
















;

n
o
,

C
R
C

e
r
r
o
r

o
c
c
u
r
e
d
0
0
5
7



0
2
2
7











0
0
1
7
4

















m
o
v
f




C
R
C
_
L
O
W
,

f














;

c
o
p
y

C
R
C
_
L
O
W

r
e
g
i
s
t
e
r

o
n
t
o

i
t
s
e
l
f
0
0
5
8



0
7
4
3











0
0
1
7
5

















b
t
f
s
s



S
T
A
T
U
S
,

Z















;

i
s

c
o
n
t
e
n
t

z
e
r
o
?
AN730
DS00730A-page 16 Preliminary 2000 Microchip Technology Inc.
0
0
5
9



0
A
5
B











0
0
1
7
6

















g
o
t
o




C
R
C
E
r
r
o
r
















;

n
o
,

C
R
C

e
r
r
o
r

o
c
c
u
r
e
d
0
0
5
A



0
8
0
0











0
0
1
7
7

















r
e
t
l
w



0
x
0
0




















;

r
e
t
u
r
n

t
o

m
a
i
n

(
0
=

n
o

e
r
r
o
r
)






















0
0
1
7
8

0
0
5
B



0
8
0
1











0
0
1
7
9

C
R
C
E
r
r
o
r








r
e
t
l
w



0
x
0
1




















;

r
e
t
u
r
n

t
o

m
a
i
n

w
i
t
h

e
r
r
o
r

c
o
d
e

1






















0
0
1
8
0

0
0
5
C



0
9
3
2











0
0
1
8
1

R
e
l
o
a
d
R
e
s







c
a
l
l




R
e
l
o
a
d


















;

r
e
l
o
a
d

r
e
g
i
s
t
e
r
0
0
5
D



0
A
3
D











0
0
1
8
2

















g
o
t
o




N
e
x
t
V
a
l
u
e
R
e
s












;

c
a
l
c
u
l
a
t
e

n
e
x
t

v
a
l
u
e






















0
0
1
8
3







































0
0
1
8
4























0
0
1
8
5

















;

*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*






















0
0
1
8
6

















;

*

T
i
t
e
l
:

C
R
C
1
6

I
n
i
t
i
a
l
i
z
a
t
i
o
n

















































*






















0
0
1
8
7

















;

*

I
n
p
u
t
:

P
o
i
n
t
e
r

t
o

f
i
r
s
t

d
a
t
a

b
y
t
e

i
n

F
S
R

r
e
g
i
s
t
e
r



























*






















0
0
1
8
8

















;

*

O
u
t
p
u
t
:

n
o
n
e
































































*






















0
0
1
8
9

















;

*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
0
0
5
E



0
2
0
0











0
0
1
9
0

C
R
C
1
6
I
n
i
t







m
o
v
f




I
N
D
F
,

w

















;

c
o
p
y

d
a
t
a

i
n
t
o

W
-
r
e
g
i
s
t
e
r
0
0
5
F



0
0
2
9











0
0
1
9
1

















m
o
v
w
f



C
R
C
_
B
U
F
F
















;

c
o
p
y

w
-
r
e
g
i
s
t
e
r

i
n
t
o

C
R
C
_
B
U
F
F

r
e
g
i
s
t
e
r
0
0
6
0



0
2
A
4











0
0
1
9
2

















i
n
c
f




F
S
R
,

f


















;

s
e
t

p
o
i
n
t
e
r

t
o

n
e
x
t

l
o
c
a
t
i
o
n
0
0
6
1



0
2
0
0











0
0
1
9
3

















m
o
v
f




I
N
D
F
,

w

















;

c
o
p
y

d
a
t
a

i
n
t
o

W
-
r
e
g
i
s
t
e
r
0
0
6
2



0
0
2
8











0
0
1
9
4

















m
o
v
w
f



C
R
C
_
H
I
G
H
















;

c
o
p
y

w
-
r
e
g
i
s
t
e
r

i
n
t
o

C
R
C
_
H
I
G
H

r
e
g
i
s
t
e
r
0
0
6
3



0
2
A
4











0
0
1
9
5

















i
n
c
f




F
S
R
,

f


















;

s
e
t

p
o
i
n
t
e
r

t
o

n
e
x
t

l
o
c
a
t
i
o
n
0
0
6
4



0
2
0
0











0
0
1
9
6

















m
o
v
f




I
N
D
F
,

w

















;

c
o
p
y

d
a
t
a

i
n
t
o

w
-
r
e
g
i
s
t
e
r
0
0
6
5



0
0
2
7











0
0
1
9
7

















m
o
v
w
f



C
R
C
_
L
O
W

















;

c
o
p
y

w
-
r
e
g
i
s
t
e
r

i
n
t
o

C
R
C
_
L
O
W
0
0
6
6



0
2
A
4











0
0
1
9
8

















i
n
c
f




F
S
R
,

f


















;

p
o
i
n
t

t
o

n
e
x
t

l
o
c
a
t
i
o
n
0
0
6
7



0
C
0
9











0
0
1
9
9

















m
o
v
l
w



D
a
t
a
L
e
n
g
t
h














;

c
o
p
y

n
u
m
b
e
r

o
f

d
a
t
a

b
y
t
e
s
0
0
6
8



0
0
2
A











0
0
2
0
0

















m
o
v
w
f



D
A
T
A
B
Y
T
E
S















;

i
n
t
o

r
e
g
i
s
t
e
r

D
a
t
a
B
y
t
e
s
0
0
6
9



0
C
0
3











0
0
2
0
1

















m
o
v
l
w



0
x
0
3




















;

d
e
c
r
e
m
e
n
t

t
h
r
e
e

f
r
o
m

t
h
e

n
u
m
b
e
r
0
0
6
A



0
0
A
A











0
0
2
0
2

















s
u
b
w
f



D
A
T
A
B
Y
T
E
S
,

f












;

o
f

d
a
t
a

b
y
t
e
s
,

b
e
c
a
u
s
e

t
h
r
e
e

r
e
g
i
s
t
e
r






















0
0
2
0
3

















































;

a
r
e

n
o
w

i
n
i
t
i
a
l
i
z
e
d
0
0
6
B



0
8
0
0











0
0
2
0
4

















r
e
t
l
w



0
x
0
0




















;

r
e
t
u
r
n

f
r
o
m

s
u
b
r
o
u
t
i
n
e






















0
0
2
0
5























0
0
2
0
6

















;

*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*






















0
0
2
0
7

















;

*

T
i
t
e
l
:

C
R
C
1
6

T
a
b
l
e

f
o
r

H
i
g
h

b
y
t
e












































*






















0
0
2
0
8

















;

*

I
n
p
u
t
:

P
o
i
n
t
e
r

t
o

t
a
b
l
e

e
l
e
m
e
n
t

i
n

w
-
r
e
g
i
s
t
e
r































*






















0
0
2
0
9

















;

*

O
u
t
p
u
t
:

l
o
o
k
-
u
p

v
a
l
u
e

i
n

w
-
r
e
g
i
s
t
e
r









































*






















0
0
2
1
0

















;

*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
0
2
0
0


















0
0
2
1
1

















o
r
g

0
x
2
0
0
0
2
0
0



0
1
E
2











0
0
2
1
2

C
R
C
1
6
T
a
b
l
e
H
i
g
h


a
d
d
w
f



P
C
L
,

f










;

a
d
d

t
o

l
o
w

b
y
t
e

o
f

P
C
0
2
0
1



0
8
0
0

0
8
8
0

0
8
8
0

0
0
2
1
3


















d
t





0
,






0
x
8
0
,



0
x
8
0
,



0














0
8
0
0

0
2
0
5



0
8
8
0

0
8
0
0

0
8
0
0

0
0
2
1
4


















d
t





0
x
8
0
,



0
,






0
,






0
x
8
0











0
8
8
0

0
2
0
9



0
8
8
0

0
8
0
0

0
8
0
0

0
0
2
1
5


















d
t





0
x
8
0
,



0
,






0
,






0
x
8
0











0
8
8
0

0
2
0
D



0
8
0
0

0
8
8
0

0
8
8
0

0
0
2
1
6


















d
t





0
,






0
x
8
0
,



0
x
8
0
,



0














0
8
0
0

0
2
1
1



0
8
8
0

0
8
0
0

0
8
0
0

0
0
2
1
7


















d
t





0
x
8
0
,



0
,






0
,






0
x
8
0











0
8
8
0

2000 Microchip Technology Inc. Preliminary DS00730A-page 17
AN730
0
2
1
5



0
8
0
0

0
8
8
0

0
8
8
0

0
0
2
1
8


















d
t





0
,






0
x
8
0
,



0
x
8
0
,



0














0
8
0
0

0
2
1
9



0
8
0
0

0
8
8
0

0
8
8
0

0
0
2
1
9


















d
t





0
,






0
x
8
0
,



0
x
8
0
,



0














0
8
0
0

0
2
1
D



0
8
8
0

0
8
0
0

0
8
0
0

0
0
2
2
0


















d
t





0
x
8
0
,



0
,






0
,






0
x
8
0











0
8
8
0

0
2
2
1



0
8
8
0

0
8
0
0

0
8
0
0

0
0
2
2
1


















d
t





0
x
8
0
,



0
,






0
,






0
x
8
0











0
8
8
0

0
2
2
5



0
8
0
0

0
8
8
0

0
8
8
0

0
0
2
2
2


















d
t





0
,






0
x
8
0
,



0
x
8
0
,



0














0
8
0
0

0
2
2
9



0
8
0
0

0
8
8
0

0
8
8
0

0
0
2
2
3


















d
t





0
,






0
x
8
0
,



0
x
8
0
,



0














0
8
0
0

0
2
2
D



0
8
8
0

0
8
0
0

0
8
0
0

0
0
2
2
4


















d
t





0
x
8
0
,



0
,






0
,






0
x
8
0











0
8
8
0

0
2
3
1



0
8
0
0

0
8
8
0

0
8
8
0

0
0
2
2
5


















d
t





0
,






0
x
8
0
,



0
x
8
0
,



0














0
8
0
0

0
2
3
5



0
8
8
0

0
8
0
0

0
8
0
0

0
0
2
2
6


















d
t





0
x
8
0
,



0
,






0
,






0
x
8
0











0
8
8
0

0
2
3
9



0
8
8
0

0
8
0
0

0
8
0
0

0
0
2
2
7


















d
t





0
x
8
0
,



0
,






0
,






0
x
8
0











0
8
8
0

0
2
3
D



0
8
0
0

0
8
8
0

0
8
8
0

0
0
2
2
8


















d
t





0
,






0
x
8
0
,



0
x
8
0
,



0














0
8
0
0

0
2
4
1



0
8
8
1

0
8
0
1

0
8
0
1

0
0
2
2
9


















d
t





0
x
8
1
,



0
x
1
,




0
x
1
,




0
x
8
1











0
8
8
1

0
2
4
5



0
8
0
1

0
8
8
1

0
8
8
1

0
0
2
3
0


















d
t





0
x
1
,




0
x
8
1
,



0
x
8
1
,



0
x
1












0
8
0
1

0
2
4
9



0
8
0
1

0
8
8
1

0
8
8
1

0
0
2
3
1


















d
t





0
x
1
,




0
x
8
1
,



0
x
8
1
,



0
x
1












0
8
0
1

0
2
4
D



0
8
8
1

0
8
0
1

0
8
0
1

0
0
2
3
2


















d
t





0
x
8
1
,



0
x
1
,




0
x
1
,




0
x
8
1











0
8
8
1

0
2
5
1



0
8
0
1

0
8
8
1

0
8
8
1

0
0
2
3
3


















d
t





0
x
1
,




0
x
8
1
,



0
x
8
1
,



0
x
1












0
8
0
1

0
2
5
5



0
8
8
1

0
8
0
1

0
8
0
1

0
0
2
3
4


















d
t





0
x
8
1
,



0
x
1
,




0
x
1
,




0
x
8
1











0
8
8
1

0
2
5
9



0
8
8
1

0
8
0
1

0
8
0
1

0
0
2
3
5


















d
t





0
x
8
1
,



0
x
1
,




0
x
1
,




0
x
8
1











0
8
8
1

0
2
5
D



0
8
0
1

0
8
8
1

0
8
8
1

0
0
2
3
6


















d
t





0
x
1
,




0
x
8
1
,



0
x
8
1
,



0
x
1












0
8
0
1

0
2
6
1



0
8
0
1

0
8
8
1

0
8
8
1

0
0
2
3
7


















d
t





0
x
1
,




0
x
8
1
,



0
x
8
1
,



0
x
1












0
8
0
1

0
2
6
5



0
8
8
1

0
8
0
1

0
8
0
1

0
0
2
3
8


















d
t





0
x
8
1
,



0
x
1
,




0
x
1
,




0
x
8
1











0
8
8
1

0
2
6
9



0
8
8
1

0
8
0
1

0
8
0
1

0
0
2
3
9


















d
t





0
x
8
1
,



0
x
1
,




0
x
1
,




0
x
8
1











0
8
8
1

0
2
6
D



0
8
0
1

0
8
8
1

0
8
8
1

0
0
2
4
0


















d
t





0
x
1
,




0
x
8
1
,



0
x
8
1
,



0
x
1












0
8
0
1

0
2
7
1



0
8
8
1

0
8
0
1

0
8
0
1

0
0
2
4
1


















d
t





0
x
8
1
,



0
x
1
,




0
x
1
,




0
x
8
1




AN730
DS00730A-page 18 Preliminary 2000 Microchip Technology Inc.







0
8
8
1

0
2
7
5



0
8
0
1

0
8
8
1

0
8
8
1

0
0
2
4
2


















d
t





0
x
1
,




0
x
8
1
,



0
x
8
1
,



0
x
1












0
8
0
1

0
2
7
9



0
8
0
1

0
8
8
1

0
8
8
1

0
0
2
4
3


















d
t





0
x
1
,




0
x
8
1
,



0
x
8
1
,



0
x
1












0
8
0
1

0
2
7
D



0
8
8
1

0
8
0
1

0
8
0
1

0
0
2
4
4


















d
t





0
x
8
1
,



0
x
1
,




0
x
1
,




0
x
8
1











0
8
8
1

0
2
8
1



0
8
8
3

0
8
0
3

0
8
0
3

0
0
2
4
5


















d
t





0
x
8
3
,



0
x
3
,




0
x
3
,




0
x
8
3











0
8
8
3

0
2
8
5



0
8
0
3

0
8
8
3

0
8
8
3

0
0
2
4
6


















d
t





0
x
3
,




0
x
8
3
,



0
x
8
3
,



0
x
3












0
8
0
3

0
2
8
9



0
8
0
3

0
8
8
3

0
8
8
3

0
0
2
4
7


















d
t





0
x
3
,




0
x
8
3
,



0
x
8
3
,



0
x
3












0
8
0
3

0
2
8
D



0
8
8
3

0
8
0
3

0
8
0
3

0
0
2
4
8


















d
t





0
x
8
3
,



0
x
3
,




0
x
3
,




0
x
8
3











0
8
8
3

0
2
9
1



0
8
0
3

0
8
8
3

0
8
8
3

0
0
2
4
9


















d
t





0
x
3
,




0
x
8
3
,



0
x
8
3
,



0
x
3












0
8
0
3

0
2
9
5



0
8
8
3

0
8
0
3

0
8
0
3

0
0
2
5
0


















d
t





0
x
8
3
,



0
x
3
,




0
x
3
,




0
x
8
3











0
8
8
3

0
2
9
9



0
8
8
3

0
8
0
3

0
8
0
3

0
0
2
5
1


















d
t





0
x
8
3
,



0
x
3
,




0
x
3
,




0
x
8
3











0
8
8
3

0
2
9
D



0
8
0
3

0
8
8
3

0
8
8
3

0
0
2
5
2


















d
t





0
x
3
,




0
x
8
3
,



0
x
8
3
,



0
x
3












0
8
0
3

0
2
A
1



0
8
0
3

0
8
8
3

0
8
8
3

0
0
2
5
3


















d
t





0
x
3
,




0
x
8
3
,



0
x
8
3
,



0
x
3












0
8
0
3

0
2
A
5



0
8
8
3

0
8
0
3

0
8
0
3

0
0
2
5
4


















d
t





0
x
8
3
,



0
x
3
,




0
x
3
,




0
x
8
3











0
8
8
3

0
2
A
9



0
8
8
3

0
8
0
3

0
8
0
3

0
0
2
5
5


















d
t





0
x
8
3
,



0
x
3
,




0
x
3
,




0
x
8
3











0
8
8
3

0
2
A
D



0
8
0
3

0
8
8
3

0
8
8
3

0
0
2
5
6


















d
t





0
x
3
,




0
x
8
3
,



0
x
8
3
,



0
x
3












0
8
0
3

0
2
B
1



0
8
8
3

0
8
0
3

0
8
0
3

0
0
2
5
7


















d
t





0
x
8
3
,



0
x
3
,




0
x
3
,




0
x
8
3











0
8
8
3

0
2
B
5



0
8
0
3

0
8
8
3

0
8
8
3

0
0
2
5
8


















d
t





0
x
3
,




0
x
8
3
,



0
x
8
3
,



0
x
3












0
8
0
3

0
2
B
9



0
8
0
3

0
8
8
3

0
8
8
3

0
0
2
5
9


















d
t





0
x
3
,




0
x
8
3
,



0
x
8
3
,



0
x
3












0
8
0
3

0
2
B
D



0
8
8
3

0
8
0
3

0
8
0
3

0
0
2
6
0


















d
t





0
x
8
3
,



0
x
3
,




0
x
3
,




0
x
8
3











0
8
8
3

0
2
C
1



0
8
0
2

0
8
8
2

0
8
8
2

0
0
2
6
1


















d
t





0
x
2
,




0
x
8
2
,



0
x
8
2
,



0
x
2












0
8
0
2

0
2
C
5



0
8
8
2

0
8
0
2

0
8
0
2

0
0
2
6
2


















d
t





0
x
8
2
,



0
x
2
,




0
x
2
,




0
x
8
2











0
8
8
2

0
2
C
9



0
8
8
2

0
8
0
2

0
8
0
2

0
0
2
6
3


















d
t





0
x
8
2
,



0
x
2
,




0
x
2
,




0
x
8
2











0
8
8
2

0
2
C
D



0
8
0
2

0
8
8
2

0
8
8
2

0
0
2
6
4


















d
t





0
x
2
,




0
x
8
2
,



0
x
8
2
,



0
x
2












0
8
0
2

2000 Microchip Technology Inc. Preliminary DS00730A-page 19
AN730
0
2
D
1



0
8
8
2

0
8
0
2

0
8
0
2

0
0
2
6
5


















d
t





0
x
8
2
,



0
x
2
,




0
x
2
,




0
x
8
2











0
8
8
2

0
2
D
5



0
8
0
2

0
8
8
2

0
8
8
2

0
0
2
6
6


















d
t





0
x
2
,




0
x
8
2
,



0
x
8
2
,



0
x
2












0
8
0
2

0
2
D
9



0
8
0
2

0
8
8
2

0
8
8
2

0
0
2
6
7


















d
t





0
x
2
,




0
x
8
2
,



0
x
8
2
,



0
x
2












0
8
0
2

0
2
D
D



0
8
8
2

0
8
0
2

0
8
0
2

0
0
2
6
8


















d
t





0
x
8
2
,



0
x
2
,




0
x
2
,




0
x
8
2











0
8
8
2

0
2
E
1



0
8
8
2

0
8
0
2

0
8
0
2

0
0
2
6
9


















d
t





0
x
8
2
,



0
x
2
,




0
x
2
,




0
x
8
2











0
8
8
2

0
2
E
5



0
8
0
2

0
8
8
2

0
8
8
2

0
0
2
7
0


















d
t





0
x
2
,




0
x
8
2
,



0
x
8
2
,



0
x
2












0
8
0
2

0
2
E
9



0
8
0
2

0
8
8
2

0
8
8
2

0
0
2
7
1


















d
t





0
x
2
,




0
x
8
2
,



0
x
8
2
,



0
x
2












0
8
0
2

0
2
E
D



0
8
8
2

0
8
0
2

0
8
0
2

0
0
2
7
2


















d
t





0
x
8
2
,



0
x
2
,




0
x
2
,




0
x
8
2











0
8
8
2

0
2
F
1



0
8
0
2

0
8
8
2

0
8
8
2

0
0
2
7
3


















d
t





0
x
2
,




0
x
8
2
,



0
x
8
2
,



0
x
2












0
8
0
2

0
2
F
5



0
8
8
2

0
8
0
2

0
8
0
2

0
0
2
7
4


















d
t





0
x
8
2
,



0
x
2
,




0
x
2
,




0
x
8
2











0
8
8
2

0
2
F
9



0
8
8
2

0
8
0
2

0
8
0
2

0
0
2
7
5


















d
t





0
x
8
2
,



0
x
2
,




0
x
2
,




0
x
8
2











0
8
8
2

0
2
F
D



0
8
0
2

0
8
8
2

0
8
8
2

0
0
2
7
6


















d
t





0
x
2
,




0
x
8
2
,



0
x
8
2


























0
0
2
7
7























0
0
2
7
8

















;

*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*






















0
0
2
7
9

















;

*

T
i
t
e
l
:

C
R
C
1
6

T
a
b
l
e

f
o
r

l
o
w

b
y
t
e













































*






















0
0
2
8
0

















;

*

I
n
p
u
t
:

P
o
i
n
t
e
r

t
o

t
a
b
l
e

e
l
e
m
e
n
t

i
n

w
-
r
e
g
i
s
t
e
r































*






















0
0
2
8
1

















;

*

O
u
t
p
u
t
:

l
o
o
k
-
u
p

v
a
l
u
e

i
n

w
-
r
e
g
i
s
t
e
r









































*






















0
0
2
8
2

















;

*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
0
4
0
0


















0
0
2
8
3

















o
r
g

0
x
4
0
0
0
4
0
0



0
1
E
2











0
0
2
8
4

C
R
C
1
6
T
a
b
l
e
L
o
w



a
d
d
w
f



P
C
L
,

f










;

a
d
d

t
o

l
o
w

b
y
t
e

o
f

P
C
0
4
0
1



0
8
0
0

0
8
0
5

0
8
0
F

0
0
2
8
5


















d
t





0
,






0
x
5
,




0
x
f
,




0
x
a












0
8
0
A

0
4
0
5



0
8
1
B

0
8
1
E

0
8
1
4

0
0
2
8
6


















d
t





0
x
1
b
,



0
x
1
e
,



0
x
1
4
,



0
x
1
1











0
8
1
1

0
4
0
9



0
8
3
3

0
8
3
6

0
8
3
C

0
0
2
8
7


















d
t





0
x
3
3
,



0
x
3
6
,



0
x
3
c
,



0
x
3
9











0
8
3
9

0
4
0
D



0
8
2
8

0
8
2
D

0
8
2
7

0
0
2
8
8


















d
t





0
x
2
8
,



0
x
2
d
,



0
x
2
7
,



0
x
2
2











0
8
2
2

0
4
1
1



0
8
6
3

0
8
6
6

0
8
6
C

0
0
2
8
9


















d
t





0
x
6
3
,



0
x
6
6
,



0
x
6
c
,



0
x
6
9











0
8
6
9

0
4
1
5



0
8
7
8

0
8
7
D

0
8
7
7

0
0
2
9
0


















d
t





0
x
7
8
,



0
x
7
d
,



0
x
7
7
,



0
x
7
2











0
8
7
2

0
4
1
9



0
8
5
0

0
8
5
5

0
8
5
F

0
0
2
9
1


















d
t





0
x
5
0
,



0
x
5
5
,



0
x
5
f
,



0
x
5
a











0
8
5
A

0
4
1
D



0
8
4
B

0
8
4
E

0
8
4
4

0
0
2
9
2


















d
t





0
x
4
b
,



0
x
4
e
,



0
x
4
4
,



0
x
4
1




AN730
DS00730A-page 20 Preliminary 2000 Microchip Technology Inc.







0
8
4
1

0
4
2
1



0
8
C
3

0
8
C
6

0
8
C
C

0
0
2
9
3


















d
t





0
x
c
3
,



0
x
c
6
,



0
x
c
c
,



0
x
c
9











0
8
C
9

0
4
2
5



0
8
D
8

0
8
D
D

0
8
D
7

0
0
2
9
4


















d
t





0
x
d
8
,



0
x
d
d
,



0
x
d
7
,



0
x
d
2











0
8
D
2

0
4
2
9



0
8
F
0

0
8
F
5

0
8
F
F

0
0
2
9
5


















d
t





0
x
f
0
,



0
x
f
5
,



0
x
f
f
,



0
x
f
a











0
8
F
A

0
4
2
D



0
8
E
B

0
8
E
E

0
8
E
4

0
0
2
9
6


















d
t





0
x
e
b
,



0
x
e
e
,



0
x
e
4
,



0
x
e
1











0
8
E
1

0
4
3
1



0
8
A
0

0
8
A
5

0
8
A
F

0
0
2
9
7


















d
t





0
x
a
0
,



0
x
a
5
,



0
x
a
f
,



0
x
a
a











0
8
A
A

0
4
3
5



0
8
B
B

0
8
B
E

0
8
B
4

0
0
2
9
8


















d
t





0
x
b
b
,



0
x
b
e
,



0
x
b
4
,



0
x
b
1











0
8
B
1

0
4
3
9



0
8
9
3

0
8
9
6

0
8
9
C

0
0
2
9
9


















d
t





0
x
9
3
,



0
x
9
6
,



0
x
9
c
,



0
x
9
9











0
8
9
9

0
4
3
D



0
8
8
8

0
8
8
D

0
8
8
7

0
0
3
0
0


















d
t





0
x
8
8
,



0
x
8
d
,



0
x
8
7
,



0
x
8
2











0
8
8
2

0
4
4
1



0
8
8
3

0
8
8
6

0
8
8
C

0
0
3
0
1


















d
t





0
x
8
3
,



0
x
8
6
,



0
x
8
c
,



0
x
8
9











0
8
8
9

0
4
4
5



0
8
9
8

0
8
9
D

0
8
9
7

0
0
3
0
2


















d
t





0
x
9
8
,



0
x
9
d
,



0
x
9
7
,



0
x
9
2











0
8
9
2

0
4
4
9



0
8
B
0

0
8
B
5

0
8
B
F

0
0
3
0
3


















d
t





0
x
b
0
,



0
x
b
5
,



0
x
b
f
,



0
x
b
a











0
8
B
A

0
4
4
D



0
8
A
B

0
8
A
E

0
8
A
4

0
0
3
0
4


















d
t





0
x
a
b
,



0
x
a
e
,



0
x
a
4
,



0
x
a
1











0
8
A
1

0
4
5
1



0
8
E
0

0
8
E
5

0
8
E
F

0
0
3
0
5


















d
t





0
x
e
0
,



0
x
e
5
,



0
x
e
f
,



0
x
e
a











0
8
E
A

0
4
5
5



0
8
F
B

0
8
F
E

0
8
F
4

0
0
3
0
6


















d
t





0
x
f
b
,



0
x
f
e
,



0
x
f
4
,



0
x
f
1











0
8
F
1

0
4
5
9



0
8
D
3

0
8
D
6

0
8
D
C

0
0
3
0
7


















d
t





0
x
d
3
,



0
x
d
6
,



0
x
d
c
,



0
x
d
9











0
8
D
9

0
4
5
D



0
8
C
8

0
8
C
D

0
8
C
7

0
0
3
0
8


















d
t





0
x
c
8
,



0
x
c
d
,



0
x
c
7
,



0
x
c
2











0
8
C
2

0
4
6
1



0
8
4
0

0
8
4
5

0
8
4
F

0
0
3
0
9


















d
t





0
x
4
0
,



0
x
4
5
,



0
x
4
f
,



0
x
4
a











0
8
4
A

0
4
6
5



0
8
5
B

0
8
5
E

0
8
5
4

0
0
3
1
0


















d
t





0
x
5
b
,



0
x
5
e
,



0
x
5
4
,



0
x
5
1











0
8
5
1

0
4
6
9



0
8
7
3

0
8
7
6

0
8
7
C

0
0
3
1
1


















d
t





0
x
7
3
,



0
x
7
6
,



0
x
7
c
,



0
x
7
9











0
8
7
9

0
4
6
D



0
8
6
8

0
8
6
D

0
8
6
7

0
0
3
1
2


















d
t





0
x
6
8
,



0
x
6
d
,



0
x
6
7
,



0
x
6
2











0
8
6
2

0
4
7
1



0
8
2
3

0
8
2
6

0
8
2
C

0
0
3
1
3


















d
t





0
x
2
3
,



0
x
2
6
,



0
x
2
c
,



0
x
2
9











0
8
2
9

0
4
7
5



0
8
3
8

0
8
3
D

0
8
3
7

0
0
3
1
4


















d
t





0
x
3
8
,



0
x
3
d
,



0
x
3
7
,



0
x
3
2











0
8
3
2

0
4
7
9



0
8
1
0

0
8
1
5

0
8
1
F

0
0
3
1
5


















d
t





0
x
1
0
,



0
x
1
5
,



0
x
1
f
,



0
x
1
a











0
8
1
A

2000 Microchip Technology Inc. Preliminary DS00730A-page 21
AN730
0
4
7
D



0
8
0
B

0
8
0
E

0
8
0
4

0
0
3
1
6


















d
t





0
x
b
,




0
x
e
,




0
x
4
,




0
x
1












0
8
0
1

0
4
8
1



0
8
0
3

0
8
0
6

0
8
0
C

0
0
3
1
7


















d
t





0
x
3
,




0
x
6
,




0
x
c
,




0
x
9












0
8
0
9

0
4
8
5



0
8
1
8

0
8
1
D

0
8
1
7

0
0
3
1
8


















d
t





0
x
1
8
,



0
x
1
d
,



0
x
1
7
,



0
x
1
2











0
8
1
2

0
4
8
9



0
8
3
0

0
8
3
5

0
8
3
F

0
0
3
1
9


















d
t





0
x
3
0
,



0
x
3
5
,



0
x
3
f
,



0
x
3
a











0
8
3
A

0
4
8
D



0
8
2
B

0
8
2
E

0
8
2
4

0
0
3
2
0


















d
t





0
x
2
b
,



0
x
2
e
,



0
x
2
4
,



0
x
2
1











0
8
2
1

0
4
9
1



0
8
6
0

0
8
6
5

0
8
6
F

0
0
3
2
1


















d
t





0
x
6
0
,



0
x
6
5
,



0
x
6
f
,



0
x
6
a











0
8
6
A

0
4
9
5



0
8
7
B

0
8
7
E

0
8
7
4

0
0
3
2
2


















d
t





0
x
7
b
,



0
x
7
e
,



0
x
7
4
,



0
x
7
1











0
8
7
1

0
4
9
9



0
8
5
3

0
8
5
6

0
8
5
C

0
0
3
2
3


















d
t





0
x
5
3
,



0
x
5
6
,



0
x
5
c
,



0
x
5
9











0
8
5
9

0
4
9
D



0
8
4
8

0
8
4
D

0
8
4
7

0
0
3
2
4


















d
t





0
x
4
8
,



0
x
4
d
,



0
x
4
7
,



0
x
4
2











0
8
4
2

0
4
A
1



0
8
C
0

0
8
C
5

0
8
C
F

0
0
3
2
5


















d
t





0
x
c
0
,



0
x
c
5
,



0
x
c
f
,



0
x
c
a











0
8
C
A

0
4
A
5



0
8
D
B

0
8
D
E

0
8
D
4

0
0
3
2
6


















d
t





0
x
d
b
,



0
x
d
e
,



0
x
d
4
,



0
x
d
1











0
8
D
1

0
4
A
9



0
8
F
3

0
8
F
6

0
8
F
C

0
0
3
2
7


















d
t





0
x
f
3
,



0
x
f
6
,



0
x
f
c
,



0
x
f
9











0
8
F
9

0
4
A
D



0
8
E
8

0
8
E
D

0
8
E
7

0
0
3
2
8


















d
t





0
x
e
8
,



0
x
e
d
,



0
x
e
7
,



0
x
e
2











0
8
E
2

0
4
B
1



0
8
A
3

0
8
A
6

0
8
A
C

0
0
3
2
9


















d
t





0
x
a
3
,



0
x
a
6
,



0
x
a
c
,



0
x
a
9











0
8
A
9

0
4
B
5



0
8
B
8

0
8
B
D

0
8
B
7

0
0
3
3
0


















d
t





0
x
b
8
,



0
x
b
d
,



0
x
b
7
,



0
x
b
2











0
8
B
2

0
4
B
9



0
8
9
0

0
8
9
5

0
8
9
F

0
0
3
3
1


















d
t





0
x
9
0
,



0
x
9
5
,



0
x
9
f
,



0
x
9
a











0
8
9
A

0
4
B
D



0
8
8
B

0
8
8
E

0
8
8
4

0
0
3
3
2


















d
t





0
x
8
b
,



0
x
8
e
,



0
x
8
4
,



0
x
8
1











0
8
8
1

0
4
C
1



0
8
8
0

0
8
8
5

0
8
8
F

0
0
3
3
3


















d
t





0
x
8
0
,



0
x
8
5
,



0
x
8
f
,



0
x
8
a











0
8
8
A

0
4
C
5



0
8
9
B

0
8
9
E

0
8
9
4

0
0
3
3
4


















d
t





0
x
9
b
,



0
x
9
e
,



0
x
9
4
,



0
x
9
1











0
8
9
1

0
4
C
9



0
8
B
3

0
8
B
6

0
8
B
C

0
0
3
3
5


















d
t





0
x
b
3
,



0
x
b
6
,



0
x
b
c
,



0
x
b
9











0
8
B
9

0
4
C
D



0
8
A
8

0
8
A
D

0
8
A
7

0
0
3
3
6


















d
t





0
x
a
8
,



0
x
a
d
,



0
x
a
7
,



0
x
a
2











0
8
A
2

0
4
D
1



0
8
E
3

0
8
E
6

0
8
E
C

0
0
3
3
7


















d
t





0
x
e
3
,



0
x
e
6
,



0
x
e
c
,



0
x
e
9











0
8
E
9

0
4
D
5



0
8
F
8

0
8
F
D

0
8
F
7

0
0
3
3
8


















d
t





0
x
f
8
,



0
x
f
d
,



0
x
f
7
,



0
x
f
2











0
8
F
2

0
4
D
9



0
8
D
0

0
8
D
5

0
8
D
F

0
0
3
3
9


















d
t





0
x
d
0
,



0
x
d
5
,



0
x
d
f
,



0
x
d
a




AN730
DS00730A-page 22 Preliminary 2000 Microchip Technology Inc.







0
8
D
A

0
4
D
D



0
8
C
B

0
8
C
E

0
8
C
4

0
0
3
4
0


















d
t





0
x
c
b
,



0
x
c
e
,



0
x
c
4
,



0
x
c
1











0
8
C
1

0
4
E
1



0
8
4
3

0
8
4
6

0
8
4
C

0
0
3
4
1


















d
t





0
x
4
3
,



0
x
4
6
,



0
x
4
c
,



0
x
4
9











0
8
4
9

0
4
E
5



0
8
5
8

0
8
5
D

0
8
5
7

0
0
3
4
2


















d
t





0
x
5
8
,



0
x
5
d
,



0
x
5
7
,



0
x
5
2











0
8
5
2

0
4
E
9



0
8
7
0

0
8
7
5

0
8
7
F

0
0
3
4
3


















d
t





0
x
7
0
,



0
x
7
5
,



0
x
7
f
,



0
x
7
a











0
8
7
A

0
4
E
D



0
8
6
B

0
8
6
E

0
8
6
4

0
0
3
4
4


















d
t





0
x
6
b
,



0
x
6
e
,



0
x
6
4
,



0
x
6
1











0
8
6
1

0
4
F
1



0
8
2
0

0
8
2
5

0
8
2
F

0
0
3
4
5


















d
t





0
x
2
0
,



0
x
2
5
,



0
x
2
f
,



0
x
2
a











0
8
2
A

0
4
F
5



0
8
3
B

0
8
3
E

0
8
3
4

0
0
3
4
6


















d
t





0
x
3
b
,



0
x
3
e
,



0
x
3
4
,



0
x
3
1











0
8
3
1

0
4
F
9



0
8
1
3

0
8
1
6

0
8
1
C

0
0
3
4
7


















d
t





0
x
1
3
,



0
x
1
6
,



0
x
1
c
,



0
x
1
9











0
8
1
9

0
4
F
D



0
8
0
8

0
8
0
D

0
8
0
7

0
0
3
4
8


















d
t





0
x
8
,




0
x
d
,




0
x
7



































0
0
3
4
9























0
0
3
5
0

















E
N
D
P
r
o
g
r
a
m

M
e
m
o
r
y

W
o
r
d
s

U
s
e
d
:



6
2
1
P
r
o
g
r
a
m

M
e
m
o
r
y

W
o
r
d
s

F
r
e
e
:


1
4
2
7
E
r
r
o
r
s



:





0
W
a
r
n
i
n
g
s

:





0

r
e
p
o
r
t
e
d
,





0

s
u
p
p
r
e
s
s
e
d
M
e
s
s
a
g
e
s

:





5

r
e
p
o
r
t
e
d
,





0

s
u
p
p
r
e
s
s
e
d
2000 Microchip Technology Inc. Preliminary DS00730A-page 23
AN730
N
O
T
E
S
:
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 Microchips 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, except as maybe explicitly expressed herein, 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.
DS00730A-page 24 2000 Microchip Technology Inc.
All rights reserved. 2000 Microchip Technology Incorporated. Printed in the USA. 5/00 Printed on recycled paper.
AMERICAS
Corporate Office
Microchip Technology Inc.
2355 West Chandler Blvd.
Chandler, AZ 85224-6199
Tel: 480-786-7200 Fax: 480-786-7277
Technical Support: 480-786-7627
Web Address: http://www.microchip.com
Atlanta
Microchip Technology Inc.
500 Sugar Mill Road, Suite 200B
Atlanta, GA 30350
Tel: 770-640-0034 Fax: 770-640-0307
Boston
Microchip Technology Inc.
5 Mount Royal Avenue
Marlborough, MA 01752
Tel: 508-480-9990 Fax: 508-480-8575
Chicago
Microchip Technology Inc.
333 Pierce Road, Suite 180
Itasca, IL 60143
Tel: 630-285-0071 Fax: 630-285-0075
Dallas
Microchip Technology Inc.
4570 Westgrove Drive, Suite 160
Addison, TX 75248
Tel: 972-818-7423 Fax: 972-818-2924
Dayton
Microchip Technology Inc.
Two Prestige Place, Suite 150
Miamisburg, OH 45342
Tel: 937-291-1654 Fax: 937-291-9175
Detroit
Microchip Technology Inc.
Tri-Atria Office Building
32255 Northwestern Highway, Suite 190
Farmington Hills, MI 48334
Tel: 248-538-2250 Fax: 248-538-2260
Los Angeles
Microchip Technology Inc.
18201 Von Karman, Suite 1090
Irvine, CA 92612
Tel: 949-263-1888 Fax: 949-263-1338
New York
Microchip Technology Inc.
150 Motor Parkway, Suite 202
Hauppauge, NY 11788
Tel: 631-273-5305 Fax: 631-273-5335
San Jose
Microchip Technology Inc.
2107 North First Street, Suite 590
San Jose, CA 95131
Tel: 408-436-7950 Fax: 408-436-7955
AMERICAS (continued)
Toronto
Microchip Technology Inc.
5925 Airport Road, Suite 200
Mississauga, Ontario L4V 1W1, Canada
Tel: 905-405-6279 Fax: 905-405-6253
ASIA/PACIFIC
China - Beijing
Microchip Technology, Beijing
Unit 915, 6 Chaoyangmen Bei Dajie
Dong Erhuan Road, Dongcheng District
New China Hong Kong Manhattan Building
Beijing, 100027, P.R.C.
Tel: 86-10-85282100 Fax: 86-10-85282104
China - Shanghai
Microchip Technology
Unit B701, Far East International Plaza,
No. 317, Xianxia Road
Shanghai, 200051, P.R.C.
Tel: 86-21-6275-5700 Fax: 86-21-6275-5060
Hong Kong
Microchip Asia Pacific
Unit 2101, Tower 2
Metroplaza
223 Hing Fong Road
Kwai Fong, N.T., Hong Kong
Tel: 852-2-401-1200 Fax: 852-2-401-3431
India
Microchip Technology Inc.
India Liaison Office
No. 6, Legacy, Convent Road
Bangalore, 560 025, India
Tel: 91-80-229-0061 Fax: 91-80-229-0062
Japan
Microchip Technology Intl. Inc.
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
Korea
Microchip Technology Korea
168-1, Youngbo Bldg. 3 Floor
Samsung-Dong, Kangnam-Ku
Seoul, Korea
Tel: 82-2-554-7200 Fax: 82-2-558-5934
ASIA/PACIFIC (continued)
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
10F-1C 207
Tung Hua North Road
Taipei, Taiwan
Tel: 886-2-2717-7175 Fax: 886-2-2545-0139
EUROPE
Denmark
Microchip Technology Denmark ApS
Regus Business Centre
Lautrup hoj 1-3
Ballerup DK-2750 Denmark
Tel: 45 4420 9895 Fax: 45 4420 9910
France
Arizona Microchip Technology SARL
Parc dActivite 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
Arizona Microchip Technology GmbH
Gustav-Heinemann-Ring 125
D-81739 Mnchen, Germany
Tel: 49-89-627-144 0 Fax: 49-89-627-144-44
Italy
Arizona 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 5858 Fax: 44-118 921-5835
03/23/00
WORLDWIDE SALES AND SERVICE
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
Companys 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, Microchips quality
system for the design and manufacture of
development systems is ISO 9001 certified.

You might also like