參數(shù)資料
型號(hào): KMA210
廠商: NXP Semiconductors N.V.
元件分類: 振動(dòng)和傾斜傳感器
英文描述: Programmable angle sensor
封裝: KMA210<SOT1288|<<<1<Always Pb-free,;
文件頁(yè)數(shù): 22/36頁(yè)
文件大?。?/td> 563K
代理商: KMA210
KMA210
All information provided in this document is subject to legal disclaimers.
NXP B.V. 2011. All rights reserved.
Product data sheet
Rev. 1 — 30 June 2011
22 of 36
NXP Semiconductors
KMA210
Programmable angle sensor
13.4.1
Software example in C
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
#include <stdio.h.>
// calc_crc accepts unsigned 16-bit data in data
int
calc_crc(
int
crc,
unsigned int
data)
{
const int
gpoly = 0x107; // generator polynomial
int
i;
for
(i = 15; i >= 0; i--)
{
crc <<= 1;
crc
= (
int
) ((data & (1u<<i))>>i);
// XOR of with generator polynomial when MSB(9) = HIGH
if
(crc & 0x100) crc ^= gpoly;
}
return
crc;
}
int
main(
void
)
{
int
crc, crc_res, i;
// 8 LSB are CRC field filled with 0
unsigned int
data_seq[] = {0x0000, 0xFFC1, 0x0400, 0x0100,
//index variable
//shift left
0x1300, 0x0000, 0x0000, 0x0000};
// calculate checksum over all data
crc = 0xFF;
printf(“Address\tValue\n”);
for
(i = 0; i <= 7; i++)
{
printf(“0x%1X\t0x%04X\n”, i, data_seq[i]);
crc = calc_crc(crc, data_seq[i]);
}
crc_res = crc;
printf(“\nChecksum\n0x%02X\n”, crc_res);
// check procedure for above data sequence
crc = 0xFF;
for
(i = 0; i <= 6; i++)
crc = calc_crc(crc, data_seq[i]);
// last word gets crc inserted
crc = calc_crc(crc, data_seq[i]
crc_res);
printf(“\nCheck procedure for data sequence: must be 0x00 is 0x%02X.\n”,crc);
return
1;
// start value of crc register
// crc_res = 0xA9
}
The checksum of this data sequence is A9h.
相關(guān)PDF資料
PDF描述
KMI15 Rotational speed sensor
KMI16 Integrated rotational speed sensor
KMI18 Integrated rotational speed sensor
KMZ41 Magnetic field sensor
KMZ43T Magnetic field sensor
相關(guān)代理商/技術(shù)參數(shù)
參數(shù)描述
KMA210-115 制造商:PHILIPS 制造商全稱:NXP Semiconductors 功能描述:Programmable angle sensor
KMA220 制造商:PHILIPS 制造商全稱:NXP Semiconductors 功能描述:Dual channel programmable angle sensor
KMA220,118 制造商:NXP 功能描述:KMA220 Series 5 V Dual Channel Programmable Angle Sensor - SOT-1188-1
KMA220J 制造商:NXP Semiconductors 功能描述:KMA220/SIL4/REEL13// - Tape and Reel 制造商:NXP Semiconductors 功能描述:MOD ANGLE SENSOR MAGN 2CH SIL4