Fujitsu FR81S User Manual

Page of 2342
CHAPTER 38: CRC 
 
 
5. Operation 
 
FUJITSU SEMICONDUCTOR LIMITED 
CHAPTER
 : CRC 
FUJITSU SEMICONDUCTOR CONFIDENTIAL 
21 
5.6.3.   Example 3 CRC32, Byte Order, Big-endian 
Example 3 CRC32, the byte order and big-endian are shown below. 
Figure 5-4 Example 3 
 
 
When CRC32 (IEEE-802.3) is used, the bit order is LSB First. This CRC calculator supports both byte 
orders and the figure above shows the case for big endian. 
//*********************************** 
// CRC32 (IEEE-802.3) 
// polynomial: 0x04C11DB7 
// initial value: 0xFFFF_FFFF 
// CRCCR.CRC32 1 // CRC32 
// CRCCR.LTLEND: 0 // big endian 
// CRCCR.LSBFST: 1 // LSB First 
// CRCCR.CRCLTE: 0 // CRC big endian 
// CRCCR.CRCLSF: 1 // CRC LSB First 
// CRCCR.FXOR: 1 // CRC Final XOR on 
//*********************************** 
 
// 
// Example 3-1 (CRC32) 
// 
 
// Initialization 
B_WRITE (CRCCR, 0x6B); 
 
// data write "123456789" 
W_WRITE (CRCIN, 0x31323334); 
W_WRITE (CRCIN, 0x35363738); 
B_WRITE (CRCIN, 0x39); 
 
// read result 
W_READ (CRCR, data); 
 
// check CRC result 
assert (data == 0x2639F4CB); 
 // <- big endian & LSB First 
(The following is assumed)
B_WRITE --
Byte writing
H_WRITE --
Half-word writing
W_WRITE --
Word writing
B_READ --
Byte reading
H_READ --
Half-word reading
W_READ --
Word reading
CRCCR
--
Control register address
CRCINIT --
Initial value register address
CRCIN
--
Input data register address
CRCR
--
Current CRC register address
3
1
3
2
3
3
Image of input order into CRC calculator
9
CRC result (inside macro)
Top
Top
CRC output (FXOR and rearrangement)
B 6 3 D 0 2 C
2 6 3 9 F 4 C B
3
4
3
5
3
6
3
7
3
8
3
9
MB91520 Series
MN705-00010-1v0-E
1290