Magnetic valuesConfigurationDiagnosis
Temperature valuesConfi guration busRes erved bitsParity bits and related registers (colour)
TLI493D-A2B6
I2C Registers
1I
2
C Registers
The TLI493D-A2B6 includes several registers that can be accessed via Inter-Integrated Circuit interface (I2C) to
read data as well as to write and configure settings.
1.1Registers overview
A bitmap overview is presented in Figure 1. Basically the following sections are available:
•measurement data (green bits in registers 00
•sensor status and diagnostics (grey bits in registers 05
•configuration parameters such as the power mode (orange bits in registers 10
H
r
r
r
till 05H)
H
, 06H, 10H and 11H)
H
H
H
H
H
, 11H and 13H)
H
H
rr
Diag (06H)P FFCF TPD3PD012
H
H
Figure 1 TLI493D-A2B6 Bitmap
The diagnostic register 06
and marks the relationship of the sections to this flags with different colored lines/frames around the bit
H
H
0B
H
H
Reserved
contains parity information as a diagnostic mechanism. The bitmap illustrates this
FRM
rwr
H
H
H
H
rw
rr
rwrw
Reserved
rw
contents.
User Manual3Ver. 1.11
2019-05-28
Page 4
TLI493D-A2B6
I2C Registers
Table 1 Registers overview
Register nameRegister long nameAddress
Bx, By and BzMagnetic values MSBs00
TempTemperature value MSBs03
Bx2Magnetic values LSBs04
Temp2Temperature and magnetic LSBs and device address05
DiagSensor diagnostic and status register06
ConfigConfiguration register10
MOD1Power mode, interrupt, address, parity11
MOD2Low Power Mode update rate13
VerVersion register16
, 01H, 02
H
H
H
H
H
H
H
H
H
H
1.2Register descriptions
The I2C registers can be read or written at any time. It is recommended to read measurement data in a
synchronized fashion, i.e. after an interrupt pulse (/INT). This avoids reading inconsistent sensor or diagnostic
data, especially in fast mode. Additionally, several flags can be checked to ensure the register values are
consistent and the ADC was not running at the time of readout.
1.2.1Bit types
The TLI493D-A2B6 contains read bits, write bits and reserved bits.
Table 2 Bit Types
AbbreviationFunctionDescription
rReadRead-only bits
rwRead WriteReadable and writable bit
ReservedBits that must keep the default values (read prior to write required)
1.2.2Measurement data and registers combined in the I2C parity bit “P”
The I2C communication of the registers in this chapter is protected with the parity bit “P”, described in the Diag
register with the address 06
To make sure all data is consistent, the registers from 00
Otherwise, the sampled data (X, Y, Z, Temperature) may correspond to different conversion cycles.
. See also Figure 1 - parity bits and related registers.
H
to 06H should be read with the same I2C command.
H
User Manual4Ver. 1.11
2019-05-28
Page 5
70
Bx, By and Bz (11...4)
70
Temp (11...4)
70
Bx (3...0)
By (3...0)
43
TLI493D-A2B6
I2C Registers
Magnetic values MSBs
Register namesAddressReset Value
Bx, By and Bz00
01H 02
H
FieldBitsTypeDescription
Bx, By and Bz7:0rBx, By and Bz values
Signed value as two’s complement from the HALL probes in the x, y and zdirection of the magnetic field. Contains the eight Most Significant Bits.
If Bz is deactivated the Bz value is the reset value.
H
80
H
Back to TLI493D-A2B6 Bitmap.
Temperature value MSBs
Register nameAddressReset Value
Temp03
H
80
FieldBitsTypeDescription
Temp7:0rTemperature value
Signed value as two’s complement.
If the temperature measurement is deactivated, the Temp value is the
reset value.
Back to TLI493D-A2B6 Bitmap.
H
Magnetic values LSBs
Register nameAddressReset Value
Bx204
User Manual5Ver. 1.11
H
00
2019-05-28
H
Page 6
70
Bz (3...0)
43
Temp (3...2)
ID
65
TLI493D-A2B6
I2C Registers
FieldBitsTypeDescription
Bx7:4rBx value
Signed value as two’s complement from the HALL probes in the xdirection of the magnetic field.
Contains the four Least Significant Bits.
By3:0rBy value
Signed value as two’s complement from the HALL probes in the ydirection of the magnetic field.
Contains the four Least Significant Bits.
Back to TLI493D-A2B6 Bitmap.
Temperature and magnetic LSBs and device address
Register nameAddressReset Value
Temp205
H
00
FieldBitsTypeDescription
Temp7:6rTemperature value
Signed value as two’s complement.
If the temperature measurement is deactivated, the Temp value is the
reset value.
ID5:4rID
Readback of the sensor ID, from IICadr. µC shall verify the address sent by
the sensor. See Table 4.
Bz3:0rBz value
Signed value as two’s complement from the HALL probes in the zdirection of the magnetic field.
Contains the four Least Significant Bits.
If Bz is deactivated the Bz value is 0
.
H
H
Back to TLI493D-A2B6 Bitmap.
User Manual6Ver. 1.11
2019-05-28
Page 7
70
CP
6
5
4
3
21
TL_magX2AMDTTRIG
TLI493D-A2B6
I2C Registers
1.2.3Configuration registers combined in the I2C parity flag “CF”
The I2C communication of the registers in this chapter is protected by the parity bit CF, which is described in
the Diag register with the address 06
Configuration register
Register nameAddressReset Value
Config10
. See also Figure 1 - parity bits and related registers.
H
H
00
H
FieldBitsTypeDescription
DT7rwDisable Temperature
temperature measurement is enabled.
If 0
B
If 1
temperature measurement is disabled. This means the Bx, By and Bz
B
channels are measured. The Temp channel is disabled and contains the
reset value until a new conversion with Temp is done.
AM6rwX/Y Angular Measurement
the Bz measurement is enabled.
If 0
B
If 1
and the DT bit = 1B the Bz measurement is disabled. This means the
B
Bx and By channel is measured. The channels Bz and Temp contain the
reset values until a new conversion with Bz and Temp is done.
Note: If the DT bit = 0
, the AM bit don’t care.
B
TRIG5:4rwTrigger options
If PR bit = 1
(1-byte read protocol), the TRIG bits define the trigger mode
B
of the device:
If 00
no ADC trigger on read.
B
If 01
ADC trigger on read before first MSB.
B
ADC trigger on read after register 05H.
If 1x
B
If PR bit = 0
these bits have no effect.
B
X23rwShort-range sensitivity
When this bit is set, the sensitivity of the Bx, By, and Bz ADC-conversion is
doubled by a longer ADC integration time. The Temp result will not
change, neither in sensitivity nor conversion time. See Table 3.
TL_mag2:1rwMagnetic temperature compensation
There are two bits for setting the sensitivity over temperature of the
sensor to compensate a magnet temperature coefficient.
If 00
→ TC0 (no compensation)
B
→ TC1
If 01
B
If 10
→ TC2
B
If 11
→ TC3
B
CP0rwConfiguration parity
The register 10
this parity is OK and the CF bit in the status register 06
User Manual7Ver. 1.11
is even parity protected with this bit. On startup or reset,
1.2.4Mode registers combined in the I2C parity flag “FF”
The I2C communication of the registers in this chapter is protected with the parity bit “FF”, described in the
Diag register with the address 06
. See also Figure 1 - parity bits and related registers.
H
Power mode, interrupt, address, parity
Register nameAddressReset Value
MOD111
H
00
FieldBitsTypeDescription
H
FP7rwFuse parity
The registers 11
and 13H (bit 7) are odd parity protected with this bit.
H
If this parity bit is incorrect please see FF bit.
To exit this state a sensor reset is necessary.
IICadr6:5rwI
2
C address
Bits can be set to 00
, 01B, 10B or 11B to define the slave address in bus
B
configuration.
See Table 4 and data sheet.
PR4rwI2C 1-byte or 2-byte read protocol
this is the 2-byte read protocol:
If 0
B
<start> <I2Cadr.> <reg.adr.> <data of reg.adr.> <data of reg.adr.+1> ….
<stop>
If 1
this is the 1-byte read protocol:
B
<start> <I2Cadr.> <data of reg.00
See Chapter 2.1.3
CA3rwCollision avoidance
Clock stretching only in master-controlled and low-power mode, not in
fast mode.
The CA bit interacts with the INT bit, see Table 5 and Chapter 2.2.
> <data of reg.01H> …. <stop>
H
User Manual8Ver. 1.11
2019-05-28
Page 9
TLI493D-A2B6
I2C Registers
FieldBitsTypeDescription
INT2rwInterrupt enabled
/INT disabled
If 1
B
If 0
/INT enabled: After a completed measurement and ADC-conversion,
B
an /INT pulse will be generated.
For bus configurations /INT timing constraints between I
and interrupt pulses must be monitored and aligned.
The INT bit interacts with the CA bit, see Table 5.
MODE1:0rwPower mode
Low Power Mode:
If 00
B
Cyclic measurements and ADC-conversions with a update rate, defined in
the PRD registers. “No ADC trigger” must be used, see Table 6 and TRIG.
If 01
Master Controlled Mode (Power Down mode):
B
Measurement triggering depends on the PR bit and is possible with I
sub address byte (see Table 6) or TRIG bits.
If 10
is reserved and must not be used.
B
If 11
Fast Mode:
B
The measurements and ADC-conversions are running continuously. It is
recommended to set INT = 0
2
C data transfers
and use a I2C clock speed ≥ 800 kHz.
B
2
C
Back to TLI493D-A2B6 Bitmap.
Table 4 Device address overview
The addresses are selected to ensure a minimum Hamming distance of 4 between them.
In case the microcontroller tries to read sensor data the clock stretching pulls the SCL /INT line to low, as long
as the measurement and ADC-conversion is not finished.
CAINTConfiguration
0
0
B
/INT is enabled and will not be transmitted between <START> and <STOP>.
B
/INT collision avoidance active.
1
0
B
/INT disabled. Clock stretching enabled.
B
Suppress sensor read out during ongoing ADC conversion.
This configuration must not be used with the “read” trigger-bits (7:5) = 010
or with the trigger option TRIG bit = 01
1
0
B
/INT is enabled and will be transmitted between <START> and <STOP>.
B
/INT may collide with I
2
C clock from microcontroller.
.
B
or 011B (see Table 6)
B
1
1
B
/INT disabled. Clock stretching disabled.
B
Unsynchronized sensor readouts may collide with ADC conversion.
User Manual9Ver. 1.11
2019-05-28
Page 10
70
PRD
Reserved
6
70
FRM
6
5
4
3
2
1
PD0PD3TCFFFP
TLI493D-A2B6
I2C Registers
Low Power Mode update rate
Register nameAddressReset Value
MOD213
FieldBitsTypeDescription
PRD7rwUpdate rate settings
If 0
If 1
B fUpdate
B fUpdate
= fast.
= slow.
Reserved6:0Factory settings
H
(bits 7:5) 000
B
Back to TLI493D-A2B6 Bitmap.
1.2.5Diagnostic, status and version registers
The device provides diagnostic and status information in register 06H and version information in register 16H.
Sensor diagnostic and status register
Register nameAddressReset Value
Diag06
FieldBitsTypeDescription
P7r Bus parity
This bit adds up to an odd parity of the registers 00
(including 05
), described in Chapter 1.2.2.
H
The parity bit is generated during the I
register byte and acknowledge bits are not included in the parity sum.
If the parity calculated by the microcontroller after I
these values must be treated as invalid.
H
through 05H
H
2
C readout. The address byte,
2
C reads is incorrect,
60
H
User Manual10Ver. 1.11
2019-05-28
Page 11
TLI493D-A2B6
I2C Registers
FieldBitsTypeDescription
FF6r Fuse parity flag
Provid es a flag from the internal fuse p arity check of registers 11
(bit 7). This parity check includes the FP bit.
If 1
parity is OK.
B
If 0
the parity is not correct. The sensor must be considered defective
B
and must no longer be used. A sensor with an invalid fuse parity
disconnects its SDA. It will automatically go to low-power mode and only
uses the /INT signal to communicate the error (collision avoidance is
enabled).
CF5rConfiguration parity flag
Provides a flag from the internal configuration parity check of register
10
. This parity check includes the CP bit.
H
After startup or after reset the CP bit is true.
If 1
parity is OK.
B
parity is not OK.
If 0
B
T4r T bit
data in registers 00H till 05H are invalid measurement data.
If 1
B
If 0
data in registers 00H till 05H are valid measurement data.
B
PD33rPower-down flag 3
If 1
ADC-conversion of Temp is completed and valid measurement data
B
can be read out. Thus it must be 1
ADC-conversion of Temp is running and read measurement data are
If 0
B
invalid. Any readout with PD3 bit = 0
At startup, this is 0
value then changes to 1
PD02rPower-down flag 0
the ADC conversion of Bx is completed and valid measurement data
If 1
B
can be read out. Thus it must be 1
If 0
the ADC conversion of Bx is running and read measurement data are
B
invalid. Any readout with PD0 bit = 0
At startup, this is 0
value then changes to 1
FRM1:0rFrame counter
Increments at every updated ADC-conversion, once a X/Y/Z/T or X/Y/Z or
X/Y conversion is completed and the new measurement data have been
stored in the registers 00
The microcontroller shall check if bits change in consecutive conversion
runs.
until one ADC conversion has been performed. The
B
until one ADC conversion has been performed. The
B
.
B
.
B
till 05H.
H
at readout.
B
should be considered invalid.
B
at readout.
B
should be considered invalid.
B
and 13H
H
Back to TLI493D-A2B6 Bitmap.
User Manual11Ver. 1.11
2019-05-28
Page 12
70
Reserved
HWV
43
TYPE
65
TLI493D-A2B6
I2C Registers
Version register
Register nameAddressReset Value
Ver16
FieldBitsTypeDescription
Reserved7:6Factory settings
TYPE5:4rChip feature
If 11
: device without Wake Up feature.
B
HWV3:0rHardware revision
If 9
it is the B21 design step.
H
H
C9H, D9H or E9
H
Back to TLI493D-A2B6 Bitmap.
User Manual12Ver. 1.11
2019-05-28
Page 13
TLI493D-A2B6
I2C Interface
2I
The TLI493D-A2B6 uses Inter-Integrated Circuit (I2C) as the communication interface with the microcontroller.
2
The I
C interface has three main functions:
•Sensor configuration.
•Transmit measurement data.
•Interrupt handling.
This sensor provides two I
•16-bit read frame (µC is driving data), so called 2-byte read command.
•8-bit read frame (µC is driving data), so called 1-byte read command.
2
C Interface
2
C read protocols:
2.1I2C protocol description
The TLI493D-A2B6 provides one I2C write protocol, based on 2 bytes and two I2C read protocols. Default is the
2-byte read protocol. With the PR bit it can be selected, if the 1-byte read protocol or the 2-byte read protocol
is used.
2.1.1General description
•The interface conforms to the I2C fast mode specification (400kBit/sec max.), but can be driven faster
according to the data sheet.
•The TLI493D-A2B6 does not support “repeated starts”. Each addressing requires a start condition.
•The interface can be accessed in any power mode.
•The data transmission order is Most Significant Bit (MSB) first, Least Significant Bit (LSB) last.
2
•A I
•Bit transfer occur when the SCL line is “high”.
•Each byte is followed by one ACK bit. The ACK bit is always generated by the recipient of each data byte.
C communication is always initiated with a start condition and concluded with a stop condition by the
master (microcontroller). During a start or stop condition the SCL line must stay “high” and the SDA line
must change its state: SDA line falling = start condition and SDA line rising = stop condition.
- If no error
- If an error
- If the communication is finished (before the Stop condition), the ACK bit must be set to “high”.
occurs during the data transfer, the ACK bit will be set to “low”.
occurs during the data transfer, the ACK bit will be set to “high”.
2.1.2I2C write command
Write I2C communication description:
•The purpose of the sensor address is to identify the sensor with which communication should occur. The
sensor address byte is required independently of the number of sensors connected to the microcontroller.
•The register address identifies the register in the bitmap (according to Figure 1) with which the first data
byte will be written.
•Data bytes are transmitted as long as the SCL line generates pulses. Each additional data byte increments
the register address until the stop condition occurs.
•Bytes transmitted beyond the register address frame are ignored and the corresponding ACK bit is sent
“high”, indicating an error.
User Manual13Ver. 1.11
2019-05-28
Page 14
SCL
SDA
I2C master is driving data (µC)I2C slave is driving data (sensor)
ACKACKACKWrite dataSensor address
Register
address
Trigger
bits
TLI493D-A2B6
I2C Interface
2
C write communication frame consists of:
The I
•The start condition.
•The sensor address, according to Table 4.
•Write command bit = “low” (read = “high”).
•Acknowledge ACK.
•Trigger bits, according to Table 6.
•The register address, according to Figure 1.
•Acknowledge ACK.
•Writing of one or several bytes to the sensor, each byte followed by an acknowledge ACK.
•The stop condition.
Figure 2 General I2C write frame format: Write data from microcontroller to sensor
2
Trigger bits in the I
The trigger bits are used in Power Down Mode. The Power Down Mode is used in the Master Controlled Mode,
when no measurement is running. Thus the trigger bits are relevant for the Master Controlled Mode as well.
For a more silent measurement environment it is recommended to separate the measurement and the
communication as much as possible, by using the trigger bits = 001
between two measurements with reduced overlap of measurement and communication.
Table 6 I
Read/Write
command
0
B
0
B
0
B
0
B
0
B
0
B
0
B
0
B
1
B
1
B
1
B
1
B
C protocol
2
C trigger bits
Triggerbit 7
0
B
0
B
0
B
0
B
1
B
1
B
1
B
1
B
0
B
0
B
0
B
0
B
Triggerbit 6
0
B
0
B
1
B
1
B
0
B
0
B
1
B
1
B
0
B
0
B
1
B
1
B
Triggerbit 5
0
B
1
B
0
B
1
B
0
B
1
B
0
B
1
B
0
B
1
B
0
B
1
B
or trigger bits = 100B and communicate
B
Trigger command
no ADC trigger
ADC trigger after write frame is finished, Figure 4
no ADC trigger
ADC trigger after write frame is finished, Figure 4
no ADC trigger
ADC trigger after write frame is finished, Figure 4
no ADC trigger
must not be used
no ADC trigger
no ADC trigger
ADC trigger before first MSB, Figure 3
ADC trigger before first MSB, Figure 3
User Manual14Ver. 1.11
2019-05-28
Page 15
SCL
SDA
I2C master is driving data (µC)I2C slave is driving data (sensor)
ACK
Read data
Sensor address
Register
address
ADC
ACKACK
ADC conversion
SCL
SDA
I2C master is driving data (µC)I2C slave is driving data (sensor)
ACK
Write data
Sensor address
Register
address
ADC
ACKACK
ADC conversion
SCL
SDA
I2C master is driving data (µC)I2C slave is driving data (sensor)
ACK
Read data
Sensor address
Register
address
ADC
ACKACK
ADC conversion
ACK
Read data 06
H
Read data 05
H
ACK
TLI493D-A2B6
I2C Interface
2
Table 6 I
C trigger bits (cont’d)
Read/Write
command
1
B
1
B
1
B
1
B
Triggerbit 7
1
B
1
B
1
B
1
B
Triggerbit 6
0
B
0
B
1
B
1
B
Triggerbit 5
0
B
1
B
0
B
1
B
Trigger command
ADC trigger after register 05H, Figure 5
ADC trigger after register 05H, Figure 5
ADC trigger after register 05H, Figure 5
must not be used
Figure 3 ADC trigger before sending first MSB of data registers, I2C trigger bits 010
.
B
Figure 4 ADC trigger after write frame is finished, I2C trigger bits 001
.
B
Figure 5 ADC trigger after register 05
User Manual15Ver. 1.11
, I2C trigger bits 100B.
H
2019-05-28
Page 16
011010100 000100010 x00001010
SCL
SDA
I2C master is driving data (µC)I2C slave is driving data (sensor)
ACKACKACK
TLI493D-A2B6
I2C Interface
Example I2C write communication
An example of a write communication is provided in Figure 6.
In this example the sensor with the address 6A
•Master Controlled Mode,
•/INT disabled,
•Clock stretching enabled,
•No trigger of a measurement.
•Other settings should be kept as is.
Implementation:
•The microcontroller generates a start condition.
•Configuration changes can only be performed with a write command. The address for write operation of
this sensor is 6A
= 01101010B.
H
•If the sensor detects no error, the ACK = 0
•No measurement is performed if the trigger bits = 000
•The register to change the required settings is 11
•If the sensor detects no error, the ACK = 0
•The parity bit “FP” is the odd parity of the registers 11
possible to quantify it in this example.
•The sensor address should not be changed, i.e. the sensor address 6A
bits = 00
, see IICadr registers.
B
•The 2-byte protocol should be kept as is. Thus the PR bit = 0
•In order to enable clock stretching and disable /INT the CA bit must be set to 0
(see Table 5).
to 1
B
•To use the Master Controlled Mode the MODE bits must be set to 01
•If the sensor detects no error the ACK = 0
•The microcontroller generates the stop condition.
/ 6BH (see Table 4) should be configured for:
H
is transmitted back to the microcontroller.
B
.
B
according the bitmap Figure 1 = 10001B.
H
is transmitted back to the microcontroller.
B
and 13H (bits 7:5), see FP register, thus it is not
H
/ 6BH sh ould be k ept . Thu s th e IICadr
H
.
B
and the INT bit must be set
B
.
B
is transmitted back to the microcontroller.
B
Figure 6 Example I2C frame format 2-byte: Write data from microcontroller to sensor
User Manual16Ver. 1.11
2019-05-28
Page 17
SCL
SDA
I2C master is driving data (µC)I2C slave is driving data (sensor)
ACKACK
ACK
Register
address
Read data
Sensor address
Trigger
bits
TLI493D-A2B6
I2C Interface
2.1.3I2C read commands
Read I2C communication description:
•The purpose of the sensor address is to identify the sensor with which communication should occur. The
sensor address byte is required independently of the number of sensors connected to the microcontroller.
•Only available in the 2-byte read command: The register address identifies the register in the bitmap
(according Figure 1) from which the first data byte will be read.
In the 1-byte read command the read out starts always at the register address 00
•As many data bytes will be transferred as long as pulses are generated by the SCL line. Each additional data
byte increments the register address. Until the stop condition occurs.
.
H
•If bytes are read beyond the register address frame the sensor keeps the SDA = 1
•If the microcontroller reads data and does not acknowledge the sensor data (ACK = 1
the SDA = 1
until the next stop condition.
B
.
B
) the sensor keeps
B
2.1.3.12-byte read command
The I2C read communication frame consists of:
•The start condition.
•The sensor address, according to Table 4.
•Read command bit = “high” (write = “low”).
•Acknowledge ACK.
•Trigger bits, according to Table 6.
•The register address, according to Figure 1.
•Acknowledge ACK.
•Reading of one or several bytes from the sensor, each byte followed by an acknowledge ACK.
•The stop condition.
Figure 7 General I2C frame format 2-byte: Read data from sensor to microcontroller
2.1.3.21-byte read command
The 1-byte read mode can be entered, by configuring the PR bit with an write communication. E.g. with the
write cycle:
•start condition
•6A
•11
•XXX1 XXXX
•stop condition
User Manual17Ver. 1.11
(sensor address)
H
(register address)
H
B
(PR bit = 1B)
2019-05-28
Page 18
SCL
SDA
I2C master is driving data (µC)I2C slave is driving data (sensor)
ACK
ACKRead data
Sensor address
TLI493D-A2B6
I2C Interface
2
C communication frame consists of:
The I
•The start condition.
•The sensor address, according to Table 4.
•Read command bit = “high” (write = “low”).
•Acknowledge ACK.
•Reading of one or several bytes from the sensor, each byte followed by an acknowledge ACK.
•The stop condition.
Figure 8 General I2C frame format 1-byte: Read data from sensor to microcontroller
Example I2C 1-byte read communication
An example of a read communication is provided in Figure 9.
In this example, the sensor with the address 6A
registers 00
- 05H and the diagnostic register 06H:
H
/ 6BH (see Table 4) should read out the measurement values,
H
Implementation:
•The microcontroller generates a start condition.
•The address for read operation of this sensor is 6B
= 01101011B. This address value must be transmitted
H
by the microcontroller to the sensor.
•If the sensor detects no error, the ACK = 0
is transmitted back to the microcontroller.
B
•The microcontroller must go on clocking the SCL line.
•The sensor transmits 8 data bits of register 00
•If the microcontroller detects no error the ACK = 0
to the microcontroller.
H
is transmitted back to the sensor.
B
•The microcontroller must go on clocking the SCL line.
•The sensor transmits 8 data bits of register 01
to the microcontroller.
H
•...
•After transmitting the register 06
the microcontroller transmits a NACK.
H
•The microcontroller generates the stop condition.
User Manual18Ver. 1.11
2019-05-28
Page 19
01101011001
SCL
SDA
I2C master is driving data (µC)I2C slave is driving data (sensor)
ACKACKNACK
0
ACKRead data reg. 00
H
Read data reg. 06
H
SCL
SDA
I2C master is driving data (µC)I2C slave is driving data (sensor)
ADC
conversion
Bz T
0
ACK Read data reg. 00
H
/INT
Corrupt data
01101011
TLI493D-A2B6
I2C Interface
Figure 9 Example I2C frame format 1-byte: Read data from sensor to microcontroller
2.2Collision avoidance and clock stretching
Using the configuration bits CA and INT, collision avoidance and clock stretching can be configured. An
overview is given in Table 5. An example without collision avoidance and clock stretching is shown in
Figure 10. In this example:
•the sensor interrupt disturbs the I2C clock, causing an additional SCL pulse which shifts the data read out
by one bit.
•the data read out starts when the ADC conversion is running.
Figure 10 Example without collision avoidance CA bit =1
and INT bit = 0
B
B
2.2.1Collision avoidance (CA bit = 0B and INT bit = 0B)
In a bus configuration combined with an activated interrupt signal /INT it must be assured, that during any
communication no interrupt /INT occurs. With collision avoidance enabled, the sensor monitors for any
start/stop condition, even if it does not detect a valid bus address. The interrupt signal /INT is omitted
whenever a start condition is detected, as shown in Figure 11, in contrast to Figure 10. Only after a stop
condition is detected, the interrupt signal /INT is generated by the sensor.
It is strongly recommended to use the collision avoidance feature whenever the interrupt signal /INT is used.
User Manual19Ver. 1.11
2019-05-28
Page 20
SCL
SDA
I2C master is driving data (µC)I2C slave is driving data (sensor)
ADC
conversion
Bz T
001
ACKACKNACK
0
ACKRead data reg. 00
H
Read data reg. 06
H
/INT
omitted
01101011
0
SCL
SDA
I2C master is driving data (µC)I2C slave is driving data (sensor)
ACK
1
Read data reg. 00
H
0
ADC
conversion
By Bz T
ACK
Clock stretching
01101011
NACK
TLI493D-A2B6
I2C Interface
Figure 11 Example with collision avoidance CA bit =0
and INT bit = 0
B
B
2.2.2Clock stretching (CA bit = 0B and INT bit = 1B)
With the clock stretching feature, the data read out starts after the ADC conversion is finished. Thus it can be
avoided that during an ADC conversion old or corrupted measurement results are read out, which may occur
when the ADC is writing to a register while this is being read out by the microcontroller. The clock stretching
feature is shown in Figure 12 in combination with a 1-byte read command. Clock stretching can also be used
with a 2-byte read command.
The sensor pulls the SCL line to low during the following situation:
•An ADC conversion is in progress.
•The sensor is addressed for register read (writes are never affected by clock stretching).
•The sensor is about to transmit the valid ACK in response to the I2C addressing of the microcontroller.
Figure 12 Example with clock stretching CA bit =0
and INT bit = 1
B
B
User Manual20Ver. 1.11
2019-05-28
Page 21
TLI493D-A2B6
I2C Interface
2.3Sensor reset by I2C
If the microcontroller is reset, the communication with the sensor may be corrupted, possibly causing the
sensor to enter an incorrect state. The sensor can be reset via the I
command sequence from the microcontroller to the sensor:
•Start condition,
•sending FF
•stop condition.
•Start condition,
•sending FF
•stop condition.
•Start condition,
•sending 00
•stop condition.
•Start condition,
•sending 00
•stop condition.
•30µs delay.
After a reset, the sensor must be reconfigured to the desired settings. The reset sequence uses twice the
identical data to assure a proper reset, even when an unexpected /INT pulse occurs.
Spikes can be interpreted as bus signals causing an action. E.g. when the collision avoidance feature is active
and if the SDA line spikes together with SCL line this could be interpreted as start condition, blocking further
/INT pulses until a stop condition appears on the bus. In such a case the sensor must be reset in order to
initialize it. If the sensor does not respond after the reset, it must be considered defective.
Such spikes may occur as the sensor powers up. Because of this we recommend to using the reset sequence
after each power up before configuring the sensor.
If the microcontroller resets during an ongoing I2C communication, the SDA line could get stuck low. This
would block the I2C bus and is a well-known limitation of the I2C interface. To recover from this situation
please use the reset sequence described in this chapter.
,
H
,
H
,
H
,
H
2
C interface by sending the following
User Manual21Ver. 1.11
2019-05-28
Page 22
system in it/INT handler
I²C: reset sensor
S FF
H
P, S FFH P,
S 00
H
P, S 00H P
I²C: write sensor
configuration
init I²C peripheral
configure interrupt
and enab le /INT pin
wait for /INT goes
high again
disa ble /INT pin
I²C: read sensor data
and diagnosis
enable /INT pin
return
I²C read
success ful?
/INT pulse
from sensor
application main
loop, takes sensor
data and errors for
process ing
Valid sensor
data?
handle I²C peripheral
(reconfiguration, …)
flag sensor error
no
flag new sensor data
no
Evaluate diagnosis
information
yes
yes
ser ious er ror
situation?
yes: restart
no
Delay = 30µs
TLI493D-A2B6
I2C Interface
2.4Sensor Initialization and Readout example
To ensure that both the microcontroller and the sensor are synchronized and properly initialized, it is
recommended to apply the I
2
C reset and upload the fuse register settings each time the microcontroller is
reset, see Figure 13.
Figure 13 Microcontroller software flowchart for TLI493D-A2B6
User Manual22Ver. 1.11
2019-05-28
Page 23
Sensor
1
TLI493D-
A2B6
Sensor
n
V
DD
Microcontroller
I²C bus
Power supply loss
I²C bus can
be disturbed
TLI493D-A2B6
I2C Interface
2.5Loss of VDD impact on I2C bus
If the SDA or SCL line is pulled “low” and the sensor is disconnected from the VDD supply line, the affected I2C
line will most likely get a stuck in the Low state and will interfere with the communication on the bus.
Figure 14 Example of I2C bus and a TLI493D-A2B6 with disconnected V
When VDD is pulled to GND the SDA and SCL line will not disturb the bus.
DD
User Manual23Ver. 1.11
2019-05-28
Page 24
TLI493D-A2B6
Diagnostic
3Diagnostic
The sensor TLI493D-A2B6 provides diagnostic functions. These functions are running in the background,
providing results, which can be checked by the microcontroller for the verification of the measurement
results.
To ensure the integrity of received data the following diagnostic functions are available.
3.1Parity bits and parity flags
Parity bits:
•FP (mode parity bit)
•CP (configuration parity bit)
•P (bus parity bit)
Parity flags:
•FF (mode parity flag)
•CF (configuration parity flag)
3.2Power-down flags
During measurements and during ADC conversion, the sensor monitors if the supply voltage is correct and if
the conversion is finished. This is indicated by the PD3 and PD0 registers.
3.3Frame Counter
The frame counter FRM registers are incremented by one when a conversion is completed.
User Manual24Ver. 1.11
2019-05-28
Page 25
TLI493D-A2B6
Terminology
4Terminology
A
ACKAcknowledge
ADCAnalog/Digital Converter
adraddress
E
EMCElectromagnetic Compatibility
G
GNDGround
I
IDIDentification
2
I
C (I2C)Inter-Integrated Circuit
/INTInterrupt pin, Interrupt signal
L
LSBLeast Significant Bit
M
Magnetic fieldMagnetic flux density that the sensor measures.
minminimum
MSBMost Significant Bit
maxmaximum
P
PCBPrinted Circuit Board
R
regregister
S
SCLClock pin
SDAData pin
SensorRefers to the TLI493D-A2B6 product
Sensor moduleRefers to the TLI493D-A2B6 product and all the passive elements in the customer’s module
SupplyRefers to the sensor supply pins V
connected to GND as well).
V
V
DD
µ
µCMicrocontroller
User Manual25Ver. 1.11
Supply voltage
and GND (the unused pins are assumed to be
DD
2019-05-28
Page 26
TLI493D-A2B6
Revision history
5Revision history
Revision DateChanges
Ver. 1.11 2019-05-28 Register MODE updated.
Ver. 1.12018-09-20 TRIG updated.
MOD2 updated.
Table 5 updated.
Trigger bits in the I
Table 6 updated and Figure 4 accordingly.
Figure 5 updated.
At the end of a data read out a NACK is transferred before the stop condition
(according to the standard and the product). This was updated: Chapter 2.1.1,
Figure 9, Figure 11, Figure 12
Editorial changes.
2
C protocol updated.
Ver. 0.12018-04-20 Initial release.
User Manual26Ver. 1.11
2019-05-28
Page 27
Trademarks
All referenced product or service names and trademarks are the property of their respective owners.
Do you have a question about any
aspect of this document?
Email: erratum@infineon.com
Document reference
The information given in this document shall in no
event be regarded as a guarantee of conditions or
characteristics ("Beschaffenheitsgarantie").
With respect to any examples, hints or any typical
values stated herein and/or any information regarding
the application of the product, Infineon Technologies
hereby disclaims any and all warranties and liabilities
of any kind, including without limitation warranties of
non-infringement of intellectual property rights of any
third party.
In addition, any information given in this document is
subject to customer's compliance with its obligations
stated in this document and any applicable legal
requirements, norms and standards concerning
customer's products and any use of the product of
Infineon Technologies in customer's applications.
The data contained in this document is exclusively
intended for technically trained staff. It is the
responsibility of customer's technical departments to
evaluate the suitability of the product for the intended
application and the completeness of the product
information given in this document with respect to
such application.
For further information on technology, delivery terms
and conditions and prices, please contact the nearest
Infineon Technologies Office (www.infineon.com).
WARNINGS
Due to technical requirements products may contain
dangerous substances. For information on the types
in question please contact your nearest Infineon
Technologies office.
Except as otherwise explicitly approved by Infineon
Technologies in a written document signed by
authorized representatives of Infineon Technologies,
Infineon Technologies’ products may not be used in
any applications where a failure of the product or any
consequences of the use thereof can reasonably be
expected to result in personal injury.
Loading...
+ hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.