English
Language : 

IC-MU150 Datasheet, PDF (23/64 Pages) IC-Haus GmbH – MAGNETIC OFF-AXIS POSITION ENCODER - POLE WIDTH 1.50MM
iC-MU150 MAGNETIC OFF-AXIS
POSITION ENCODER - POLE WIDTH 1.50MM
I2C INTERFACE AND STARTUP BEHAVIOR
Rev B1, Page 23/64
I2C interface / CRC
The multimaster-I2C interface enables read and write
access to a serial EEPROM which uses an addressing
scheme equal to an 24C01 EEPROM (e.g. 24C02, 256
bytes, 5V type with a 3.3V function, device address
0x50).
The configuration data in the EEPROM in address
range 0x00 to 0x20 and 0x30 to 0x3F is checked with
a 16 bit CRC (CRC16). The start value for the CRC16
calculation is 1.
CRC16(7:0)
Addr. 0x22; bit 7:0
CRC16(15:8)
Addr. 0x21; bit 7:0
CRC16(7:0)*)
Addr. SER: 0x80; bit 7:0
CRC16(15:8)*)
Addr. SER: 0x81; bit 7:0
Code
Meaning
...
CRC formed with CRC polynomial 0x11021**)
Notes:
*) Access only via SPI interface
**) x16 + x12 + x5 + 1, start value 0x1
This is equivalent to CRC-CCITT/CRC-16
Table 26: EEPROM data checksum
The offset and preset position for iC-MU150’s preset
sequence is not part of the configuration data area. The
data is located in address range 0x23 to 0x2E of the
EEPROM and is checked separately with a 8-bit CRC
(CRC8). The start value for the CRC8 calculation is 1.
CRC8(7:0)
Addr. 0x2F; bit 7:0
CRC8(7:0)*)
Addr. SER: 0x82; bit 7:0
Code
Meaning
...
CRC formed with CRC polynomial 0x197**)
Notes:
*) Access only via SPI interface
**) x8 + x7 + x4 + x2 + x1 + 1, start value 0x1
iC-MU150 calculates CRC8 and CRC16 automatically
when writing the configuration to the EEPROM. How-
ever, an example of a CRC calculation routine is given
in Tab. 29. The serial interface allows to access the
CRC8 and CRC16 values only in SPI mode. CRC16
and CRC8 are checked on startup. A cyclic check dur-
ing operation can be configured with NCHK_CRC. With
the command CRC_VER (s. Tab. 106) a CRC check
can be explicitly requested. An error is reported by
status bit CRC_ERR.
NCHK_CRC
Addr. 0x0D; bit 6
Code
Meaning
0
cyclical CRC check of CRC16 and CRC8
1
no cyclical CRC check
Table 28: Cyclic CRC check
unsigned char ucDataStream = 0;
i n t iCRC_CRC8Poly = 0x97 ;
unsigned char ucCRC8 ;
int i = 0;
ucCRC8 = 1 ; / / s t a r t v a l u e ! ! !
for ( iReg = 35; iReg <47; iReg ++)
{
ucDataStream = ucGetValue ( iReg ) ;
for ( i =0; i <=7; i ++) {
i f ( ( ucCRC8 & 0x80 ) ! = ( ucDataStream & 0x80 ) )
ucCRC8 = ( ucCRC8 << 1 ) ^ iCRC_CRC8Poly ;
else
ucCRC8 = ( ucCRC8 << 1 ) ;
ucDataStream = ucDataStream << 1 ;
}
}
Table 29: Example of CRC calculation routine using
CRC8
Table 27: Offset/preset data checksum