The information given in this document shall in no event be regarded as a guarantee of conditions or
characteristics. With respect to any examples or hints given herein, any typical values stated herein and/or any
information regarding the application of the device, 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.
Information
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, components may contain dangerous substances. For information on the types in
question, please contact the nearest Infineon Technologies Office.
Infineon Technologies components may be used in life-support devices or systems only with the express written
approval of Infineon Technologies, if a failure of such components can reasonably be expected to cause the failure
of that life-support device or system or to affect the safety or effectiveness of that device or system. Life support
devices or systems are intended to be implanted in the human body or to support and/or maintain and sustain
and/or protect human life. If they fail, it is reasonable to assume that the health of the user or other persons may
be endangered.
Page 3
SP37
We Listen to Your Comments
Any information within this document that you feel is wrong, unclear or missing at all?
Your feedback will help us to continuously improve the quality of this document.
Please send your proposal (including a reference to this document) to:
sensors@infineon.com
Tire Pressure Monitoring Sensor
SP37 High integrated single-chip TPMS sensor with a low power embedded micro-controller and wireless
FSK/ASK UHF transmitter
Revision History: 2011-12-15, Revision 1.0
Previous Revision: Revision 0.1
PageSubjects (major changes since last revision)
Page 17WakeUp time updated
Page 22Chapter Meas_Sensor updated
Page 27Note for calling two additional bytes, valid for all functions
Page 31Chapter Meas_Pressure updated
Page 36Chapter Automatic Pressure Range Operation added
Page 42Execution Time of the function Scale_Pressure updated
Page 45Chapter Meas_Acceleration updated
Page 54Execution Time of the function Raw_Temperature updated
Page 54Register of Output Value of Raw_Temperature corrected
Page 71Register CFG1 used in Powerdown Function
Page 72Execution Time of the function Powerdown updated
Page 76Execution Time of the function StartXtalOsc updated
Page 84Execution Time of the function IntervalTimerCalibration updated
Page 86Execution Time of the function LFBaudrateCalibration updated
Page 87Function MulIntInt(): 2 additional bytes for stack added
Page 97ReadID Input and Output Parameters updated
Page 101FW_Revision_Nb Input and Output Parameters updated
Page 106Execution Time of the function FlashUserConfigSectorLine updated
Page 107New function WriteFlashCodeSectorLine
Page 110Ressource Usage of the function FlashSetLock updated
Page 110Execution Time of the function FlashSetLock updated
Page 121Execution Time of the function Wait100usMultiples updated
Page 123Execution Time of the function Send_RF_Telegram updated
Page 126Flow Chart of Send_RF_Telegram Function
ROM Library Function Guide3Revision 1.0, 2011-12-15
Advance Design System™ (ADS) of Agilent Technologies, AMBA™, ARM™, MULTI-ICE™, KEIL™,
PRIMECELL™, REALVIEW™, THUMB™, µVision™ of ARM Limited, UK. AUTOSAR™ is licensed by AUTOSAR
development partnership. Bluetooth™ of Bluetooth SIG Inc. CAT-iq™ of DECT Forum. COLOSSUS™,
FirstGPS™ of Trimble Navigation Ltd. EMV™ of EMVCo, LLC (Visa Holdings Inc.). EPCOS™ of Epcos AG.
FLEXGO™ of Microsoft Corporation. FlexRay™ is licensed by FlexRay Consortium. HYPERTERMINAL™ of
Hilgraeve Incorporated. IEC™ of Commission Electrotechnique Internationale. IrDA™ of Infrared Data
Association Corporation. ISO™ of INTERNATIONAL ORGANIZATION FOR STANDARDIZATION. MATLAB™ of
MathWorks, Inc. MAXIM™ of Maxim Integrated Products, Inc. MICROTEC™, NUCLEUS™ of Mentor Graphics
Corporation. Mifare™ of NXP. MIPI™ of MIPI Alliance, Inc. MIPS™ of MIPS Technologies, Inc., USA. muRata™
of MURATA MANUFACTURING CO., MICROWAVE OFFICE™ (MWO) of Applied Wave Research Inc.,
OmniVision™ of OmniVision Technologies, Inc. Openwave™ Openwave Systems Inc. RED HAT™ Red Hat, Inc.
RFMD™ RF Micro Devices, Inc. SIRIUS™ of Sirius Satellite Radio Inc. SOLARIS™ of Sun Microsystems, Inc.
SPANSION™ of Spansion LLC Ltd. Symbian™ of Symbian Software Limited. TAIYO YUDEN™ of Taiyo Yuden
Co. TEAKLITE™ of CEVA, Inc. TEKTRONIX™ of Tektronix Inc. TOKO™ of TOKO KABUSHIKI KAISHA TA.
UNIX™ of X/Open Company Limited. VERILOG™, PALLADIUM™ of Cadence Design Systems, Inc. VLYNQ™
of Texas Instruments Incorporated. VXWORKS™, WIND RIVER™ of WIND RIVER SYSTEMS, INC. ZETEX™ of
Diodes Zetex Limited.
Last Trademarks Update 2011-02-24
ROM Library Function Guide4Revision 1.0, 2011-12-15
ROM Library Function Guide16Revision 1.0, 2011-12-15
Page 17
SP37
Tire Pressure Monitoring Sensor
Introduction
1Introduction
1.1General Considerations
This document describes the ROM Library functions that are available in the SP37 Version A5 step device. When
the ROM Library Function “FW_Revision_Nb()” on Page 101 is called, these devices will return the value 0A32
for the ROM revision.
In order for the application to use these ROM Library functions, the following files have to be included to the
software project:
•SP37_ROMLibrary.h (the header file the function prototypes)
•SP37_ROMLibrary.lib (the precompiled ROM Library functions)
Notes
1. The application must ensure that no IDLE-RESUME event source is active before any call of the
ROM Library_functions.
2. All typical charge consumptions and typical execution times stated throughout this document were obtained
from measurements of 10 devices at
3. Analysis of General Register, SFR, and Stack resource usage was performed on object code generated by
The following table defines the parameter types used throughout this document.
Table 1Definition of types
TypeDescriptionRange
MinimumMaximum
Unsigned char8 bit value without sign bit0255
Signed char8 bit value with sign bit-128127
Unsigned int16 bit value without sign bit065,535
Signed int16 bit value with sign bit-32,76832,767
Unsigned long32 bit value without sign bit04,294,967,295
Signed long32 bit value with sign bit-2,147,483,6482,147,483,647
The Keil C51 Compiler stores data in big endian format (MSB first).
1.3Wakeup Handler
The Wakeup-Handler is executed every time the device wakes up from POWER DOWN state. Possible wakeup
sources are listed in SP37 Datasheet [1].
Table 2Wakeup Handler
ParameterSymbolValuesUnitNote / Test Condition
Min.Typ.Max.
Wakeup from POWER DOWN state
(independent of Wakeup source)
t
wakeup
–0.851.8ms
ROM Library Function Guide17Revision 1.0, 2011-12-15
Page 18
SP37
Tire Pressure Monitoring Sensor
Introduction
1.4Restricted RAM and FLASH areas
The ROM Library functions use certain address areas in RAM and FLASH. To ensure that the
ROM Library functions operate properly, the application may not use these locations for storage, nor alter the
contents of these memory locations
1.4.1Restricted RAM areas
The RAM area C1H through FFH (upper 63 Bytes) of the 256 Bytes RAM is used and overwritten by the
ROM Library functions.
1.4.2Restricted FLASH areas
The FLASH area 57FAH through 57FCH is reserved for storage of the crystal frequency to be used in the
application. The crystal frequency (divided by two) has to be written to that location during FLASH programming
in the production in order to provide the ROM Library functions with the correct timebase for calibration purposes.
For 315 MHz applications a 19.6875 MHz crystal is used and the crystal frequency divided by two has to be written
to that location.
19,687,500 Hz : 2 = 9,843,750 Hz = 963426
The values in FLASH have to be written in the following way:
•Flash address 57FA
•Flash address 57FBH: 34
•Flash address 57FCH: 26
H
: 96
H
H
H
For 433.92 MHz applications an 18.0800 MHz crystal is used and the crystal frequency divided by two has to be
written to that location.
18,080,000 Hz : 2 = 9,040,000 Hz = 89F080
The values in FLASH have to be written in the following way:
•Flash address 57FA
•Flash address 57FBH: F0
•Flash address 57FCH: 80
H
: 89
H
H
H
The FLASH address 57FFH is reserved for Lockbyte 3. This value must not be changed by the application
otherwise it might result in an unintentionally locked FLASH User Configuration Sector. Locking this sector is
irreversible and shall only be done by either programming the Lockbyte 3 together with writing and locking the
FLASH Code Sector or by a dedicated ROM Library function FlashSetLock().
Note: If Erase_UserConfigSector() or WriteFlashUserConfigSectorLine() are used by the application it has to
be ensured that these restricted Flash locations are restored to the proper values.
H
H
Hz
Hz
1.58051 Instruction Set Summary
As the SP37 incorporates an 8051 compatible microcontroller, Figure 1 shows the SP37 OpCode Map.
ROM Library Function Guide18Revision 1.0, 2011-12-15
ROM Library Function Guide19Revision 1.0, 2011-12-15
Page 20
SP37
Tire Pressure Monitoring Sensor
ROM Library Functions
2ROM Library Functions
The following library functions are available for application usage:
Table 3ROM Library functions
ROM Library functionDescriptionPage
Meas_Sensor()Measures the ambient air pressure or accelerationPage 22
Meas_Pressure()Measures the ambient air pressurePage 31
Scale_Pressure()Scale pressure into a single byte for RF transmission Page 42
Meas_Acceleration()Measures the accelerationPage 45
Meas_Temperature()Measures the ambient temperaturePage 51
Raw_Temperature()Measures the raw temperaturePage 54
Comp_Temperature()Compensates raw temperature dataPage 56
Meas_Supply_Voltage()Measures the battery voltagePage 59
Start_Supply_Voltage()These three functions perform a Battery Voltage
Trig_Supply_Voltage()Page 64
Get_Supply_Voltage()Page 66
ADC_Selftest()Returns the delta of ADC test measurementsPage 69
Powerdown()Forces the device to POWER DOWN statePage 71
ThermalShutdown()Forces the device to THERMAL SHUTDOWN statePage 73
StartXtalOsc()Enables the Crystal OscillatorPage 75
StopXtalOsc()Stops the Crystal OscillatorPage 77
PLL_Ref_Signal_Check()Evaluates Crystal Resonator signalPage 79
VCO_Tuning()Tunes the VCO frequencyPage 81
IntervalTimerCalibration()Calibrates the Interval Timer precounterPage 83
LFBaudrateCalibration()Calibrates the LF baudrate dividerPage 85
SMulIntInt()Multiplies two signed values (16 bit * 16 bit)Page 87
UDivLongLong()Divides two unsigned values (32 bit : 32 bit)Page 89
UDivIntInt()Divides two unsigned values (16 bit : 16 bit)Page 91
CRC8_Calc()Calculates an 8 Bit CRC with polynom 83
CRC_Baicheva_Calc()Calculates an 8 Bit CRC with poylnom 97
Read_ID()Returns the unique device IDPage 97
ManuRevNb()Returns the device revision numberPage 99
FW_Revision_Nb()Returns the ROM- and Flash library revision number Page 101
Erase_UserConfigSector()Erases the FLASH user configuration sectorPage 103
WriteFlashUserConfigSectorLine()Writes one FLASH line (32 Bytes) in the FLASH user
WriteFlashCodeSectorLine()Writes one FLASH line (32 Bytes) in the FLASH
FlashSetLock()Sets the Lockbyte to protect the User Configuration
ECC_Check()Evaluates the ECC result bitPage 111
measurement during an RF Transmission.
H
H
configuration sector
Code Sector 0.
sector
Page 62
Page 93
Page 95
Page 105
Page 107
Page 109
ROM Library Function Guide20Revision 1.0, 2011-12-15
Page 21
SP37
Tire Pressure Monitoring Sensor
Table 3ROM Library functions (cont’d)
ROM Library functionDescriptionPage
CRC16_Check()Evaluates the CRC16 result of a memory blockPage 113
HIRC_Clock_Check()Evaluates the 12 MHz_RC_Oscillator frequencyPage 115
GetCompValue()Returns a compensated value from look up tablePage 117
Wait100usMultiples()Performs a delay of 100 µs multiplesPage 121
Send_RF_Telegram()Configures and transmits RF framesPage 123
Internal_SFR_Refresh()Loads default values into the internal SFRsPage 132
ROM Library Functions
ROM Library Function Guide21Revision 1.0, 2011-12-15
Page 22
SP37
Tire Pressure Monitoring Sensor
ROM Library Functions
2.1Meas_Sensor()
2.1.1Description
This function performs a pressure or acceleration sensor measurement determined by SensorConfig.
The pressure or acceleration result can be either:
•Compensated for sensitivity, offset and temperature
•Output as raw value without performing the compensation
The function can measure either pressure or acceleration with up to 64 samples at a specified sample rate. The
function will return the maximum or average (arithmetic mean) pressure or acceleration value in order to
compensate for noise. The function performs a new temperature measurement for compensating the pressure or
acceleration measurements, unless a previously measured raw temperature value is supplied. Number of samples
and raw temperature source are both determined by SensorConfig. SampleRate controls how frequently the
measurement acquisitions occur and will not influence the measurement result under stable input pressure or
acceleration conditions. The device is set to IDLE mode during the delay between measurement acquisitions.
In case of pressure measurement, SensorConfig can be configured to automatically determine the high/low
pressure range where to perform the measurement. The choice of the pressure measurement range can also be
performed manually.The pressure hysteresis thresholds can be selected: either predefined from Infineon factorydefault setting, or specified when calling this function (see SensorResult).
2.1.2Actions
Pressure Measurement
•Measure pressure sensor with channel and number of samples given by SensorConfig
•Check wire bonds between the ASIC and the sensor die
•Average the measurement result(s), or (optionally) use the maximum raw measurement, to obtain a raw
pressure value
•Sensor gain is automatically configured
•(optionally) Switch between Low and High Pressure range automatically, using configured thresholds
•(optionally) Perform a raw temperature measurement
•(optionally) Compensate the raw pressure value
Acceleration Measurement
•Measure acceleration sensor with channel and number of samples given by SensorConfig
•Check wire bonds between the ASIC and the sensor die & sensor beam integrity
•Sensor gain is automatically configured
•Average the measurement(s), or (optionally) use the maximum raw measurement, to obtain a raw acceleration
value
•(optionally) Perform a raw temperature measurement
•(optionally) Compensate the raw acceleration value
2.1.3Prototype
unsigned char Meas_Sensor (unsigned int SensorConfig, unsigned char SampRate, signed int idata
*SensorResult )
ROM Library Function Guide22Revision 1.0, 2011-12-15
R5unsigned char SampleRateDefines the number of system clock cycles
R3signed int
*(SensorResult+2)signed intRawTemperature Previous Raw Temperature value can optionally
*(SensorResult+3)signed intLowPressureThre
*(SensorResult+4)signed intHighPressureThr
unsigned intSensorConfigDefines Sensor Configuration (refer to Table 5
and Table 6)
(12 MHz RC Oscillator) divided by 8 which is
waited between consecutive measurements.
Note: Only applicable if SensorConfig.2-0
[2POWN2:0] greater than 1 Sample
SensorResultPointer to an integer array in RAM to receive the
idata*
shold
eshold
measurement result
be used as input parameter. Refer to bit
RAWTemp in SensorConfig.
(optional input parameter) Value for hysteresis
(in 1/16kPa) used by the pressure auto-range
selection to determine when to switch from Highto-Low. It must be specified only if the parameter
SensorConfig.11 is set to 1 (Customer
Configuration).
(optional input parameter) Value for hysteresis
(in 1/16kPa) used by the pressure auto-range
selection to determine when to switch from Lowto-High. It must be specified only if the
parameter SensorConfig.11 is set to 1
(Customer Configuration).
ROM Library Function Guide23Revision 1.0, 2011-12-15
HYSTSelect the thresholds for pressure hysteresis:
0
: Internal Configuration:550kPa is the threshold from low to high pressure range
B
and 500kPa is the threshold from high to low pressure range.
1
: Customer Configuration - see (SensorResult+3) and (SensorResult+4)
B
ARANGEAutomatic range selection for pressure measurement:
0
: Manual
B
1
: Automatic
B
If compensation is disabled (SensorConfig.6[RAW]==.1) a manual pressure range
measurement is performed, using the range specified by SensorConfig.9[PRANGE].
Automatic Pressure Range is not supported for raw (uncompensated)
measurements.
PRANGEPressure range: (ignored if SensorConfig.10[ARANGE]==1)
0
: Low range (500kPa)
B
1
: High range (900kPa)
B
RAWTempSelects source of raw temperature data for compensation
0
: Perform new raw temperature measurement
B
1
: Use raw temperature data supplied in *(SensorResult+2)
xxxx.xxx1
xxxx.xx1xB: Overflow of ADC Result
xxxx.x1xxB: Sensor Fault Wire Bond Check
xxxx.1xxx
for acceleration measurement)
xxx1.xxxx
If Input Bit SensorConfig.7[Sens_Type] == 1;
If Input Bit SensorConfig.6[RAW] == 0:
8000
0000
7FFF
( = 2048 kPa - 1 LSB where 1 LSB = 1/16 kPa)
B
B
B
= -2048.0 kPa (Only theoretical)
H
= 0.0 kPa
H
= 2047.9375 kPa
H
ROM Library Functions
: Success
B
: Underflow of ADC Result
1)
1)
: Sensor Fault Diagnosis Resistor (only
: VMIN warning
If Input Bit SensorConfig.6[RAW] == 1:
since no compensation is performed
8000
H
Compensated
Acceleration
If Input Bit SensorConfig.7[Sens_Type] == 0;
If Input Bit SensorConfig.6[RAW] == 0:
8000
= -2048.0 g
H
0000
= 0.0 g
H
7FFF
= 2047.9375 g
H
( = 2048 g - 1 LSB where 1 LSB = 1/16 g)
If Input Bit SensorConfig.6[RAW] == 1:
8000
since no compensation is performed
H
*(SensorResult+1)signed intRaw Pressure10 Bit ADC Result Value:
0000.00xx.xxxx.xxxx
B
Raw Acceleration10 Bit ADC Result Value:
0000.00xx.xxxx.xxxx
B
*(SensorResult+2)signed intRaw TemperatureIf Input Bit SensorConfig.6[RAW] == 0:
16 Bit scaled signed ADC Result Value
If Input Bit SensorConfig.6[RAW] == 1:
8000
since no temperature measurement is
H
performed
1) If the sensor measurement result is within the input range for which its accuracy is specified, then the ADC
underflow/overflow condition is due to a measurement failure and the measurement results are not valid. Otherwise, if the
sensor measurement result is outside of this input range, then the ADC underflow/overflow bits may be ignored.
ROM Library Function Guide26Revision 1.0, 2011-12-15
Page 27
SP37
Tire Pressure Monitoring Sensor
2.1.6Resource Usage
Table 9Meas_Sensor: Resources
TypeUsed or Modified
ROM Library Function Guide27Revision 1.0, 2011-12-15
Page 28
SP37
Tire Pressure Monitoring Sensor
ROM Library Functions
2.1.7Execution Information
Table 10Meas_Sensor: Pressure Measurement: Execution Time and Charge Consumption
ParameterSymbolValuesUnit Note / Test Condition
Min.Typ.Max.
Execution Time
Compensated with new raw
temperature measurement, 2
samples
Execution Time
Compensated when supplied
with previously obtained raw
temperature value, 2 samples
Execution Time Raw
(uncompensated) pressure
result, 2 samples
Execution Time for each
additional sample for
averaging
Execution Time in autorange
selection Compensated with
new raw temperature
measurement, 2 samples
Execution Time in autorange
selection Compensated when
supplied with previously
obtained raw temperature
value, 2 samples
1)
Execution Time in autorange
selection for each additional
sample for averaging
1)
Charge Consumption
Compensated with new raw
temperature measurement, 2
samples
Charge Consumption
Compensated when supplied
with previously obtained raw
temperature value, 2 samples
Charge Consumption Raw
(uncompensated) pressure
result, 2 samples
Charge Consumption for each
additional sample for
averaging
t
comp,new
t
comp,prev
t
RAW
t
sample
–9161016 µsDIVIC = 00H,
SensorConfig = 0081
SampleRate = 00
–686768µsDIVIC = 00H,
SensorConfig = 0181
SampleRate = 00
–304332µsDIVIC = 00H,
SensorConfig = 00C1
SampleRate = 00
–5460µsSampleRate = 00
,
H
H
,
H
H
,
H
H
H
Only 1, 2, 4, 8, 16, 32, 64 samples possible
t
autocomp,n
ew
1)
t
autpcomp,p
rev
t
autosample
–9441008 µsDIVIC = 00H,
SensorConfig = 0481
SampleRate = 00
–714760µsDIVIC = 00H,
SensorConfig = 0581
SampleRate = 00
–5459µsSampleRate = 00
,
H
H
,
H
H
H
Only 1, 2, 4, 8, 16, 32, 64 samples possible
Q
comp,new
Q
comp,prev
Q
RAW
Q
sample
–1,622,535 µCDIVIC = 00H,
SensorConfig = 0081
SampleRate = 00
–1,175 1,889 µCDIVIC = 00H,
SensorConfig = 0181
SampleRate = 00
–0,549 0,821 µCDIVIC = 00H,
SensorConfig = 00C1
SampleRate = 00
–0,118 0,151 µCSampleRate = 00
,
H
H
,
H
H
,
H
H
H
Only 1, 2, 4, 8, 16, 32, 64 samples possible
ROM Library Function Guide28Revision 1.0, 2011-12-15
Page 29
SP37
Tire Pressure Monitoring Sensor
ROM Library Functions
Table 10Meas_Sensor: Pressure Measurement: Execution Time and Charge Consumption (cont’d)
ParameterSymbolValuesUnit Note / Test Condition
Min.Typ.Max.
Charge Consumption in
autorange selection
Compensated with new raw
Q
autpcomp,
new
–1,643 2,515 µCDIVIC = 00H,
SensorConfig = 0481
SampleRate = 00
,
H
H
temperature measurement, 2
samples
Charge Consumption in
autorange selection
Compensated when supplied
1)
Q
autocomp,
prev
–1,196 1,869 µCDIVIC = 00H,
SensorConfig = 0581
SampleRate = 00
,
H
H
with previously obtained raw
temperature value, 2
samples
Charge Consumption in
autorange selection for each
1)
Q
autosampl
e
–0,118 0,148 µCSampleRate = 00
Only 1, 2, 4, 8, 16, 32, 64 samples possible
H
additional sample for
averaging
1) The execution time and charge consumption for automatic range selection have been verified when the proper pressure
1)
range is selected.
ROM Library Function Guide29Revision 1.0, 2011-12-15
Page 30
SP37
Tire Pressure Monitoring Sensor
ROM Library Functions
Table 11Meas_Sensor: Acceleration Measurement: Execution Time and Charge Consumption
ParameterSymbolValuesUnitNote / Test Condition
Min.Typ.Max.
Execution Time Compensated
with new raw temperature
measurement, 2 samples
Execution Time Compensated
when supplied with previously
obtained raw temperature
t
comp,new
t
comp,prevt
–9061013µsDIVIC = 00H,
SensorConfig = 0001
SampleRate = 00
–652765µsDIVIC = 00H,
SensorConfig = 0101
SampleRate = 00
,
H
H
,
H
H
value, 2 samples
Execution Time Raw
(uncompensated) acceleration
result, 2 samples
Execution Time for each
t
RAW
t
sample
–304332µsDIVIC = 00H,
SensorConfig = 0041
SampleRate = 00
–6471µsSampleRate = 00
,
H
H
H
additional sample for averaging
Charge Consumption
Compensated with new internal
raw temperature measurement,
Q
comp,new
–1,6032,512µCDIVIC = 00H,
SensorConfig = 0001
SampleRate = 00
,
H
H
2 samples
Charge Consumption
Compensated when supplied
with previously obtained raw
Q
comp,prev
–1,1221,866µCDIVIC = 00H,
SensorConfig = 0101
SampleRate = 00
,
H
H
temperature value, 2 samples
Charge Consumption Raw
(uncompensated) acceleration
result, 2 samples
Charge Consumption for each
Q
Q
RAW
sample
–0,5510,805µCDIVIC = 00H,
SensorConfig = 0041
SampleRate = 00
–0,1350,17µCSampleRate = 00
,
H
H
H
additional sample for averaging
ROM Library Function Guide30Revision 1.0, 2011-12-15
Page 31
SP37
Tire Pressure Monitoring Sensor
ROM Library Functions
2.2Meas_Pressure()
2.2.1Description
This function performs a pressure sensor measurement.
The result can be either:
•Compensated for sensitivity, offset and temperature
•Output as raw value without performing the compensation
The function can measure pressure with up to 64 samples at a specified sample rate. The function will return the
maximum or average (arithmetic mean) pressure value in order to compensate for noise. The function performs a
new temperature measurement for compensating the pressure measurements, unless a previously measured raw
temperature value is supplied. Number of samples and raw temperature source are both determined by
SensorConfig. SampleRate controls how frequently the measurement acquisitions occur and will not influence
the measurement result under stable input pressure conditions. The device is set to IDLE mode during the delay
between measurement acquisitions. SensorConfig can be configured to automatically determine the high/low
pressure range. The choice of the pressure measurement range can also be performed manually.The pressure
hysteresis thresholds detection can be selected: either predefined from Infineon factory-default setting, or
specified when calling this function - see PressResult.
2.2.2Actions
•Measure pressure sensor with channel and number of samples given by SensorConfig
•Check wire bonds between the ASIC and the sensor die
•Average the measurement result(s), or (optionally) use the maximum raw measurement, to obtain a raw
pressure value
•(optionally) Switch between Low and High pressure range automatically, using configured thresholds
•(optionally) Perform a raw temperature measurement
•(optionally) Compensate the raw pressure value
2.2.3Prototype
unsigned char Meas_Pressure (unsigned int SensorConfig, unsigned char SampRate, signed int idata
*PressResult )
ROM Library Function Guide31Revision 1.0, 2011-12-15
R5unsigned char SampleRateDefines the number of system clock cycles
R3signed int
*(PressResult+2)signed intRawTemperature Previous Raw Temperature value can optionally
*(PressResult+3)signed intLowPressureThre
*(PressResult+4)signed intHighPressureThr
unsigned intSensorConfigDefines Sensor Configuration (refer to Table 13
and Table 14)
(12 MHz RC Oscillator) divided by 8 which is
waited between consecutive measurements.
Note: Only applicable if SensorConfig.2-0
[2POWN2:0] greater than 1 Sample
PressResultPointer to an integer array in RAM to receive the
idata*
shold
eshold
measurement result
be used as input parameter. Refer to bit
RAWTemp in SensorConfig.
(optional input parameter) Value for hysteresis
(in 1/16kPa) used by the pressure auto-range
selection to determine when to switch from Highto-Low. It must be specified only if the parameter
SensorConfig.11 is set to 1 (Customer
Configuration)
(optional input parameter) Value for hysteresis
(in 1/16kPa) used by the pressure auto-range
selection to determine when to switch from Lowto-High. It must be specified only if the
parameter SensorConfig.11 is set to 1
(Customer Configuration).
ROM Library Function Guide32Revision 1.0, 2011-12-15
HYSTSelect the thresholds for pressure hysteresis:
0
: Internal Configuration: 550kPa is the threshold from low to high pressure range
B
and 500kPa is the threshold from high to low pressure range.
1
: Customer Configuration - See (PressResult+3) and (PressResult+4)
B
ARANGEAutomatic range selection for pressure measurement:
0
: Manual
B
1
: Automatic
B
If compensation is disabled (SensorConfig.6[RAW]==.1) a manual pressure range
measurement is performed, using the range specified by SensorConfig.9[PRANGE].
Automatic Pressure Range is not supported for raw (uncompensated)
measurements.
PRANGEPressure range: (ignored if SensorConfig.10[ARANGE]==1)
0
: Low range (500kPa)
B
1
: High range (900kPa)
B
RAWTempSelects source of raw temperature data for compensation
0
: Perform new raw temperature measurement
B
1
: Use raw temperature data supplied in *(PressResult+2)
B
ROM Library Function Guide33Revision 1.0, 2011-12-15
xxxx.xxx1
xxxx.xx1xB: Overflow of ADC Result
xxxx.x1xxB: Sensor Fault Wire Bond Check
xxx1.xxxx
*(PressResult+0)signed intCompensated
Pressure
If Input Bit SensorConfig.6[RAW] == 0:
8000
0000
7FFF
( = 2048 kPa - 1 LSB where 1 LSB = 1/16 kPa)
If Input Bit SensorConfig.6[RAW] == 1:
8000
*(PressResult+1)signed intRaw Pressure10 Bit ADC Result Value:
0000.00xx.xxxx.xxxx
*(PressResult+2)signed intRaw TemperatureIf Input Bit SensorConfig.6[RAW] == 0:
16 Bit scaled signed ADC Result Value
: Success
B
: Underflow of ADC Result
B
: VMIN warning
B
= -2048.0 kPa (Only theoretical)
H
= 0.0 kPa
H
= 2047.9375 kPa
H
since no compensation is performed
H
B
1)
1)
If Input Bit SensorConfig.6[RAW] == 1:
8000
since no temperature measurement is
H
performed
1) If the pressure measurement result is within the input range for which its accuracy is specified (e.g. 100 kPa - 900 kPa),
then the ADC underflow/overflow condition is due to a measurement failure and the measurement results are not valid.
Otherwise, if the pressure measurement result is outside of this input range, then the ADC underflow/overflow bits and the
pressure measurement results may be ignored.
ROM Library Function Guide35Revision 1.0, 2011-12-15
Page 36
SP37
Tire Pressure Monitoring Sensor
ROM Library Functions
2.2.6Automatic Pressure Range Operation
The Automatic Pressure Range feature is implemented as two separate pressure range calibrations within the
SP37 A5 device. One calibration is optimized for a “low range” of 100-500kPa, the other for a “high range” of 500900kPa. When the Automatic Pressure Range feature is enabled, the SP37 applies the calibration from the most
appropriate pressure range. For example, if the input pressure is within the low range, the low range calibration is
used to obtain the best measurement accuracy. The Automatic Pressure Range feature is only available when
compensated measurements are being performed.
The Automatic Pressure Range function includes a hysteresis feature to prevent “range toggling” at the boundary
between high range and low range calibrations. The hysteresis is implemented as an upper threshold, and a lower
threshold. During an Automatic Pressure Range measurement, if the input pressure is below the lower threshold
value, the lower range calibration is used during measurement. If the input pressure is above the higher threshold
value, the upper range calibration is used during measurement. If the input pressure is between the two threshold
values, the calibration range from the previous pressure measurement is used. The values of the hysteresis
thresholds may be either the Infineon default values, or values supplied as parameters to the pressure
measurement functions.
To apply the default hysteresis values when using Automatic Pressure Range, the [SensorConfig.10[ARANGE]]
bit within the [SensorConfig] parameter must be set to 1
[SensorConfig] parameter must be cleared to 0
. For the 900kPa SP37 A5 device, the default upper threshold
B
value is 550kPa, and the default lower threshold value is 500kPa. When these default threshold values are used,
the pressure measurement error as specified within the SP37 A5 900kPa datasheet applies.
If the default hysteresis thresholds are not suitable, new threshold values may be supplied as parameters via the
[PressResult] array as shown in Table 16. In this case, both the [SensorConfig.10[ARANGE]] and
[SensorConfig.11[HYST]] bits within the [SensorConfig] parameter must be set to 1
Chapter 2.2.4 for more details.
Note: If the lower hysteresis level is set to less than 500kPa, the measurement error is unspecified for input
pressures between the lower hysteresis threshold and 500kPa.
, and the [SensorConfig.11[HYST]] bit within the
B
. See Table 13 in
B
Note: The upper hysteresis level must not be set above 550kPa.
If Automatic Pressure Range is not desired, the pressure measurement function may be manually configured to
use only the high range or only the low range. In this case, the [SensorConfig.10[ARANGE]] bit within the
[SensorConfig] parameter must be cleared to 0
range calibration or low range calibration by being set to 1
, and the [SensorConfig.9[PRANGE]] bit is used to select high
B
or cleared to 0B, respectively.
B
ROM Library Function Guide36Revision 1.0, 2011-12-15
Page 37
SP37
Meas_Pressure
SensorConfig .9
High Range (Bit 9 = 1)
Sens orConfig .10
Sens orConfig .6
Low Range (Bi t 9 = 0)
Manual (Bit 10 = 0)
OR Skip comp (Bit 6 = 1)
Automatic (Bit 10 = 1)
AND Comp (Bit 6 = 0)
SensorConfig parameter :
Bi t 11 Selec t thresholds for press . hys teresis
0 = Factory-defaul t setting
1 = Customer specified
Bit 10 Automatic range selection
0 = Manual
1 = Automatic (Bit 9 will be ignored)
Bit 9 Pressure range( valid only i f Bi t 10 = 0)
0 = Low (e.g. 500 kPa)
1 = High (e.g . 900 k Pa)
Bit 7 Sensor type :
0 = Accel eration
1 = Pressure
Bit 6 Compensation selection
0 = bit 10 is av ailable for automatic range selec ti on
Compensation ski pped
1 = Onl y m anual is avai lable
Compensation avail able
Meas_Sensor
_PressLow
Current Pressure
Range
Low Range
High Range
Set Current Pressure
Range to high
Si ngle/Dual
Config
Single
END
Dual
Meas_Sensor
_PressLow
Meas_Sensor
_PressHigh
ENDEND
END
END
Meas_Sensor
_PressLow
Pressure > High
Threshold
Meas_Sensor
_PressHigh
Meas_Sensor
_PressHigh
Yes
No
Pressure < Low
Threshold
Meas_Sensor
_PressLow
Set Current Pressure
Range to low
END
END
Yes
No
SensorConfig .7 = 1
(Pressure)
Tire Pressure Monitoring Sensor
ROM Library Functions
Figure 2Flow Chart for configuration of SensorConfig for Meas_Pressure() function.
ROM Library Function Guide37Revision 1.0, 2011-12-15
Page 38
SP37
Tire Pressure Monitoring Sensor
2.2.7Resource Usage
Table 17Meas_Pressure: Resources
TypeUsed or Modified
// Pressure measurement was not successful, underflow or
// overflow of ADC result, Sensor Fault Wire Bond Check,
// or VMIN warning occurred
}
}
Tire Pressure Monitoring Sensor
2.2.9Code Example
ROM Library Functions
Figure 3Code example for usage of Meas_Pressure()
ROM Library Function Guide41Revision 1.0, 2011-12-15
Page 42
SP37
Tire Pressure Monitoring Sensor
ROM Library Functions
2.3Scale_Pressure()
2.3.1Description
A 450 kPa range TPMS sensor will typically transmit the pressure value as a single byte within an RF telegram:
the pressure range 100…450 kPa is represented with an unsigned byte ranging from 0…255. A scale factor of
1.373 kPa/LSB is required to meet this typical requirement. The SP37 Meas_Pressure function, however, returns
a signed integer value that represents pressure as 1/16 kPa/LSB. Conversion from 1/16 kPa/LSB to
1.373 kPa/LSB is therefore a commonly required task, but one that is not straightforward as care must be taken
to avoid excessive rounding or loss of precision. The full scale error (FSE) of this function is less than 0.4%.
As a convenience, this Scale_Pressure( ) function performs this conversion. In addition, pressure bounds
checking is performed so that 0 and 255 are returned for input pressure values below 100 kPa and above 450 kPa,
respectively. Finally, to reduce the amount of data handling required by the application program, note that the input
value to Scale_Pressure is passed as a pointer. This allows the same pointer to the Meas_Pressure() output
structure *(PressResult+0) to be re-used as the input pointer to Scale_Pressure().
Note: Scale function is intended to provide backward compatibility with SP30 100…450kPa numeric
representation. The 100kPa and 450kPa bounds checking feature prevents this function from being useful
outside of this range.
2.3.2Actions
•Check 16 bit input value against 100 kPa and 450 kPa bounds, if value is outside of these bounds return 0 or
255, respectively
•Convert input value to unsigned 8 bit return value between 0 and 255
2.3.3Prototype
unsigned char Scale_Pressure(signed int idata * PressureValue)
// Pressure measurement was not successful, underflow or
// overflow of ADC result, Sensor Fault Wire Bond Check,
// or VMIN warning occurred
PressureByte = 0;
}
// 8-bit scaled pressure value is in PressureByte. If pressure was
// 100kPa or less, or there was an error in measurement, PressureByte
// is set to 0. If measured pressure was 450kPa or more, PressureByte
// is set to 255. Otherwise, PressureByte contains a value proportional
// to measured pressure, scaled by 1.373kPa/LSB for pressure above 100kPa.
}
Tire Pressure Monitoring Sensor
2.3.8Code Example
ROM Library Functions
Figure 4Code example for usage of Scale_Pressure()
ROM Library Function Guide44Revision 1.0, 2011-12-15
Page 45
SP37
Tire Pressure Monitoring Sensor
ROM Library Functions
2.4Meas_Acceleration()
2.4.1Description
This function performs an acceleration sensor measurement.
The result can be either:
•Compensated for sensitivity, offset and temperature
•Output as raw value without performing the compensation
The function can measure acceleration with up to 64 samples at a specified sample rate. The function will return
the average (arithmetic mean) acceleration value in order to compensate for noise. Optionally, this function can
return the maximum value of the samples. The function performs a new temperature measurement for
compensating the acceleration measurements, unless a previously measured raw temperature value is supplied.
The number of samples and the raw temperature source are both determined by SensorConfig. SampleRate
controls how frequently the measurement acquisitions occur and will not influence the measurement result under
stable acceleration conditions. The device is set to IDLE mode during the delay between measurement
acquisitions.
2.4.2Actions
•Measure acceleration sensor with channel and number of samples given by SensorConfig
•Check wire bonds between the ASIC and the sensor die & sensor beam integrity
•Average the measurement(s), or (optionally) use the maximum raw measurement, to obtain a raw acceleration
value
•(optionally) Perform a raw temperature measurement
•(optionally) Compensate the raw acceleration value
2.4.3Prototype
unsigned char Meas_Acceleration (unsigned int SensorConfig, unsigned char SampRate, signed int idata *
AccelResult )
ROM Library Function Guide45Revision 1.0, 2011-12-15
xxxx.xxx1
xxxx.xx1xB: Overflow of ADC Result
xxxx.x1xxB: Sensor Fault Wire Bond Check
xxxx.1xxx
xxx1.xxxx
*AccelResult+0signed intCompensated
Acceleration
If Input Bit SensorConfig.6[RAW] == 0:
8000
0000
7FFF
( = 2048 g - 1 LSB where 1 LSB = 1/16 g)
If Input Bit SensorConfig.6[RAW] == 1:
8000
*AccelResult+1signed intRaw Acceleration
Data
10 Bit ADC Result Value:
0000.00xx.xxxx.xxxx
*AccelResult+2Singed intRaw TemperatureIf Input Bit SensorConfig.6[RAW] == 0:
16 Bit scaled signed ADC Result Value
: Success
B
: Underflow of ADC Result
B
: Sensor Fault Diagnosis Resistor
B
: VMIN warning
B
= -2048.0 g
H
= 0.0 g
H
= 2047.9375 g
H
since no compensation is performed
H
B
1)
1)
If Input Bit SensorConfig.6[RAW] == 1:
since no temperature measurement is
8000
H
performed
1) If the acceleration measurement result is within the input range for which its accuracy is specified (e.g. -115 g - 115 g), then
the ADC underflow/overflow condition is due to a measurement failure and the measurement results are not valid.
Otherwise, if the acceleration measurement result is outside of this input range, then the ADC underflow/overflow bits and
the acceleration measurement results may be ignored.
2.4.6Resource Usage
Table 28Meas_Acceleration: Resources
TypeUsed or Modified
// Acceleration measurement was not successful, underflow or
// overflow of ADC result, Sensor Fault Wire Bond Check,
// Sensor Fault Diagnosis Resistor, or VMIN warning occurred
}
}
Tire Pressure Monitoring Sensor
2.4.8Code Example
ROM Library Functions
Figure 5Code example for usage of Meas_Acceleration()
ROM Library Function Guide50Revision 1.0, 2011-12-15
Page 51
SP37
Tire Pressure Monitoring Sensor
ROM Library Functions
2.5Meas_Temperature()
2.5.1Description
This function performs a temperature measurement and returns both raw and compensated temperature results.
The Compensated Temperature result is compensated for sensitivity and offset errors. The Raw Temperature
result is uncompensated and may be used as input for Meas_Sensor(), Meas_Pressure(), Meas_Acceleration()
and Comp_Temperature().
2.5.2Actions
•Measures the temperature sensor with 2 ADC samples for averaging (arithmetic mean).
•Compensate for offset using calibration data stored in FLASH (Compensated Temperature)
2.5.3Prototype
unsigned char Meas_Temperature ( signed int idata * Temp_Result )
// Temperature measurement was not successful, underflow or
// overflow of ADC result or VMIN warning occurred
}
}
Tire Pressure Monitoring Sensor
2.5.8Code Example
ROM Library Functions
Figure 6Code example for usage of Meas_Temperature()
ROM Library Function Guide53Revision 1.0, 2011-12-15
Page 54
SP37
Tire Pressure Monitoring Sensor
ROM Library Functions
2.6Raw_Temperature()
2.6.1Description
This function performs a raw temperature measurement. The Raw Temperature result is uncompensated and may
be used as input for Meas_Sensor(), Meas_Pressure(), Meas_Acceleration() and Comp_Temperature().
2.6.2Actions
•Measures the temperature sensor with 2 ADC samples for averaging (arithmetic mean)
2.6.3Prototype
unsigned char Raw_Temperature ( signed int idata * TempResult )
1) Two additional bytes, not included here, are needed to call the library function
1)
2.6.7Execution Information
Table 37Raw_Temperature: Execution Time and Charge Consumption
ParameterSymbolValuesUnitNote / Test Condition
Min.Typ.Max.
Execution Time
Charge Consumption
t
Q
RAW
RAW
–274299µsDIVIC = 00H,
by default 2 ADC measurements are
taken and averaged
–0,5130,773µCDIVIC = 00H,
by default 2 ADC measurements are
taken and averaged
ROM Library Function Guide55Revision 1.0, 2011-12-15
Page 56
SP37
Tire Pressure Monitoring Sensor
ROM Library Functions
2.7Comp_Temperature()
2.7.1Description
This function will convert a previously obtained raw temperature value into a compensated temperature value. This
function can be called after a pressure, acceleration or raw temperature measurement to compensate the raw
temperature. Thus, the current ambient temperature is obtained without taking an extra temperature
measurement.
2.7.2Actions
•Compensate raw temperature data using calibration data stored in FLASH.
2.7.3Prototype
unsigned char Comp_Temperature (signed int idata TempRawIn, signed int idata * TempResult)
// Temperature compensation was not successful, underflow or
// overflow during compensation occurred
}
}
Tire Pressure Monitoring Sensor
2.7.8Code Example
ROM Library Functions
Figure 7Code example for usage of Comp_Temperature()
ROM Library Function Guide58Revision 1.0, 2011-12-15
Page 59
SP37
Tire Pressure Monitoring Sensor
ROM Library Functions
2.8Meas_Supply_Voltage()
2.8.1Description
This function performs a battery voltage measurement and returns both raw and compensated voltage results. The
compensated battery voltage result is compensated for offset error.
2.8.2Actions
•Measure the supply voltage sensor with 2 ADC samples for averaging
•Compensate for offset using calibration data stored in FLASH
2.8.3Prototype
unsigned char Meas_Supply_Voltage ( signed int idata * Batt_Result )
// Battery voltage measurement was not successful, underflow or
// overflow of ADC result occurred
}
}
Tire Pressure Monitoring Sensor
2.8.8Code Example
ROM Library Functions
Figure 8Code example for usage of Meas_Supply_Voltage()
ROM Library Function Guide61Revision 1.0, 2011-12-15
Page 62
SP37
Tire Pressure Monitoring Sensor
ROM Library Functions
2.9Start_Supply_Voltage()
2.9.1Description
The battery voltage typically shows a significant drop during RF transmission, when a considerable current is
drawn. Calling the monolithic function Meas_Supply_Voltage() during RF transmission is often not feasible
because of its execution time.
A set of three functions to allow battery voltage measurement during RF transmission has been implemented;
Start_Supply_Voltage(), Trig_Supply_Voltage() and Get_Supply_Voltage(). These functions must be called
in this particular sequence, and each function is separately described in detail.
Start_Supply_Voltage() enables and configures the ADC, allows settling of the analogue ADC part, and places the
ADC into standby state. It must be called prior to calling the Trig_Supply_Voltage() function.
2.9.2Actions
•Prepare the ADC and the Supply Voltage Sensor for a measurement
ROM Library Function Guide62Revision 1.0, 2011-12-15
Page 63
SP37
Tire Pressure Monitoring Sensor
ROM Library Functions
2.9.6Resource Usage
Table 48Start_Supply_Voltage: Resources
TypeUsed or Modified
RegistersR7
SFRACC
Stack0 Bytes
1) Two additional bytes, not included here, are needed to call the library function
1)
2.9.7Execution Information
Table 49Start_Supply_Voltage: Execution Time and Charge Consumption
ParameterSymbolValuesUnitNote / Test Condition
Min.Typ.Max.
Execution Time
Charge ConsumptionQ–0,0180,030µCDIVIC = 00
t–1213µsDIVIC = 00
H
H
2.9.8Code Example
See Figure 9 “Code example for usage of the functions Start_Supply_Voltage, Trig_Supply_Voltage and
Get_Supply_Voltage()” on Page 68
ROM Library Function Guide63Revision 1.0, 2011-12-15
Page 64
SP37
Tire Pressure Monitoring Sensor
ROM Library Functions
2.10Trig_Supply_Voltage()
2.10.1Description
Trig_Supply_Voltage() is the second part of a set of three functions to measure the battery voltage during RF
transmission. It is called after Start_Supply_Voltage(), and triggers an ADC battery voltage measurement. Upon
the call of this function the ADC resumes from standby, performs a measurement and then goes back to standby,
keeping the result. Typically this function is called by the application immediately after an RF datagram byte is
shifted into SFR RFD to prevent disruption of RF data transmission.
See Figure 9 “Code example for usage of the functions Start_Supply_Voltage, Trig_Supply_Voltage and
Get_Supply_Voltage()” on Page 68
ROM Library Function Guide65Revision 1.0, 2011-12-15
Page 66
SP37
Tire Pressure Monitoring Sensor
ROM Library Functions
2.11Get_Supply_Voltage()
2.11.1Description
Get_Supply_Voltage() is the third part of a set of three functions to measure the battery voltage during RF
transmission. It reads the measured value obtained during Trig_Supply_Voltage(), turns off the ADC, and
performs battery voltage compensation. Typically this function is called by the application after the RF
transmission is finished.
2.11.2Actions
•Read the ADC result register
•Turn off ADC
•Compensate the result for offset using calibration data stored in FLASH
2.11.3Prototype
unsigned char Get_Supply_Voltage ( signed int idata * Batt_Result )
// Battery voltage measurement was not successful, underflow or
// overflow of ADC result occurred
}
}
Tire Pressure Monitoring Sensor
2.11.8Code Example
ROM Library Functions
Figure 9Code example for usage of the functions Start_Supply_Voltage, Trig_Supply_Voltage and
Get_Supply_Voltage()
ROM Library Function Guide68Revision 1.0, 2011-12-15
Page 69
SP37
Tire Pressure Monitoring Sensor
ROM Library Functions
2.12ADC_Selftest()
2.12.1Description
The ADC self test is a combination of three measurements that use various channels as input and reference for
the ADC. The output of this function is the delta deviation from the ideal value.
2.12.2Actions
•Perform three ADC measurements
•Calculate delta from ideal value
2.12.3Prototype
unsigned char ADC_Selftest(signed int idata * Delta)
1) Two additional bytes, not included here, are needed to call the library function
1)
ROM Library Function Guide71Revision 1.0, 2011-12-15
Page 72
SP37
Tire Pressure Monitoring Sensor
ROM Library Functions
2.13.7Execution Information
Table 65Powerdown: Execution Time and Charge Consumption
ParameterSymbolValuesUnitNote / Test Condition
Min.Typ.Max.
Execution Time
Charge Consumption
t–11,3621,6µsDIVIC = 00
entering PDWN
Q–0,0180,053µCDIVIC = 00
entering PDWN
, ITinit = 0, RFSE = 1 before
H
, ITinit = 0, RFSE = 1 before
H
ROM Library Function Guide72Revision 1.0, 2011-12-15
Page 73
SP37
Tire Pressure Monitoring Sensor
ROM Library Functions
2.14ThermalShutdown()
2.14.1Description
This function forces the device to THERMAL SHUTDOWN state.
The application should call this function whenever the ambient temperature is close to the maximum operating
range (this can be detected by using Meas_Temperature()) to protect the device while the ambient temperature
is above the specified operating conditions.
If this function is called when the temperature is below the TMAX threshold, the function will return without any
action and the application program will continue uninterrupted. If the temperature is above the TMAX threshold,
the TMAX threshold will be reduced (software hysteresis) and the THERMAL SHUTDOWN state is entered.
2.14.2Actions
•Turn on the TMAX Detector
•Enter THERMAL SHUTDOWN state with hysteresis if TMAX Detector is set.
1) Two additional bytes, not included here, are needed to call the library function
1)
ROM Library Function Guide73Revision 1.0, 2011-12-15
Page 74
SP37
Tire Pressure Monitoring Sensor
ROM Library Functions
2.14.7Execution Information
Table 69ThermalShutdown: Execution Time and Charge Consumption
ParameterSymbolValuesUnitNote / Test Condition
Min.Typ.Max.
Execution Time
Charge ConsumptionQ
t
T<TMAX
t
T>TMAX
T<TMAX
Q
T>TMAX
–7379µsTemp. < TMAX: function will return
without any action, DIVIC = 00
–7177µsTemp. > TMAX: function will enter
THERMAL SHUTDOWN state,
DIVIC = 00
H
–0,1090,188µCTemp. < TMAX: function will return
without any action, DIVIC = 00
–0,1060,183µCTemp. > TMAX: function will enter
THERMAL SHUTDOWN state,
DIVIC = 00
H
H
H
ROM Library Function Guide74Revision 1.0, 2011-12-15
Page 75
SP37
Tire Pressure Monitoring Sensor
ROM Library Functions
2.15StartXtalOsc()
2.15.1Description
This function enables the crystal oscillator clock and delays for a defined amount of time. The delay time should
be long enough that the crystal oscillator is stable, which is determined by the crystal startup time (see [1]). The
minimum/maximum tolerance of the delay time may be derived by considering the tolerance of the
12 MHz RC Oscillator (see [1]).
// Return value of start xtal oscillator is stored in StatusByte
unsigned char StatusByte;
// Input parameters for start xtal oscillator
unsigned char Delay = 33;
// Start xtal oscillator function call
StatusByte = StartXtalOsc(Delay);
}
Tire Pressure Monitoring Sensor
ROM Library Functions
2.15.7Execution Information
Table 73StartXtalOsc: Execution Time and Charge Consumption
ParameterSymbolValuesUnitNote / Test Condition
Min.Typ.Max.
Execution Time
Charge
Consumption
1) Values are obtained by extrapolation, not by characterization
1)
1)
t
t
t
Q
Q
Q
30
40
delta
30
40
delta
–13231440µsDIVIC is 0; delay is 30
–17501901µsDIVIC is 0; delay is 40
–52,756,1µsDIVIC is 0; delta delay is 1
–1,222,15µCDIVIC is 0; delay is 30
–1,62,83µCDIVIC is 0; delay is 40
–0,050,09µCDIVIC is 0; delta delay is 1
2.15.8Code Example
Figure 10Code example for usage of StartXtalOsc()
ROM Library Function Guide76Revision 1.0, 2011-12-15
Page 77
SP37
Tire Pressure Monitoring Sensor
ROM Library Functions
2.16StopXtalOsc()
2.16.1Description
This function disables the crystal oscillator clock if no other peripherals are using it. Therefore, peripherals using
the crystal oscillator should be disabled prior to calling this function.
Table 77StopXtalOsc: Execution Time and Charge Consumption
ParameterSymbolValuesUnitNote / Test Condition
Min.Typ.Max.
Execution Time
Charge ConsumptionQ–0,0350,058µCDIVIC = 00
t–2022µsDIVIC = 00
H
H
2.16.8Code Example
Figure 11Code example for usage of StopXtalOsc()
ROM Library Function Guide78Revision 1.0, 2011-12-15
Page 79
SP37
Tire Pressure Monitoring Sensor
ROM Library Functions
2.17PLL_Ref_Signal_Check()
2.17.1Description
This function can be called prior to VCO_Tuning() routine to test the lowest and highest VCO tuning curves that
are disjoint in terms of operating frequencies. If the PLL Lock Detector indicates lock for both of the disjoint VCO
tuning curves, a malfunction of the Crystal Resonator is most likely the source of the fault.
2.17.2Actions
•Select the lowest tuning curve and check the PLL Lock Detector result
•Select the highest tuning curve and check the PLL Lock Detector result
1) Two additional bytes, not included here, are needed to call the library function
1)
ROM Library Function Guide79Revision 1.0, 2011-12-15
Page 80
SP37
Tire Pressure Monitoring Sensor
ROM Library Functions
2.17.7Execution Information
Table 81PLL_Ref_Signal_Check: Execution Time and Charge Consumption
ParameterSymbolValuesUnitNote / Test Condition
Min.Typ.Max.
Execution Time
Charge ConsumptionQ–0,410,71µCDIVIC = 00
t–273295µsDIVIC = 00
H
H
ROM Library Function Guide80Revision 1.0, 2011-12-15
Page 81
SP37
Tire Pressure Monitoring Sensor
ROM Library Functions
2.18VCO_Tuning()
2.18.1Description
This function selects an appropriate tuning curve for the VCO and enables the PLL. If no proper tuning curve could
be selected the PLL will be disabled before the function returns with an error result.
Notes
1. If RF transmission is not performed immediately after this function is called, it is recommended to disable the
PLL by clearing SFR bit RFC.1[ENPLL] to reduce the current consumption.
2. Re-Calibration of the tuning curve is necessary when
than 70 °C
1) Two additional bytes, not included here, are needed to call the library function
1)
2.18.7Execution Information
Table 84VCO_Tuning: Execution Time and Charge Consumption
ParameterSymbolValuesUnitNote / Test Condition
Min.Typ.Max.
Execution Time
Charge ConsumptionQ
t
firstTUN
t
reTUN
firstTUN
Q
reTUN
–23602560µsFirst tuning (after RESET), DIVIC is 00
–915989µsRe-tuning, DIVIC is 00
–14,224,1µCFirst tuning (after RESET), DIVIC is 00
–5,5249,2µCRe-tuning, DIVIC is 00
H
H
H
H
ROM Library Function Guide82Revision 1.0, 2011-12-15
Page 83
SP37
Tire Pressure Monitoring Sensor
ROM Library Functions
2.19IntervalTimerCalibration()
2.19.1Description
This function initiates a calibration of the Interval Timer precounter (ITPL and ITPH) to obtain a specific interval
timer timebase between 1Hz and 20Hz. The function can work with both clock sources (12MHz RC Clock and
Crystal clock), utilizing a special timer mode.
Note: To obtain the best possible Interval Timer accuracy, this function should be called after the crystal oscillator
has already been enabled.
In case the crystal oscillator is used the crystal frequency in Hz divided by 2 has to be stored in the FLASH user
configuration sector at address 57FA
not within the range of 9 MHz to 10 MHz a default clock frequency of 9.843750 MHz (XTAL/2 for 315 MHz carrier)
is assumed for the tuning.
In addition, this function automatically calibrates the LF On/Off Timer precounter (SFR LFOOTP) to 50 ms.
(MSByte) to 57FCH (LSByte). If the value found at this FLASH location is
H
2.19.2Actions
•Calibrate the interval timer precounter (SFR ITPL, SFR ITPH) to the value passed in WU_Frequency
•Calibrate the LF On/Off Timer precounter (SFR LFOOTP) to 50 ms
2.19.3Prototype
signed char IntervalTimerCalibration(unsigned char WU_Frequency)
1) Two additional bytes, not included here, are needed to call the library function
1)
2.19.7Execution Information
Table 88IntervalTimerCalibration: Execution Time and Charge Consumption
ParameterSymbolValuesUnitNote / Test Condition
Min.Typ.Max.
Execution Time
Execution Time
Charge
Consumption
Charge
Consumption
1) Values are obtained by extrapolation, not by characterization
1)
t
12Mhz
–11901680µsDIVIC = 00H, Clock Source is
12 MHz RC HF Oscillator
1)
1)
1)
t
XTAL
Q
Q
12MHz
XTAL
–11301570µsDIVIC = 00HClock Source is XTAL
–1,232,56µCDIVIC = 00H, Clock Source is
12 MHz RC HF Oscillator
–1,603,04µCDIVIC = 00HClock Source is XTAL
ROM Library Function Guide84Revision 1.0, 2011-12-15
Page 85
SP37
Tire Pressure Monitoring Sensor
ROM Library Functions
2.20LFBaudrateCalibration()
2.20.1Description
Calling this function calibrates the LF baudrate divider using the crystal oscillator as a frequency reference, thus
reducing the impact of offset and the current drift of the LF RC Oscillator upon the LF baudrate accuracy.
It is mandatory to call this function prior to the first use of the LF Receiver.
The calibrated SFR LFDIV value may be stored in the FLASH and loaded into SFR LFDIV anytime the
LF Receiver is operated. If this calibration is performed regularly by the application, the bitrate tolerance of the
transmitted LF data may be increased beyond the value normally specified (see [1]).
Prior to calling this function the crystal oscillator must be enabled by calling StartXtalOsc() and the crystal
frequency in Hz divided by 2 has to be stored in the FLASH user configuration sector at address 57FA
to 57FC
clock frequency of 9.843750 MHz (XTAL/2 for 315 MHz carrier) is used for the tuning and the function returns an
error in the StatusByte and sets SFR LFDIV to a nominal value.
(LSByte). If the value found at this FLASH location is not within the range of 9 MHz to 10 MHz a default
H
(MSByte)
H
2.20.2Actions
•Set SFR LFDIV according to the current frequency of the LF RC Oscillator
2.20.3Prototype
signed char LFBaudrateCalibration(unsigned int baudrate)
1) Two additional bytes, not included here, are needed to call the library function
1)
2.20.7Execution Information
Table 92LFBaudrateCalibration: Execution Time and Charge Consumption
ParameterSymbolValuesUnitNote / Test Condition
Min.Typ.Max.
Execution Time
Charge
Consumption
1) Values are obtained by extrapolation, not by characterization
1)
1)
t
XTAL
Q
XTAL
–9831070µsBaudrate = 3900
DIVIC = 00
H
–1,572,57µCBaudrate = 3900
DIVIC = 00
H
ROM Library Function Guide86Revision 1.0, 2011-12-15
Page 87
SP37
Tire Pressure Monitoring Sensor
ROM Library Functions
2.21SMulIntInt() (16Bit * 16Bit)
2.21.1Description
This function multiplies the first signed int value (16 bit) Multiplicand1 by the second signed int value (16bit)
Multiplicand2 and produces a 32-bit signed result.
2.21.2Actions
•Perform multiplication
2.21.3Prototype
void SMulIntInt(signed int idata * Multiplicand1, signed int idata * Multiplicand2, signed long idata * Product)
1) Two additional bytes, not included here, are needed to call the library function
1)
ROM Library Function Guide91Revision 1.0, 2011-12-15
Page 92
SP37
Tire Pressure Monitoring Sensor
ROM Library Functions
2.23.7Execution Information
Table 104UDivIntInt: Execution Time and Charge Consumption
ParameterSymbolValuesUnitNote / Test Condition
Min.Typ.Max.
Execution Time
Charge ConsumptionQ–0,1560,270µCDIVIC = 00
t–104113µsDIVIC = 00
H
H
ROM Library Function Guide92Revision 1.0, 2011-12-15
Page 93
SP37
Tire Pressure Monitoring Sensor
ROM Library Functions
2.24CRC8_Calc()
2.24.1Description
This function calculates the CRC-8 checksum for a memory area in RAM using a fixed polynomial (x8+x2+x+1).
The CRC-8 calculation starts with a defined preload value.
1) Two additional bytes, not included here, are needed to call the library function
1)
2.24.7Execution Information
Table 108CRC8_Calc: Execution Time and Charge Consumption
ParameterSymbolValuesUnitNote / Test Condition
Min.Typ.Max.
Execution Time
Charge Consumption
t–8 + x*99 + x*10 µsDIVIC = 00
Q–0,012 +
x*0,013
0,021 +
x*0,023
µCDIVIC = 00H, x is the number of bytes
, x is the number of bytes
H
ROM Library Function Guide94Revision 1.0, 2011-12-15
Page 95
SP37
Tire Pressure Monitoring Sensor
ROM Library Functions
2.25CRC_Baicheva_Calc()
2.25.1Description
This function calculates a 8-bit CRC checksum for a memory area in RAM using a fixed polynomial
8+x5+x3+x2
(x
Automotive Industry (VDA) and is optimal for data word length of 119 bits and below. The CRC Baicheva
calculation starts with a defined preload value. The VDA protocol requires that a preload value of AA
+x+1). It supports the standardized TPMS data protocol from the German Association of the