KMA199E
Programmable angle sensor
Rev. 2 — 7 December 2011
Product data sheet
1. Product profile
1.1 General description
The KMA199E is a magnetic angle sensor system. The MagnetoResistive (MR) sensor
bridges and the mixed signal Integrated Circuit (IC) are integrated into a single package.
This angular measurement system KMA199E is pre-programmed, pre-calibrated and
therefore, ready to use.
The KMA199E allows user specific adjustments of angular range, zero angle and
clamping voltages. The settings are stored permanently in an Electrically Erasable
Programmable Read-Only Memory (EEPROM).
1.2 Features and benefits
High precision sensor for magnetic
Ratiometric output voltage
angular measurement
Programmable user adjustments,
Independent from the magnetic field
including zero angle and angular range
strength above 35 kA/m
Single package sensor system
Programming via One-Wire Interface
(OWI)
Magnet-lost and power-lost detection
Fail-safe EEPROM
Built-in transient protection
High temperature range
User-programmable 32-bit identifier
Factory calibrated
Ready to use
KMA199E
NXP Semiconductors
Programmable angle sensor
2. Pinning information
Table 1.
Pinning
Pin
Symbol
Description
1
VDD
supply voltage
2
GND
ground
3
OUT/DIGINT
analog output voltage or digital
interface
Simplified outline
1
2
3
3. Ordering information
Table 2.
KMA199E
Product data sheet
Ordering information
Type number
Package
Name
Description
Version
KMA199E
-
plastic single-ended multi-chip package;
6 interconnections; 3 in-line leads
SOT880
All information provided in this document is subject to legal disclaimers.
Rev. 2 — 7 December 2011
© NXP B.V. 2011. All rights reserved.
2 of 32
xxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx x xxxxxxxxxxxxxx xxxxxxxxxx xxx xxxxxx xxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxx
xxxxx xxxxxx xx xxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxx xxxxxxx xxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxx xxxxxxxxxxxxxx xxxxxx xx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxx xxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxx xxxxx x x
VDDS
VDDS
REGULATOR
VDDA
REGULATOR
VDDD
REGULATOR
LOGIC
VDD
POWER-ON
RESET
NXP Semiconductors
Vref
Iref
4. Functional diagram
KMA199E
Product data sheet
VDDE
VSSE
VSSE
Rev. 2 — 7 December 2011
All information provided in this document is subject to legal disclaimers.
POWER
LOST
Cblock
VSINP
MUX
AMPLIFIER
VSINN
2
2
A
VCOSP
D
D
A
OUTPUT
BUFFER
VO
OUT/
DIGINT
VCOSN
VSSS
TP0
TP1
TEST CONTROL
Q_PUMP
POWER
LOST
TP2
ARRAY
DIGITAL FILTER
OFFSET
AND
CORRECTION
AVERAGING
EEPROM
CORDIC
ALGORITHM
OFFSET
CALCULATION
ANGULAR
RANGE
ADJUSTMENT
ONE-WIRE
INTERFACE
CL
OSC
DIGITAL BLOCKS (LOGIC)
VSSE
magnetoresistive
sensor bridges
internal
protection
diodes
001aag809
KMA199E
Programmable angle sensor
3 of 32
© NXP B.V. 2011. All rights reserved.
Fig 1. Functional diagram of KMA199E
signal conditioning integrated circuit
GND
KMA199E
NXP Semiconductors
Programmable angle sensor
5. Functional description
The KMA199E amplifies two orthogonal differential signals, which are delivered by MR
sensor bridges and converts them into the digital domain. The angle is calculated using
the COordinate Rotation DIgital Computer (CORDIC) algorithm. After a digital-to-analog
conversion the analog signal is provided to the output. Thus, the output is a linear
representation of the angular value. Zero angle, clamping voltages and angular range are
programmable. In addition, two 16-bit registers are available for customer purposes, like
sample identification.
The KMA199E comprises a Cyclic Redundancy Check (CRC) and an Error Detection and
Correction (EDC) supervision, as well as a magnet-lost detection to ensure a fail-safe
operation. A power-lost detection circuit pulls the analog output to the remaining supply
line, if either the supply voltage or the ground line is interrupted.
After multiplexing the two MR Wheatstone bridge signals and their successive
amplification, the signal is converted into the digital domain by an Analog-to-Digital
Converter (ADC). Further processing is done within an on-chip state machine. This
includes offset cancellation, calculation of the mechanical angle using the CORDIC
algorithm, as well as zero angle and angular range adjustment. The internal
Digital-to-Analog Converter (DAC) and the analog output stage are used for conversion of
the angle information into an analog output voltage, which is ratiometric to the supply
voltage.
The configuration parameters are stored in an user-programmable EEPROM. For this
purpose the OWI, which is accessible via the pin OUT/DIGINT, is used.
5.1 Angular measurement directions
The differential signals of the MR sensor bridges depend only on the direction of the
external magnetic field strength Hext, which is applied parallel to the plane of the sensor. In
order to obtain a correct output signal, the minimum saturation field strength has to be
exceeded.
KMA199E
Product data sheet
All information provided in this document is subject to legal disclaimers.
Rev. 2 — 7 December 2011
© NXP B.V. 2011. All rights reserved.
4 of 32
KMA199E
NXP Semiconductors
Programmable angle sensor
α
Hext
001aag741
Fig 2. Angular measurement directions
Since the Anisotropic MR (AMR) effect is periodic over 180, the sensor output is also
180-periodic, whereas the angle is calculated relative to a freely programmable zero
angle. The dashed line indicates the mechanical zero degree position.
6. Diagnostic features
The KMA199E provides four diagnostic features:
6.1 EEPROM CRC and EDC supervision
The KMA199E includes a supervision of the programmed data. At power-on, a CRC of the
EEPROM is done. Furthermore the EEPROM is protected against bit errors. For this
purpose every 16-bit data word is saved internally as a 22-bit word. The protection logic
corrects any single-bit error in a data word, while the sensor continues in normal operation
mode and can detect all double-bit errors by going into diagnostic mode.
6.2 Magnet-lost detection
If the applied magnetic field strength is not sufficient, the KMA199E raises a diagnostic
condition. In order to enter the diagnostic mode, due to EEPROM CRC or magnet-lost
detection, the device can be programmed for an active diagnostic mode, where the output
is driven below 4 %VDD or above 96 %VDD.
KMA199E
Product data sheet
All information provided in this document is subject to legal disclaimers.
Rev. 2 — 7 December 2011
© NXP B.V. 2011. All rights reserved.
5 of 32
KMA199E
NXP Semiconductors
Programmable angle sensor
6.3 Power-lost detection
The power-lost detection circuits enable the detection of an interrupted supply or ground
line of the KMA199E. In case of a power-lost condition, two internal switches within the
sensor are closed, connecting the pin of the analog output with the pins of the supply
voltage and the ground.
KMA199E
VDD
ZO(pl)
OUT/DIGINT
ZO(pl)
GND
001aag810
Fig 3. Equivalent output circuit in case of a power-lost condition
Table 3 shows the resulting output voltage depending on the error case and the load
resistance.
Table 3.
Power-lost behavior
Load resistance
Supply voltage lost
Ground lost
RL > 5 k
VO 4 %VDD
VO 96 %VDD
6.4 Low supply voltage detection
If the supply voltage is below the switch-off threshold voltage, a status bit is set.
Following table describes the behavior of the analog output at different supply voltages.
Table 4.
Supply voltage behavior
Voltage range
Description
Analog output
0 V to 1.5 V
the output drives an active LOW, but the
switches of the power-lost detection circuits
are not fully opened and set the output to a
level between ground and half the supply
voltage
actively driven output to a
voltage level between ground
and half the supply voltage
1.5 V to VPOR
all modules begin to work and the power-on
reset is active
diagnostics at LOW level
VPOR to Vth(on) or
Vth(off)
all modules begin to work and the digital part is EEPROM defined diagnostic
initialized
level
Vth(on) or Vth(off) to analog output is switched on after power-on
4.5 V
time and represents the measured angle
4.5 V to 5.5 V
KMA199E
Product data sheet
analog output of the
measured angle without the
specified accuracy
normal operation where the sensor works with analog output of the
the specified accuracy
measured angle
All information provided in this document is subject to legal disclaimers.
Rev. 2 — 7 December 2011
© NXP B.V. 2011. All rights reserved.
6 of 32
KMA199E
NXP Semiconductors
Programmable angle sensor
7. Analog output
The KMA199E provides one analog output signal on pin OUT/DIGINT. The measured
angle is converted linearly into a value, which is ratiometric to the supply voltage VDD.
For this purpose either a positive or a negative slope is provided.
The following table describes the analog output behavior for a positive slope. If for
example a magnetic field angle, larger than the programmed maximum angle max, but
smaller than the clamp switch angle sw(CL) is applied to the sensor, the analog output is
set to the upper clamping voltage. But if the magnetic field angle is even larger than the
clamp switch angle, the analog output switches from upper to lower clamping voltage. In
case of a negative slope, the clamping voltages are changed.
Table 5.
Analog output behavior for a positive slope
Magnetic field angle
Analog output
max < < sw(CL)
V(CL)u
sw(CL) < < ref + 180
V(CL)l
The analog output voltage range codes both angular and diagnostic information. A valid
value of the angle is between the upper and lower clamping voltage. If the analog output is
in the diagnostic range, that is below 4 %VDD or above 96 %VDD, an error condition has
been detected. The analog output repeats every 180.
VO
(%VDD)
αrng
V(CL)u
V(CL)I
0
αref
α (deg)
αmax
180
αsw(CL)
αref + 180°
001aag811
max = ref + rng
Fig 4. Characteristic of the analog output
KMA199E
Product data sheet
All information provided in this document is subject to legal disclaimers.
Rev. 2 — 7 December 2011
© NXP B.V. 2011. All rights reserved.
7 of 32
KMA199E
NXP Semiconductors
Programmable angle sensor
8. Limiting values
Table 6.
Limiting values
In accordance with the Absolute Maximum Rating System (IEC 60134).
Symbol
Parameter
VDD
supply voltage
Conditions
tinit < 200 h
Min
Max
Unit
0.3
+5.7
V
[1]
-
6.0
V
[2]
0.3
VDD + 0.3 V
-
150
mA
VO
output voltage
Ir
reverse current
Tamb
ambient temperature
40
+160
C
Tamb(pr)
programming ambient
temperature
10
70
C
Tstg
storage temperature
40
+125
C
Tamb < 70 C
EEPROM
tret(D)
data retention time
Nendu(W_ER) write or erase endurance
Tamb = 50 C
17
-
year
Tamb(pr) = 70 C
100
-
cycle
[1]
Time until sensor environment is initialized.
[2]
The maximum value of the output voltage is 5.7 V.
9. Recommended operating conditions
Table 7.
Operating conditions
In a homogenous magnetic field.
Symbol
Parameter
Conditions
[1]
Min
Typ
Max
Unit
4.5
5.0
5.5
V
VDD
supply voltage
Tamb
ambient temperature
40
-
+160
C
Tamb(pr)
programming ambient temperature
10
-
70
C
CL
load capacitance
[2]
0.33
-
22
nF
blocking capacitance
[3]
75
100
-
nF
RL
load resistance
[4]
Hext
external magnetic field strength
Cblock
5
-
k
35
-
-
kA/m
[1]
Normal operation mode.
[2]
Between ground and analog output, as close as possible to the package.
[3]
Between ground and supply voltage, as close as possible to the package and with a low equivalent series
resistance.
[4]
Power-lost detection is only possible with a load resistance within the specified range.
10. Thermal characteristics
Table 8.
KMA199E
Product data sheet
Thermal characteristics
Symbol
Parameter
Rth(j-a)
thermal resistance from junction
to ambient
Conditions
All information provided in this document is subject to legal disclaimers.
Rev. 2 — 7 December 2011
Typ
Unit
120
K/W
© NXP B.V. 2011. All rights reserved.
8 of 32
KMA199E
NXP Semiconductors
Programmable angle sensor
11. Characteristics
Table 9.
Supply current
Characteristics are valid for the operating conditions, as specified in Section 9.
Symbol
Parameter
Conditions
[1][2]
supply current
IDD
[1]
Normal operation mode.
[2]
Without load current at the analog output.
Min
Typ
Max
Unit
-
-
10
mA
Table 10. Power-on reset
Characteristics are valid for the operating conditions, as specified in Section 9.
Symbol
Parameter
Conditions
Min
Typ
Max
Unit
Vth(on)
switch-on threshold
voltage
analog output switches on, if
VDD > Vth(on)
4.20
4.30
4.49
V
Vth(off)
switch-off threshold
voltage
analog output switches off, if
VDD < Vth(off)
-
4.20
4.30
V
Vhys
hysteresis voltage
Vhys = Vth(on) Vth(off)
0.1
-
0.4
V
VPOR
power-on reset voltage
IC is initialized
2.4
-
3.3
V
Unit
Table 11. System performance
Characteristics are valid for the operating conditions, as specified in Section 9.
Symbol
Parameter
Conditions
Min
Typ
Max
[1]
res
angle resolution
-
-
0.04
deg
max
maximum angle
programmable angular range
for V(CL)u V(CL)l 80 %VDD
[2]
5
-
180
deg
ref
reference angle
programmable zero angle
[2]
0
-
180
deg
VO(nom)
nominal output voltage
at full supply operating range
5
-
95
%VDD
VO(udr)
upper diagnostic range
output voltage
[3]
96
-
100
%VDD
VO(ldr)
lower diagnostic range
output voltage
[3]
0
-
4
%VDD
V(CL)u
upper clamping voltage
[4]
40
-
95
%VDD
V(CL)l
lower clamping voltage
[4]
5
-
30.5
%VDD
V(CL)
clamping voltage variation
deviation from programmed
value
0.3
-
+0.3
%VDD
IO
output current
normal operation mode;
operating as sink or source
-
-
2
mA
Vn(o)(RMS)
RMS output noise voltage
equivalent power noise
-
0.4
2.5
mV
1.55
-
+1.55
deg
-
-
0.8
deg
-
-
0.55
deg
lin
linearity error
temp
temperature drift error
[5]
[5][6]
[1][5][6]
[7][8]
tempRT
[6][7][8]
temperature drift error at
room temperature
KMA199E
Product data sheet
All information provided in this document is subject to legal disclaimers.
Rev. 2 — 7 December 2011
© NXP B.V. 2011. All rights reserved.
9 of 32
KMA199E
NXP Semiconductors
Programmable angle sensor
Table 11. System performance …continued
Characteristics are valid for the operating conditions, as specified in Section 9.
Symbol
hys
Parameter
hysteresis error
Conditions
Min
Typ
Max
Unit
referred to input
[5][6]
-
-
0.09
deg
[5][6]
0.1
-
+0.1
deg
-
-
210
lin
microlinearity error
referred to input
ZO(pl)
power-lost output
impedance
impedance to remaining supply
line in case of lost supply
voltage or lost ground
[1]
At a nominal output voltage between 5 %VDD and 95 %VDD and a maximum angle of max = 180.
[2]
In steps of resolution < 0.022.
[3]
Activation is dependent on the programmed diagnostic mode.
[4]
In steps of 0.02 %VDD.
[5]
At a low-pass filtered analog output with a cut-off frequency of 0.7 kHz.
[6]
See Section 12.
[7]
Temperature range 40 C to +140 C.
[8]
Based on a 3 standard deviation.
Table 12. Dynamics
Characteristics are valid for the operating conditions, as specified in Section 9.
Symbol
Parameter
Conditions
Min
Typ
Max
Unit
ton
turn-on time
until first valid result
-
-
5
ms
fupd
update frequency
2
3.125
-
kHz
ts
settling time
-
-
1.8
ms
tcmd(ent)
enter command mode time after power on
16
-
26
ms
Min
Typ
Max
Unit
after an ideal mechanical angle
step of 45, until 90 % of the
final value is reached;
CL = 5 nF
Table 13. Digital interface
Characteristics are valid for the operating conditions, as specified in Section 9.
Symbol
Parameter
VIH
HIGH-level input voltage
80
-
-
%VDD
VIL
LOW-level input voltage
-
-
20
%VDD
VOH
HIGH-level output voltage
IO = 2 mA
80
-
-
%VDD
VOL
LOW-level output voltage
IO = 2 mA
-
-
20
%VDD
Iod
overdrive current
absolute value for overdriving
the output buffer
-
-
20
mA
tstart
start time
LOW level before rising edge
5
-
-
s
tstop
stop time
HIGH level before falling edge
5
-
-
s
Tbit
bit period
minimum period may be limited
by the load capacitance
10
-
100
s
tw0
pulse width 0
0.175Tbit
0.25Tbit
0.375Tbit
s
tw1
pulse width 1
0.625Tbit
0.75Tbit
0.825Tbit
s
tto
time-out time
-
-
220
s
KMA199E
Product data sheet
Conditions
digital communication reset
guaranteed after maximum tto
All information provided in this document is subject to legal disclaimers.
Rev. 2 — 7 December 2011
© NXP B.V. 2011. All rights reserved.
10 of 32
KMA199E
NXP Semiconductors
Programmable angle sensor
Table 13. Digital interface …continued
Characteristics are valid for the operating conditions, as specified in Section 9.
Symbol
Parameter
Conditions
Min
Typ
Max
Unit
Tbit
bit period deviation
deviation between received
clock and sent clock
0.8Tbit
1Tbit
1.2Tbit
s
ttko(slv)
slave takeover time
duration of LOW level for slave
takeover
1
-
5
s
ttko(mas)
master takeover time
duration of LOW level for
master takeover
0Tbit
-
0.5Tbit
s
tprog
programming time
for a single EEPROM address
20
-
-
ms
tcp
charge pump time
waiting time after enabling the
EEPROM charge pump clock
1
-
-
ms
12. Definition of errors
12.1 General
Angular measurement errors by the KMA199E result from linearity errors, temperature
drift errors and hysteresis errors. Figure 5 shows the output signal of an ideal sensor,
where the measured angle meas corresponds ideally to the magnetic field angle . This
curve will further be denoted as angle reference line ref() with a slope of 0.5 %VDD/deg.
φmeas
(deg)
φref(α)
180
α (deg)
001aag812
Fig 5. Definition of the reference line
For valid definition of errors, the angular range is set to max = 180 and the clamping
voltages are programmed to V(CL)l = 5 %VDD and V(CL)u = 95 %VDD.
12.2 Hysteresis error
The hysteresis error hys is defined as the maximum difference between angles, given by
the device output when performing a positive (clockwise) rotation and negative (counter
clockwise) rotation over an angular range of 180, measured at a constant temperature.
KMA199E
Product data sheet
All information provided in this document is subject to legal disclaimers.
Rev. 2 — 7 December 2011
© NXP B.V. 2011. All rights reserved.
11 of 32
KMA199E
NXP Semiconductors
Programmable angle sensor
φmeas
(deg)
Δφhys
180
α (deg)
001aag813
Fig 6. Definition of the hysteresis error
12.3 Linearity error
The deviation of the KMA199E output signal from a best straight line BSL, with the same
slope as the reference line, is defined as linearity error. For measurement of this linearity
error, the magnetic field angle is varied at fixed temperatures. The deviation of the output
signal from the best straight line at the given temperature is the linearity error lin. It is a
function of the magnetic field angle and the temperature of the device Tamb.
φmeas
(deg)
φBSL(α, Tamb)
φref(α)
Δφlin(α, Tamb)
180
α (deg)
001aag814
Fig 7. Definition of the linearity error
12.4 Microlinearity error
The microlinearity error lin is the deviation of the device output from 1, if the magnetic
field angle is changed by = 1.
φmeas
(deg)
φref(α)
Δφmeas = 1° + Δφμlin(α)
Δα = 1°
α (deg)
001aag815
Fig 8. Definition of the microlinearity error
KMA199E
Product data sheet
All information provided in this document is subject to legal disclaimers.
Rev. 2 — 7 December 2011
© NXP B.V. 2011. All rights reserved.
12 of 32
KMA199E
NXP Semiconductors
Programmable angle sensor
12.5 Temperature drift error
The temperature drift temp is defined as the envelope over the deviation of the angle
versus the temperature range. It is considered as the pure thermal effect.
φmeas
(deg)
Ty
Tx
Δφtemp
180
α (deg)
001aag816
Fig 9. Definition of the temperature drift error
Following mathematical description is given for temperature drift value temp:
temp() = meas( , T x) – meas( , T y)
(1)
with:
Tx: temperature for maximum meas at angle
Ty: temperature for minimum meas at angle
The deviation from the value at room temperature tempRT describes the temperature
drift of the angle, compared to the value, which the sensor provides at room temperature:
temp
RT( ,
T amb) = meas( , T amb) – meas( , T RT)
(2)
with:
TRT: room temperature (25 C)
13. Programming
13.1 General description
The KMA199E provides an OWI for programming. For this purpose the pin OUT/DIGINT
can be used bidirectional.
In general the device runs in analog output mode, the normal operation mode, which is
configured by the on-chip programmed data and will be started by default after a power-on
reset and the time ton. In this mode the magnetic field angle is converted into a
corresponding output voltage.
KMA199E
Product data sheet
All information provided in this document is subject to legal disclaimers.
Rev. 2 — 7 December 2011
© NXP B.V. 2011. All rights reserved.
13 of 32
KMA199E
NXP Semiconductors
Programmable angle sensor
For programming the command mode has to be entered. In this mode the customer can
adjust all required parameters (like zero angle and angular range for example) to his own
application. The data can be stored in the EEPROM, after enabling the internal charge
pump and waiting for tcp. After changing EEPROM constants, the checksum has to be
recalculated and written (see Section 13.4).
In order to enter the command mode, a specific command sequence has to be sent after a
power-on reset and during the time slot tcmd(ent). For this purpose the external source,
which is used to send the command sequence, has to overdrive the output buffer of the
KMA199E, hence it has to provide the current Iod.
During the communication, the KMA199E is always the slave and the external
programming hardware is always the master. Figure 10 illustrates the structure of the OWI
data format.
write
IDLE
START COMMAND DATA BYTE 1 DATA BYTE 2 STOP
IDLE
read
IDLE
START COMMAND HANDOVER DATA BYTE 1 DATA BYTE 2 TAKEOVER STOP IDLE
001aag742
Fig 10. OWI data format
The master has to provide the start condition, which is a rising edge after a LOW level.
Then a command byte is sent, which can be either a read or a write command. Depending
on the command, the master or the slave has to send the data immediately after the
command sequence. In case of a read command, an additional handover or takeover bit
respectively is inserted before and after the data bytes. Each communication has to be
closed with a stop condition driven by the master. If the slave gets no rising edge for a
time longer than tto, a time-out condition will be recognized. Then the bus is reset to the
idle state and waits for a start condition and a new command. This can be used to
synchronize the device regardless of the state before.
All communications are based on this structure (see Figure 10), even for entering the
command mode. In this case a special write command is required, followed by the
command sequence (two data bytes). The customer can access the EEPROM, the
CTRL1, the TESTCTRL0 and the SIGNATURE register, which are described in
Section 13.5. Only a power-on reset will leave the command mode. A more detailed
description of the programming is given in the next sections.
13.2 Timing characteristics
As described in the previous section, a start and stop condition is necessary for
communication. The duration of the LOW level before the rising edge of the start condition
is defined as tstart and the duration of the HIGH level after the rising edge of the stop
condition is defined as tstop. These parameters, as well as all other timing characteristics
can be found in Table 13.
KMA199E
Product data sheet
All information provided in this document is subject to legal disclaimers.
Rev. 2 — 7 December 2011
© NXP B.V. 2011. All rights reserved.
14 of 32
KMA199E
NXP Semiconductors
Programmable angle sensor
tstart
tstop
001aag817
Fig 11. OWI start and stop condition
Figure 12 shows the coding of a single bit with a HIGH level of VIH and a LOW level of VIL.
Here the pulse width t1 or t0 respectively represents a logic 1 or a logic 0 of a full bit period
Tbit.
bit = 0
bit = 1
Tbit
0.175
Tbit
0.375
0.625
tw0
0.825
tw1
0.25
0.75
001aag818
Fig 12. OWI timing
13.3 Sending and receiving data
For sending or receiving data, the master has to control the communication. The
command byte defines the region, address and type of command, which is requested by
the master, that is either a read or a write command. In case of a read command, an
additional handover or takeover bit respectively has to be inserted before and after the
two data bytes (see Figure 10). However the OWI is a serial data transmission, whereas
the Most Significant Byte (MSB) must be sent at first.
Table 14.
Format of a command byte
7
6
5
4
3
2
1
0
CMD7
CMD6
CMD5
CMD4
CMD3
CMD2
CMD1
CMD0
Table 15.
Command byte bit description
Bit
Symbol
Description
7 to 5
CMD[7:5]
region bits
000 = 16-bit EEPROM
001 to 011 = reserved
100 = 16-bit register
101 to 111 = reserved
4 to 1
CMD[4:1]
address bits
0
CMD0
read/write
0 = write
1 = read
KMA199E
Product data sheet
All information provided in this document is subject to legal disclaimers.
Rev. 2 — 7 December 2011
© NXP B.V. 2011. All rights reserved.
15 of 32
KMA199E
NXP Semiconductors
Programmable angle sensor
A more detailed description of all registers, that can be accessed by the customer, is given
in Section 13.5. Both default value and the complete command, which already includes
the address and write or read request respectively, is listed there.
13.3.1 Write access
In order to write data into the EEPROM, the internal charge pump must be enabled at first
by setting the bits EEP_CP_CLOCK_EN and EEP_WRITE_EN and waiting for tcp.
Afterwards the following procedure must be done:
•
•
•
•
Start condition: The master drives a rising edge after a LOW level
Command: The master sends a write command, that is the last bit is not set
Data: The master sends two data bytes
Stop condition: The master drives a rising edge after a LOW level
Figure 13 shows the write access of the digital interface. The signal OWI represents the
data on the bus, which is either caused by the master or by the slave. The signals master
output enable and slave output enable just symbolize if the master or the slave output is
enabled or disabled respectively.
START
CMD7
CMD0
WDATA15
WDATA0
STOP
IDLE
master
output
enable
OWI
(2)
slave
output
enable
(1)
001aag743
(1) Missing rising edges generate a time-out condition and the written data is ignored.
(2) If the master might not drive the bus, the bus is defined by the bus-pull.
Fig 13. OWI write access
Note: As already mentioned in Section 13.1, even the command mode has to be entered
using the write procedure. Without entering the command mode a digital communication
is not possible and the sensor would work in normal operation mode. After changing a
single address the time tprog must elapse before changing another address. Finally the
checksum has to be recalculated and written, after changing the EEPROM constants
(see Section 13.4).
KMA199E
Product data sheet
All information provided in this document is subject to legal disclaimers.
Rev. 2 — 7 December 2011
© NXP B.V. 2011. All rights reserved.
16 of 32
KMA199E
NXP Semiconductors
Programmable angle sensor
13.3.2 Read access
In order to read data from the sensor, the following procedure must be done:
• Start condition: The master drives a rising edge after a LOW level
• Command: The master sends a read command, that is the last bit is set
• Handover: The master sends a handover bit, that is a logic 0 and disables his output
after a three-quarter bit period
• Takeover: The slave drives a LOW level after the falling edge for ttko(slv)
• Data: The slave sends two data bytes
• Handover: The slave sends a handover bit, that is a logic 0 and disables his output
after a three-quarter bit period
• Takeover: The master drives a LOW level after the falling edge for ttko(mas)
• Stop condition: The master drives a rising edge after a LOW level
Figure 14 shows the read access of the digital interface. The signal OWI represents the
data on the bus, which is either caused by the master or by the slave. The signals master
output enable and slave output enable just symbolize if the master or the slave output is
enabled or disabled respectively.
START
CMD7
CMD0
HANDSHAKE
RDATA15
RDATA0
HANDSHAKE
STOP
IDLE
master
output
enable
(3)
OWI
(5)
(1)
slave
output
enable
(2)
(2)
(4)
001aag744
(1) Duration of LOW level for slave takeover ttko(slv).
(2) There is an overlap in the output enables of master and slave, because both drive a LOW
level. However this ensures the independency from having a pull-up or pull-down on the bus.
In addition it improves the ElectroMagnetic Compatibility (EMC) robustness, because all levels
are actively driven.
(3) Duration of LOW level for master takeover ttko(mas).
(4) If the master does not take the bus and a pull-up exists, the stop condition is generated by the
pull-up. Otherwise a time-out is generated if there is a pull-down and the slave waits for a rising
edge as start condition.
(5) If the master might not drive the bus, the bus is defined by the bus-pull.
Fig 14. OWI read access
KMA199E
Product data sheet
All information provided in this document is subject to legal disclaimers.
Rev. 2 — 7 December 2011
© NXP B.V. 2011. All rights reserved.
17 of 32
KMA199E
NXP Semiconductors
Programmable angle sensor
13.3.3 Entering the command mode
After a power-on reset, the sensor provides a time slot tcmd(ent) for entering the command
mode. For this purpose a specific command sequence has to be sent (see Figure 15).
Without entering the command mode, the sensor starts in normal operation mode.
However the signature can always be written by the master, if the sensor switches into
diagnostic mode.
During the command mode sequence, the analog output is enabled, hence the external
programming hardware has to overdrive the output with the current Iod. If the command
mode is activated, the analog output will be disabled and the pin OUT/DIGINT works as a
digital interface.
tcmd(ent)
VDD
OWI
START
94h
command
9Bh
A4h
STOP
signature
001aag819
Fig 15. OWI command mode procedure
13.4 Cyclic redundancy check
As already mentioned in Section 6, there is an 8-bit checksum of the EEPROM data. In
order to calculate this value, a CRC has to be generated with the MSB of the EEPROM
data word at first over all corresponding addresses in increasing order.
For calculating the checksum, all addresses from 0h to Fh have to be read out and
consulted. The Least Significant Byte (LSB) of address Fh, which contains the previous
checksum, must be overwritten with 0h before the calculation can be started.
Finally the internal charge pump has to be enabled for programming by setting the bits
EEP_CP_CLOCK_EN and EEP_WRITE_EN (see Table 16) and waiting for tcp.
The generator polynomial for the calculation of the checksum is:
8
2
G(x) = x + x + x + 1
(3)
With a start value of FFh and the data bits are XOR at x8 point.
KMA199E
Product data sheet
All information provided in this document is subject to legal disclaimers.
Rev. 2 — 7 December 2011
© NXP B.V. 2011. All rights reserved.
18 of 32
KMA199E
NXP Semiconductors
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
42
#include
// 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;
//index variable
for (i = 15; i >= 0; i--)
{
crc