32-Bit Arm
®
Cortex
®
-M0+ MCU
HT32F50231/HT32F50241
Functional Descriptions
This unit only enables the calculation in the CRC16, CCITT CRC16 and IEEE-802.3 CRC32
polynomials. In this unit, the generator polynomial is fixed to the numeric values for those modes;
therefore, the CRC value based on other generator polynomials cannot be calculated.
CRC Computation
The CRC calculation unit has a 32-bit write CRC data register (CRCDR) and a read CRC checksum
register (CRCCSR). The CRCDR register is used to input new data (write access) and the CRCCSR
register is used to hold the result of the previous CRC calculation (read access). Each write operation
to the CRCDR register creates a combination of the previous CRC value (stored in CRCCSR) and
the new one. The CRC block diagram is shown as Figure 177. The CRC unit calculates the CRC data
register (CRCDR) value byte by byte and the default byte and bit order is big-endian. The CRCDR
register can be written by word, right-aligned half-word and right-aligned byte. For the other
registers only 32-bit access is allowed. The duration of the computation depends on data width:
▄
4 AHB clock cycles for 32-bit data input
▄
2 AHB clock cycles for 16-bit data input
▄
1 AHB clock cycle for 8-bit data input
Byte and Bit Reversal for CRC Computation
The byte reordering and byte-level bit reversal operation can be occurred before the data is
used in the CRC calculation or after the CRC checksum output. They are configurable using the
corresponding setting field of the CRCCR register. These operations occur on word or half-word
writes. The hardware ignores the DATBYRV bit of the CRCCR register with any byte writes but
the bit reversal setting DATBIRV are still applied to the byte. The Figure 178 is shown the byte and
bit reversal operation example.
Input data is
big-endian
Byte Reversal Enable
Bit Reversal Enable
Figure 178. CRC Data Bit and Byte Reversal Example
Rev. 1.00
Byte 3
Byte 2
Byte 0
Byte 1
Byte 0
Byte 1
481 of 486
Byte 1
Byte 0
Byte 2
Byte 3
Byte 2
Byte 3
July 31, 2018
Need help?
Do you have a question about the HT32F50231 and is the answer not in the manual?