KMA199E T/R NXP Semiconductors, KMA199E T/R Datasheet - Page 19

no-image

KMA199E T/R

Manufacturer Part Number
KMA199E T/R
Description
Manufacturer
NXP Semiconductors
Datasheet

Specifications of KMA199E T/R

Operating Temperature (min)
-40C
Operating Supply Voltage (typ)
5V
Lead Free Status / Rohs Status
Compliant
NXP Semiconductors
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
KMA199E_1
Product data sheet
#include <stdio.h.>
// calc_crc accepts unsigned 16-bit data in data
int calc_crc(int crc, unsigned int data)
{
}
int main(void)
{
}
const int gpoly = 0x107; // generator polynomial
int i;
for (i = 15; i >= 0; i--)
}
return crc;
int crc, crc_res, i;
// 8 LSB are CRC field filled with 0
unsigned int data_seq[] = {0x1111, 0x2222, 0x3333, 0x4444,
// calculate checksum over all data
crc = 0xFF;
printf(“Address\tValue\n”);
for (i = 0; i <= 15; i++)
{
}
crc_res = crc;
printf(“\nChecksum\n0x%02X\n”, crc_res);
// check procedure for above data sequence
crc = 0xFF;
for (i = 0; i <= 14; i++)
// last word gets crc inserted
crc = calc_crc(crc, data_seq[i]
printf(“\nCheck procedure for data sequence: must be 0x00 is 0x%02X.\n”,crc);
return 1;
13.4.1 Software example in C
crc <<= 1;
crc = (int) ((data & (1u<<i))>>i);
// XOR of with generator polynomial when MSB(9) = HIGH
if (crc & 0x100) crc ^= gpoly;
printf(“0x%1X\t0x%04X\n”, i, data_seq[i]);
crc = calc_crc(crc, data_seq[i]);
crc = calc_crc(crc, data_seq[i]);
The checksum of this data sequence is 6Fh.
//index variable
//shift left
0x5555, 0x6666, 0x7777, 0x8888,
0x9999, 0xAAAA, 0xBBBB, 0xCCCC,
0xDDDD, 0xEEEE, 0xFFFF, 0x4200};
// start value of crc register
// crc_res = 0x6F
Rev. 01 — 18 October 2007
{
crc_res);
Programmable angle sensor
KMA199E
© NXP B.V. 2007. All rights reserved.
19 of 31

Related parts for KMA199E T/R