English
Language : 

MC68HC55 Datasheet, PDF (31/40 Pages) Freescale Semiconductor, Inc – Two-Channel CMOS ASIC Device
MC68HC55 Technical Data
CRC Computation
4.7 CRC Computation
The 4-bit CRC uses an initialization value of 1010 and a polynomial of
x4+1. The following is a VHDL description of the CRC algorithm.
---------------------------------------------------------
-- Calculates the 4-bit CRC (x^4 + 1) serially for
-- 8 or 16 bits of data.
---------------------------------------------------------
constant CRCPoly: std_logic_vector := “0001”; -- x^4 +1
constant InitCrc: std_logic_vector := “1010”;
procedure SerialCalculateCRC4(CRC: input std_logic_vector;Data: in std_logic) is
variable Xor1: std_logic;
begin
Xor1 := CRC(3) xor Data;
CRC := CRC(2 downto 0) & ‘0’; -- Shift left 1 bit
if Xor1 = ‘1’ then
CRC := CRC xor CRCPoly
end if;
end SerialCalculateCRC4;
4.8 Message Size Special Cases
The response to any 8-bit message is expected to be another 8-bit
message and the response to any 16-bit message is expected to be
another 16-bit message. All DSI messages are initiated by the master
MCU through the DSI/D. This cuases to some special cases when there
is a transition from one message size to a different message size. The
first DSI messages that set up the addresses of the DSI system
peripherals are 16-bit messages. The firing commands are also 16-bit
messages. All other messages are eight bits.
MC68HC55
Functional Description
Technical Data
31