19.07.2014 Views

PIC24HJ64 Datasheet

PIC24HJ64 Datasheet

PIC24HJ64 Datasheet

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

PIC24HJ32GP302/304, <strong>PIC24HJ64</strong>GPX02/X04, AND PIC24HJ128GPX02/X04<br />

22.0 PROGRAMMABLE CYCLIC<br />

REDUNDANCY CHECK (CRC)<br />

GENERATOR<br />

Note:<br />

This data sheet summarizes the features<br />

of the PIC24HJ32GP302/304,<br />

<strong>PIC24HJ64</strong>GPX02/X04,<br />

and<br />

PIC24HJ128GPX02/X04 families of<br />

devices. It is not intended to be a comprehensive<br />

reference source. To complement<br />

the information in this data sheet, refer to<br />

the PIC24H Family Reference Manual,<br />

“Section 36. Programmable Cyclic<br />

Redundancy Check (CRC)”, which is<br />

available from the Microchip website<br />

(www.microchip.com).<br />

The programmable CRC generator offers the following<br />

features:<br />

• User-programmable polynomial CRC equation<br />

• Interrupt output<br />

• Data FIFO<br />

22.1 Overview<br />

The module implements a software configurable CRC<br />

generator. The terms of the polynomial and its length<br />

can be programmed using the CRCXOR (X) bits<br />

and the CRCCON (PLEN) bits, respectively.<br />

EQUATION 22-1:<br />

CRC EQUATION<br />

To program this polynomial into the CRC generator,<br />

the CRC register bits should be set as shown in<br />

Table 22-1.<br />

TABLE 22-1:<br />

Bit Name<br />

x 16 + x 12 + x 5 + 1<br />

EXAMPLE CRC SETUP<br />

Bit Value<br />

PLEN 1111<br />

X 000100000010000<br />

For the value of X, the 12th bit and the 5th bit are<br />

set to ‘1’, as required by the CRC equation. The 0th bit<br />

required by the CRC equation is always XORed. For a<br />

16-bit polynomial, the 16th bit is also always assumed<br />

to be XORed; therefore, the X bits do not have<br />

the 0th bit or the 16th bit.<br />

The topology of a standard CRC generator is shown in<br />

Figure 22-2.<br />

FIGURE 22-1:<br />

CRC SHIFTER DETAILS<br />

PLEN<br />

0 1 2 15<br />

CRC Shift Register<br />

Hold X1 Hold X2 Hold X3 X15 Hold<br />

DOUT<br />

XOR<br />

OUT<br />

IN<br />

BIT 0<br />

0<br />

1<br />

OUT<br />

IN<br />

BIT 1<br />

0<br />

1<br />

OUT<br />

IN<br />

BIT 2<br />

0<br />

1<br />

0<br />

1<br />

OUT<br />

IN<br />

BIT 15<br />

p_clk<br />

p_clk<br />

p_clk<br />

p_clk<br />

CRC Read Bus<br />

CRC Write Bus<br />

© 2008 Microchip Technology Inc. Preliminary DS70293B-page 241

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!