KMA215 All information provided in this document is subject to legal disclaimers. © NXP B.V. 2014. All rights reserved.
Product data sheet Rev. 1 — 24 February 2014 34 of 50
NXP Semiconductors
KMA215
Programmable angle sensor with SAE J2716 SENT
13.4.1 Software example in C
1 #include <stdio.h.>
2
3 int generate_crc(unsigned int data[], int arr_length)
4{
5 // generator polynomial
6 const int gpoly = 0x107; // initial value of checksum
7 int crc = 0xFF;
8 // print data values and calculate CRC
9 printf(“\nAddress\tValue\n”);
10 for (int index = 0; index <= arr_length-1; index++) {
11 printf(“0x%1X\t0x%04X\n”, index, data[index]);
12 for (int bitnr = 15; bitnr >= 0; bitnr--) {
13 crc <<= 1;
14 crc = (int) ((data[index] & (1u<<bitnr))>>bitnr);
15 if (crc & 0x100) crc ^= gpoly;
16 }
17 }
18 // print calculated checksum
19 printf(“\nCalculated Checksum: 0x%02X\n”, crc);
20 return crc;
21 }
22 int main_crc(void)
23 {
24 // data array for checksum calculation
25 // 8 LSB are CRC, fill with 0
26 unsigned int data[] = {0x0818, 0x0000, 0x0800,
27 0x0FFF, 0x0000, 0x0FFF,
28 0x0000, 0x0000, 0x0000,
29 0x0000, 0x0000, 0x0000,
30 0x0000, 0x0FFF, 0x0000};
31 // determine size of data array
32 int arr_length = sizeof(data) / sizeof(unsigned int);
33 // calculate checksum
34 generate_crc(data, arr_length);
35 return 1;
36 }
This example refers to the default register values. The checksum of this data sequence is
DBh.
KMA215 All information provided in this document is subject to legal disclaimers. © NXP B.V. 2014. All rights reserved.
Product data sheet Rev. 1 — 24 February 2014 35 of 50
NXP Semiconductors
KMA215
Programmable angle sensor with SAE J2716 SENT
13.5 Registers
13.5.1 Command registers
To enter the command mode, write the signature given in Table 32 into the specific
register using the OWI. Do this procedure as described in Section 13.3.3
, with a write
command, the signature follows it, but after a power-on reset and not later than t
cmd(ent)
.
Table 32. Command registers
Command
write/read
Register Bit Access Field Description
82h/83h CTRL1 15 R IN_DIAG_MODE shows if there is a diagnostic condition present; the
setting of register field FORCE_DIAG_OFF does
not affect this bit
14 W FORCE_DIAG_OFF force diagnostic mode off; default: 0b
13 - - reserved
12 R LOW_VOLTAGE_DET low voltage condition detected
11 to 9 - - reserved
8 R ERR_CORRECT single-bit error of non-volatile memory has been
detected and corrected; updated every memory
readout; bit remains set until the diagnostic
condition disappears and a power-on reset is done
7 R UNCORR_ERR double-bit error of non-volatile memory has been
detected; updated every memory readout;
bit remains set until the diagnostic condition
disappears and a power-on reset is done
6 R MAGNET_LOSS_DET magnet-loss detected; bit remains set until the
diagnostic condition disappears and a power-on
reset is done; enable magnet-loss detection for
raising diagnostic condition
5 R BROKEN_BOND_DET broken bond wire detected; bit remains set until the
diagnostic condition disappears and a power-on
reset is done
4 R CRC_BAD checksum error detected; updated every start-up
3 R OOR_HI angular value above OOR_THRESHOLD_HI
threshold value
2 R OOR_LO angular value below OOR_THRESHOLD_LO
threshold value
1 and 0 - - reserved
94h/- SIGNATURE 15 to 0 W SIGNATURE to enter command mode, write signature B96Ah
within t
cmd(ent)
; for more details, see Section 13.3.3
KMA215 All information provided in this document is subject to legal disclaimers. © NXP B.V. 2014. All rights reserved.
Product data sheet Rev. 1 — 24 February 2014 36 of 50
NXP Semiconductors
KMA215
Programmable angle sensor with SAE J2716 SENT
13.5.2 Non-volatile memory registers
The device includes several internal registers which are used for customization and
identification.
The initial signature allows read access to all areas but only write access to customer
registers. Write accesses to reserved areas are ignored. Since these registers are
implemented as non-volatile memory cells, writing to the registers needs a specific time
t
prog
after each write access to complete.
As there is no check for the programming time, make sure that no other accesses to the
non-volatile memory are made during the programming cycle. Do not address
the non-volatile memory during the time t
prog
.
Note: To calculate the checksum, read out and consult register addresses 0h to Eh.

KMA215,118

Mfr. #:
Manufacturer:
NXP Semiconductors
Description:
SENSOR ANGLE 180 DEG PC PIN
Lifecycle:
New from this manufacturer.
Delivery:
DHL FedEx Ups TNT EMS
Payment:
T/T Paypal Visa MoneyGram Western Union

Products related to this Datasheet