Infineon SP37 Function Manual

High integrated single-chip tpms sensor with a low power embedded microcontroller and wireless fsk/ask uhf transmitter
Table of Contents

Advertisement

T P M S
Tire Pressure Monitoring Sensor
S P 3 7
High integrated single-chip TPMS sensor with a low power embedded micro-
controller and wireless FSK/ASK UHF transmitter
SP370 900kPa Version A5
R O M L i b r a r y F u n c t i o n G u i d e
Revision 1.0, 2011-12-15
S e n s e & C o n t r o l

Advertisement

Table of Contents
loading

Summary of Contents for Infineon SP37

  • Page 1 T P M S Tire Pressure Monitoring Sensor S P 3 7 High integrated single-chip TPMS sensor with a low power embedded micro- controller and wireless FSK/ASK UHF transmitter SP370 900kPa Version A5 R O M L i b r a r y F u n c t i o n G u i d e Revision 1.0, 2011-12-15 S e n s e &...
  • Page 2 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.
  • Page 3 SP37 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 Page Subjects (major changes since last revision) Page 17...
  • Page 4 SP37 Tire Pressure Monitoring Sensor Trademarks of Infineon Technologies AG AURIX™, C166™, CanPAK™, CIPOS™, CIPURSE™, EconoPACK™, CoolMOS™, CoolSET™, CORECONTROL™, CROSSAVE™, DAVE™, EasyPIM™, EconoBRIDGE™, EconoDUAL™, EconoPIM™, EiceDRIVER™, eupec™, FCOS™, HITFET™, HybridPACK™, I²RF™, ISOFACE™, IsoPACK™, MIPAQ™, ModSTACK™, my-d™, NovalithIC™, OptiMOS™, ORIGA™, PRIMARION™, PrimePACK™, PrimeSTACK™, PRO-SIL™,...
  • Page 5: Table Of Contents

    SP37 Tire Pressure Monitoring Sensor Table of Contents Table of Contents Table of Contents ..............5 List of Figures .
  • Page 6 SP37 Tire Pressure Monitoring Sensor Table of Contents 2.4.8 Code Example ..............50 Meas_Temperature() .
  • Page 7 SP37 Tire Pressure Monitoring Sensor Table of Contents 2.10.6 Resource Usage ............. . . 64 2.10.7...
  • Page 8 SP37 Tire Pressure Monitoring Sensor Table of Contents 2.16.6 Resource Usage ............. . . 77 2.16.7...
  • Page 9 SP37 Tire Pressure Monitoring Sensor Table of Contents 2.23 UDivIntInt() (16Bit : 16Bit) ............91 2.23.1...
  • Page 10 SP37 Tire Pressure Monitoring Sensor Table of Contents 2.29.2 Actions ..............103 2.29.3...
  • Page 11 SP37 Tire Pressure Monitoring Sensor Table of Contents 2.35.3 Prototype ..............115 2.35.4...
  • Page 12: List Of Figures

    SP37 OpCode Map........
  • Page 13: List Of Tables

    SP37 Tire Pressure Monitoring Sensor List of Tables List of Tables Table 1 Definition of types ............. 17 Table 2 Wakeup Handler .
  • Page 14 SP37 Tire Pressure Monitoring Sensor List of Tables Table 50 Trig_Supply_Voltage: Input Parameters ..........64 Table 51 Trig_Supply_Voltage: Output values .
  • Page 15 SP37 Tire Pressure Monitoring Sensor List of Tables Table 101 UDivIntInt: Input Parameters ........... . . 91 Table 102 UDivIntInt: Output values .
  • Page 16 SP37 Tire Pressure Monitoring Sensor List of Tables Table 152 HIRC_Clock_Check: Execution Time and Charge Consumption ......116 Table 153 GetCompValue: Input Parameters .
  • Page 17: Introduction

    Tire Pressure Monitoring Sensor Introduction Introduction General 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.
  • Page 18: Restricted Ram And Flash Areas

    Flash locations are restored to the proper values. 8051 Instruction Set Summary As the SP37 incorporates an 8051 compatible microcontroller, Figure 1 shows the SP37 OpCode Map.
  • Page 19: Figure 1 Sp37 Opcode Map

    R5,A R6,A R7,A @R0,A @R1,A @R0,A @R1,A @DPTR,A mnemonic addressing mode DPTR inst. length (bytes) inst. cycles (* indicates optimzed) 1/2* All mnemonics Copyright © 1980 Intel Corporation. Figure 1 SP37 OpCode Map ROM Library Function Guide Revision 1.0, 2011-12-15...
  • Page 20: Rom Library Functions

    SP37 Tire Pressure Monitoring Sensor ROM Library Functions ROM Library Functions The following library functions are available for application usage: Table 3 ROM Library functions ROM Library function Description Page Meas_Sensor() Measures the ambient air pressure or acceleration Page 22...
  • Page 21 SP37 Tire Pressure Monitoring Sensor ROM Library Functions Table 3 ROM Library functions (cont’d) ROM Library function Description Page CRC16_Check() Evaluates the CRC16 result of a memory block Page 113 HIRC_Clock_Check() Evaluates the 12 MHz_RC_Oscillator frequency Page 115 GetCompValue() Returns a compensated value from look up table...
  • Page 22: Meas_Sensor()

    The choice of the pressure measurement range can also be performed manually.The pressure hysteresis thresholds can be selected: either predefined from Infineon factory- default setting, or specified when calling this function (see SensorResult).
  • Page 23: Inputs

    SP37 Tire Pressure Monitoring Sensor ROM Library Functions 2.1.4 Inputs Table 4 Meas_Sensor: Input Parameters Register / Address Type Name Description R6 (MSB) unsigned int SensorConfig Defines Sensor Configuration (refer to Table 5 R7 (LSB) Table unsigned char SampleRate Defines the number of system clock cycles (12 MHz RC Oscillator) divided by 8 which is waited between consecutive measurements.
  • Page 24: Table 5 Meas_Sensor: Input Parameter: Sensorconfig[15:8]

    SP37 Tire Pressure Monitoring Sensor ROM Library Functions Table 5 Meas_Sensor: Input Parameter: SensorConfig[15:8] Bit 15 Bit 14 Bit 13 Bit 12 Bit 11 Bit 10 Bit 9 Bit 8 HYST ARANGE PRANGE RAWTemp RES bits have to be set to 0...
  • Page 25: Table 7 Meas_Sensor: Input Parameter: Samplerate

    SP37 Tire Pressure Monitoring Sensor ROM Library Functions Table 6 Meas_Sensor: Input Parameter: SensorConfig[7:0] (cont’d) Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 Sens_Type MODE 2POWN.2 2POWN.1 2POWN.0 Mode Acceleration and Pressure Mode:...
  • Page 26: Outputs

    SP37 Tire Pressure Monitoring Sensor ROM Library Functions 2.1.5 Outputs Table 8 Meas_Sensor: Output values Register/ Address Type Name Description unsigned char StatusByte 0000.0000 : Success xxxx.xxx1 : Underflow of ADC Result xxxx.xx1x : Overflow of ADC Result xxxx.x1xx : Sensor Fault Wire Bond Check xxxx.1xxx...
  • Page 27: Resource Usage

    SP37 Tire Pressure Monitoring Sensor ROM Library Functions 2.1.6 Resource Usage Table 9 Meas_Sensor: Resources Type Used or Modified Registers R0, R1, R2, R3, R4, R5, R6, R7 ACC, B, CFG0 , CFG1, CFG2, DIVIC, DPH, DPL, PSW, TCON , TH0...
  • Page 28: Execution Information

    SP37 Tire Pressure Monitoring Sensor ROM Library Functions 2.1.7 Execution Information Table 10 Meas_Sensor: Pressure Measurement: Execution Time and Charge Consumption Parameter Symbol Values Unit Note / Test Condition Min. Typ. Max. Execution Time – 1016 µs DIVIC = 00...
  • Page 29 SP37 Tire Pressure Monitoring Sensor ROM Library Functions Table 10 Meas_Sensor: Pressure Measurement: Execution Time and Charge Consumption (cont’d) Parameter Symbol Values Unit Note / Test Condition Min. Typ. Max. Charge Consumption in – 1,643 2,515 µC DIVIC = 00...
  • Page 30: Table 11 Meas_Sensor: Acceleration Measurement: Execution Time And Charge Consumption

    SP37 Tire Pressure Monitoring Sensor ROM Library Functions Table 11 Meas_Sensor: Acceleration Measurement: Execution Time and Charge Consumption Parameter Symbol Values Unit Note / Test Condition Min. Typ. Max. Execution Time Compensated – 1013 µs DIVIC = 00 comp,new with new raw temperature...
  • Page 31: Meas_Pressure()

    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.
  • Page 32: Inputs

    SP37 Tire Pressure Monitoring Sensor ROM Library Functions 2.2.4 Inputs Table 12 Meas_Pressure: Input Parameters Register / Address Type Name Description R6 (MSB) unsigned int SensorConfig Defines Sensor Configuration (refer to Table 13 R7 (LSB) Table unsigned char SampleRate Defines the number of system clock cycles (12 MHz RC Oscillator) divided by 8 which is waited between consecutive measurements.
  • Page 33: Table 13 Meas_Pressure: Input Parameter: Sensorconfig[15:8]

    SP37 Tire Pressure Monitoring Sensor ROM Library Functions Table 13 Meas_Pressure: Input Parameter: SensorConfig[15:8] Bit 15 Bit 14 Bit 13 Bit 12 Bit 11 Bit 10 Bit 9 Bit 8 HYST ARANGE PRANGE RAWTemp RES bits have to be set to 0...
  • Page 34: Table 14 Meas_Pressure: Input Parameter: Sensorconfig[7:0]

    SP37 Tire Pressure Monitoring Sensor ROM Library Functions Table 14 Meas_Pressure: Input Parameter: SensorConfig[7:0] Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 Sens_Type MODE 2POWN.2 2POWN.1 2POWN.0 Sens_Type Select Pressure Measurement : Pressure Measurement Defines if the raw ADC result is compensated : Temperature compensation is performed.
  • Page 35: Outputs

    SP37 Tire Pressure Monitoring Sensor ROM Library Functions 2.2.5 Outputs Table 16 Meas_Pressure: Output values Register/ Address Type Name Description unsigned char StatusByte 0000.0000 : Success xxxx.xxx1 : Underflow of ADC Result xxxx.xx1x : Overflow of ADC Result xxxx.x1xx : Sensor Fault Wire Bond Check xxx1.xxxx...
  • Page 36: Automatic 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 500- 900kPa. When the Automatic Pressure Range feature is enabled, the SP37 applies the calibration from the most appropriate pressure range.
  • Page 37: Figure 2 Flow Chart For Configuration Of Sensorconfig For Meas_Pressure() Function

    SP37 Tire Pressure Monitoring Sensor ROM Library Functions SensorConfig parameter : Bit 11 Select thresholds for press . hysteresis 0 = Factory-default setting 1 = Customer specified Bit 10 Automatic range selection Meas_Pressure 0 = Manual 1 = Automatic (Bit 9 will be ignored)
  • Page 38: Resource Usage

    SP37 Tire Pressure Monitoring Sensor ROM Library Functions 2.2.7 Resource Usage Table 17 Meas_Pressure: Resources Type Used or Modified Registers R0, R1, R2, R3, R4, R5, R6, R7 ACC, B, CFG0 , CFG1, CFG2, DIVIC, DPH, DPL, PSW, TCON , TH0...
  • Page 39: Execution Information

    SP37 Tire Pressure Monitoring Sensor ROM Library Functions 2.2.8 Execution Information Table 18 Meas_Pressure: Execution Time and Charge Consumption Parameter Symbol Values Unit Note / Test Condition Min. Typ. Max. Execution Time Compensated – 1017 µs DIVIC = 00 comp,new...
  • Page 40 SP37 Tire Pressure Monitoring Sensor ROM Library Functions Table 18 Meas_Pressure: Execution Time and Charge Consumption (cont’d) Parameter Symbol Values Unit Note / Test Condition Min. Typ. Max. Charge consumption in – 1,644 2,519 µC DIVIC = 00 autocomp, automatic range selection...
  • Page 41: Code Example

    SP37 Tire Pressure Monitoring Sensor ROM Library Functions 2.2.9 Code Example // Library function prototypes #include "SP37_ROMLibrary.h" void main() // Return value of pressure measurement is stored in StatusByte unsigned char StatusByte; // Input parameters for pressure measurement // Configure register to perform a 2-sample pressure measurement // Automatic Range Selection unsigned int SensorConfig = 0x0481;...
  • Page 42: Scale_Pressure()

    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...
  • Page 43: Resource Usage

    SP37 Tire Pressure Monitoring Sensor ROM Library Functions 2.3.6 Resource Usage Table 21 Scale_Pressure: Resources Type Used or Modified Registers R0, R2, R3, R4, R5, R6, R7 A, B, PSW Stack 4 bytes 1) Two additional bytes, not included here, are needed to call the library function 2.3.7...
  • Page 44: Code Example

    SP37 Tire Pressure Monitoring Sensor ROM Library Functions 2.3.8 Code Example // Library function prototypes #include "SP37_ROMLibrary.h" void main() // Return value of pressure measurement is stored in StatusByte unsigned char StatusByte; // 8-bit pressure value is stored in PressureByte unsigned char PressureByte;...
  • Page 45: Meas_Acceleration()

    SP37 Tire Pressure Monitoring Sensor ROM Library Functions Meas_Acceleration() 2.4.1 Description 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.
  • Page 46: Inputs

    SP37 Tire Pressure Monitoring Sensor ROM Library Functions 2.4.4 Inputs Table 23 Meas_Acceleration: Input Parameters Register / Address Type Name Description R6 (MSB) unsigned int SensorConfig Defines Sensor Configuration (refer to Table 24 R7 (LSB) Table unsigned char SampleRate Defines the number of system clock cycles (12 MHz RC Oscillator) divided by 8 which is waited between consecutive measurements.
  • Page 47: Table 24 Meas_Acceleration: Input Parameter: Sensorconfig[15:8]

    SP37 Tire Pressure Monitoring Sensor ROM Library Functions Table 24 Meas_Acceleration: Input Parameter: SensorConfig[15:8] Bit 15 Bit 14 Bit 13 Bit 12 Bit 11 Bit 10 Bit 9 Bit 8 RAWTemp Must be set to 0. RAWTemp Selects source of raw temperature data for compensation...
  • Page 48: Outputs

    SP37 Tire Pressure Monitoring Sensor ROM Library Functions 2.4.5 Outputs Table 27 Meas_Acceleration: Output values Register/ Address Type Name Description unsigned char StatusByte 0000.0000 : Success xxxx.xxx1 : Underflow of ADC Result xxxx.xx1x : Overflow of ADC Result xxxx.x1xx : Sensor Fault Wire Bond Check xxxx.1xxx...
  • Page 49: Execution Information

    SP37 Tire Pressure Monitoring Sensor ROM Library Functions 2.4.7 Execution Information Table 29 Meas_Acceleration: Execution Time and Charge Consumption Parameter Symbol Values Unit Note / Test Condition Min. Typ. Max. Execution Time Compensated – 1015 µs DIVIC = 00 comp,new...
  • Page 50: Code Example

    SP37 Tire Pressure Monitoring Sensor ROM Library Functions 2.4.8 Code Example // Library function prototypes #include "SP37_ROMLibrary.h" void main() // Return value of acceleration measurement is stored in StatusByte unsigned char StatusByte; // Input parameters for acceleration measurement unsigned int SensorConfig = 0x0001;...
  • Page 51: Meas_Temperature()

    SP37 Tire Pressure Monitoring Sensor ROM Library Functions Meas_Temperature() 2.5.1 Description 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().
  • Page 52: Resource Usage

    SP37 Tire Pressure Monitoring Sensor ROM Library Functions 2.5.6 Resource Usage Table 32 Meas_Temperature: Resources Type Used or Modified Registers R0, R1, R2, R3, R4, R5, R6, R7 ACC, B, CFG0, CFG1, CFG2, DIVIC, DPH, DPL, PSW Stack 9 Bytes 1) Two additional bytes, not included here, are needed to call the library function 2.5.7...
  • Page 53: Code Example

    SP37 Tire Pressure Monitoring Sensor ROM Library Functions 2.5.8 Code Example // Library function prototypes #include "SP37_ROMLibrary.h" void main() // Return value of temperature measurement is stored in StatusByte unsigned char StatusByte; // struct for temperature measurement results struct{ signed int Temperature;...
  • Page 54: Raw_Temperature()

    SP37 Tire Pressure Monitoring Sensor ROM Library Functions Raw_Temperature() 2.6.1 Description 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.2 Actions • Measures the temperature sensor with 2 ADC samples for averaging (arithmetic mean) 2.6.3...
  • Page 55: Resource Usage

    SP37 Tire Pressure Monitoring Sensor ROM Library Functions 2.6.6 Resource Usage Table 36 Raw_Temperature: Resources Type Used or Modified Registers R0, R3, R4, R5, R6, R7 ACC, B, CFG0, CFG1, CFG2, DPH, DPL, PSW Stack 5 Bytes 1) Two additional bytes, not included here, are needed to call the library function 2.6.7...
  • Page 56: Comp_Temperature()

    SP37 Tire Pressure Monitoring Sensor ROM Library Functions Comp_Temperature() 2.7.1 Description 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.
  • Page 57: Resource Usage

    SP37 Tire Pressure Monitoring Sensor ROM Library Functions 2.7.6 Resource Usage Table 40 Comp_Temperature: Resources Type Used or Modified Registers R0, R1, R2, R3, R4, R5, R6, R7 ACC, B, DPH, DPL, PSW Stack 4 Bytes 1) Two additional bytes, not included here, are needed to call the library function 2.7.7...
  • Page 58: Code Example

    SP37 Tire Pressure Monitoring Sensor ROM Library Functions 2.7.8 Code Example // Library function prototypes #include "SP37_ROMLibrary.h" void main() // Return value of pressure and temperature measurement is stored in StatusByte unsigned char StatusByte; // Input parameters for pressure measurement unsigned int SensorConfig = 0x0081;...
  • Page 59: Meas_Supply_Voltage()

    SP37 Tire Pressure Monitoring Sensor ROM Library Functions Meas_Supply_Voltage() 2.8.1 Description 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.2 Actions • Measure the supply voltage sensor with 2 ADC samples for averaging •...
  • Page 60: Table 44 Meas_Supply_Voltage: Resources

    SP37 Tire Pressure Monitoring Sensor ROM Library Functions 2.8.6 Resource Usage Table 44 Meas_Supply_Voltage: Resources Type Used or Modified Registers R0, R1, R2, R3, R4, R5, R6, R7 ACC, B, CFG0, CFG1, CFG2, DIVIC, DPH, DPL, PSW Stack 3 Bytes 1) Two additional bytes, not included here, are needed to call the library function 2.8.7...
  • Page 61: Figure 8 Code Example For Usage Of Meas_Supply_Voltage()

    SP37 Tire Pressure Monitoring Sensor ROM Library Functions 2.8.8 Code Example // Library function prototypes #include "SP37_ROMLibrary.h" void main() // Return value of battery voltage measurement is stored in StatusByte unsigned char StatusByte; // struct for battery voltage measurement results struct{ signed int Voltage;...
  • Page 62: Table 46 Start_Supply_Voltage: Input Parameters

    SP37 Tire Pressure Monitoring Sensor ROM Library Functions Start_Supply_Voltage() 2.9.1 Description 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.
  • Page 63: Table 48 Start_Supply_Voltage: Resources

    SP37 Tire Pressure Monitoring Sensor ROM Library Functions 2.9.6 Resource Usage Table 48 Start_Supply_Voltage: Resources Type Used or Modified Registers Stack 0 Bytes 1) Two additional bytes, not included here, are needed to call the library function 2.9.7 Execution Information...
  • Page 64: Resource Usage

    SP37 Tire Pressure Monitoring Sensor ROM Library Functions 2.10 Trig_Supply_Voltage() 2.10.1 Description 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.
  • Page 65: Execution Information

    SP37 Tire Pressure Monitoring Sensor ROM Library Functions 2.10.7 Execution Information Table 53 Trig_Supply_Voltage: Execution Time and Charge Consumption Parameter Symbol Values Unit Note / Test Condition Min. Typ. Max. Execution Time – µs DIVIC = 00 DIVIC=0 – µs...
  • Page 66: Get_Supply_Voltage()

    SP37 Tire Pressure Monitoring Sensor ROM Library Functions 2.11 Get_Supply_Voltage() 2.11.1 Description 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.
  • Page 67: Resource Usage

    SP37 Tire Pressure Monitoring Sensor ROM Library Functions 2.11.6 Resource Usage Table 56 Get_Supply_Voltage: Resources Type Used or Modified Registers R0, R1, R2, R3, R4, R5, R6, R7 ACC, B, CFG1, CFG2, DIVIC, DPH, DHL, PSW Stack 3 Bytes 1) Two additional bytes, not included here, are needed to call the library function 2.11.7...
  • Page 68: Code Example

    SP37 Tire Pressure Monitoring Sensor ROM Library Functions 2.11.8 Code Example // Library function prototypes #include "SP37_ROMLibrary.h" void main() // Return value of battery voltage measurement is stored in StatusByte unsigned char StatusByte; // struct for battery voltage measurement results struct{ signed int Voltage;...
  • Page 69: Adc_Selftest()

    SP37 Tire Pressure Monitoring Sensor ROM Library Functions 2.12 ADC_Selftest() 2.12.1 Description 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.
  • Page 70: Resource Usage

    SP37 Tire Pressure Monitoring Sensor ROM Library Functions 2.12.6 Resource Usage Table 60 ADC_Selftest: Resources Type Used or Modified Registers R0, R1, R2, R3, R4, R5, R6, R7 ACC, B, CFG0, CFG1, CFG2, DIVIC, DPH, DPL,PSW Stack 7 Bytes 1) Two additional bytes, not included here, are needed to call the library function 2.12.7...
  • Page 71: Powerdown()

    SP37 Tire Pressure Monitoring Sensor ROM Library Functions 2.13 Powerdown() 2.13.1 Description This function forces the device to POWER DOWN state. 2.13.2 Actions • If an RF Transmission is in process, wait until it has completed • If the SFR ITPR has been updated, wait for the Interval Timer to initialize •...
  • Page 72: Execution Information

    SP37 Tire Pressure Monitoring Sensor ROM Library Functions 2.13.7 Execution Information Table 65 Powerdown: Execution Time and Charge Consumption Parameter Symbol Values Unit Note / Test Condition Min. Typ. Max. Execution Time – 11,36 21,6 µs DIVIC = 00 , ITinit = 0, RFSE = 1 before...
  • Page 73: Thermalshutdown()

    SP37 Tire Pressure Monitoring Sensor ROM Library Functions 2.14 ThermalShutdown() 2.14.1 Description 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.
  • Page 74: Execution Information

    SP37 Tire Pressure Monitoring Sensor ROM Library Functions 2.14.7 Execution Information Table 69 ThermalShutdown: Execution Time and Charge Consumption Parameter Symbol Values Unit Note / Test Condition Min. Typ. Max. Execution Time – µs Temp. < TMAX: function will return T<TMAX...
  • Page 75: Startxtalosc()

    SP37 Tire Pressure Monitoring Sensor ROM Library Functions 2.15 StartXtalOsc() 2.15.1 Description 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]).
  • Page 76: Execution Information

    SP37 Tire Pressure Monitoring Sensor ROM Library Functions 2.15.7 Execution Information Table 73 StartXtalOsc: Execution Time and Charge Consumption Parameter Symbol Values Unit Note / Test Condition Min. Typ. Max. Execution Time – 1323 1440 µs DIVIC is 0; delay is 30 –...
  • Page 77: Stopxtalosc()

    SP37 Tire Pressure Monitoring Sensor ROM Library Functions 2.16 StopXtalOsc() 2.16.1 Description 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.
  • Page 78: Execution Information

    SP37 Tire Pressure Monitoring Sensor ROM Library Functions 2.16.7 Execution Information Table 77 StopXtalOsc: Execution Time and Charge Consumption Parameter Symbol Values Unit Note / Test Condition Min. Typ. Max. Execution Time – µs DIVIC = 00 Charge Consumption –...
  • Page 79: Pll_Ref_Signal_Check()

    SP37 Tire Pressure Monitoring Sensor ROM Library Functions 2.17 PLL_Ref_Signal_Check() 2.17.1 Description 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.
  • Page 80: Execution Information

    SP37 Tire Pressure Monitoring Sensor ROM Library Functions 2.17.7 Execution Information Table 81 PLL_Ref_Signal_Check: Execution Time and Charge Consumption Parameter Symbol Values Unit Note / Test Condition Min. Typ. Max. Execution Time – µs DIVIC = 00 Charge Consumption –...
  • Page 81: Vco_Tuning()

    SP37 Tire Pressure Monitoring Sensor ROM Library Functions 2.18 VCO_Tuning() 2.18.1 Description 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.
  • Page 82: Resource Usage

    SP37 Tire Pressure Monitoring Sensor ROM Library Functions 2.18.6 Resource Usage Table 83 VCO_Tuning: Resources Type Used or Modified Registers R0, R1, R5, R6, R7 ACC, DIVIC, PSW, RFC Stack 4 Bytes 1) Two additional bytes, not included here, are needed to call the library function 2.18.7...
  • Page 83: Intervaltimercalibration()

    SP37 Tire Pressure Monitoring Sensor ROM Library Functions 2.19 IntervalTimerCalibration() 2.19.1 Description 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.
  • Page 84: Outputs

    SP37 Tire Pressure Monitoring Sensor ROM Library Functions 2.19.5 Outputs Table 86 IntervalTimerCalibration: Output values Register/ Address Type Name Description signed char StatusByte StatusByte: 0: Success -1: No valid crystal frequency found in FLASH -2: Input parameter out of range 2.19.6...
  • Page 85: Lfbaudratecalibration()

    SP37 Tire Pressure Monitoring Sensor ROM Library Functions 2.20 LFBaudrateCalibration() 2.20.1 Description 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.
  • Page 86: Resource Usage

    SP37 Tire Pressure Monitoring Sensor ROM Library Functions 2.20.6 Resource Usage Table 91 LFBaudrateCalibration: Resources Type Used or Modified Registers R0, R1, R2, R3, R4, R5, R6, R7 ACC, B, CFG0, DPTR, LFDIV, PSW, TCON, TMOD, TH0, TH1, TL0, TL1...
  • Page 87: Smulintint() (16Bit * 16Bit)

    SP37 Tire Pressure Monitoring Sensor ROM Library Functions 2.21 SMulIntInt() (16Bit * 16Bit) 2.21.1 Description 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.
  • Page 88: Execution Information

    SP37 Tire Pressure Monitoring Sensor ROM Library Functions 2.21.7 Execution Information Table 96 SMulIntInt: Execution Time and Charge Consumption Parameter Symbol Values Unit Note / Test Condition Min. Typ. Max. Execution Time – µs DIVIC = 00 Charge Consumption –...
  • Page 89: Udivlonglong() (32Bit : 32Bit)

    SP37 Tire Pressure Monitoring Sensor ROM Library Functions 2.22 UDivLongLong() (32Bit : 32Bit) 2.22.1 Description This function divides the unsigned long value (32 bit) Dividend by the unsigned long value (32 bit) Divisor. 2.22.2 Actions • Perform division 2.22.3 Prototype unsigned long UDivLongLong(unsigned long idata * Dividend, unsigned long idata * Divisor) 2.22.4...
  • Page 90: Execution Information

    SP37 Tire Pressure Monitoring Sensor ROM Library Functions 2.22.7 Execution Information Table 100 UDivLongLong: Execution Time and Charge Consumption Parameter Symbol Values Unit Note / Test Condition Min. Typ. Max. Execution Time – µs DIVIC = 00 Charge Consumption –...
  • Page 91: Udivintint() (16Bit : 16Bit)

    SP37 Tire Pressure Monitoring Sensor ROM Library Functions 2.23 UDivIntInt() (16Bit : 16Bit) 2.23.1 Description This function divides the unsigned int value (16 bit) Dividend by the unsigned int value (16 bit) Divisor. 2.23.2 Actions • Perform division 2.23.3 Prototype unsigned int UDivIntInt(unsigned int Dividend, unsigned int Divisor) 2.23.4...
  • Page 92: Execution Information

    SP37 Tire Pressure Monitoring Sensor ROM Library Functions 2.23.7 Execution Information Table 104 UDivIntInt: Execution Time and Charge Consumption Parameter Symbol Values Unit Note / Test Condition Min. Typ. Max. Execution Time – µs DIVIC = 00 Charge Consumption –...
  • Page 93: Crc8_Calc()

    SP37 Tire Pressure Monitoring Sensor ROM Library Functions 2.24 CRC8_Calc() 2.24.1 Description This function calculates the CRC-8 checksum for a memory area in RAM using a fixed polynomial (x +x+1). The CRC-8 calculation starts with a defined preload value. 2.24.2 Actions •...
  • Page 94: Resource Usage

    SP37 Tire Pressure Monitoring Sensor ROM Library Functions 2.24.6 Resource Usage Table 107 CRC8_Calc: Resources Type Used or Modified Registers R0, R1, R2, R3, R4, R5, R7 ACC, PSW Stack 0 Bytes 1) Two additional bytes, not included here, are needed to call the library function 2.24.7...
  • Page 95: Crc_Baicheva_Calc()

    SP37 Tire Pressure Monitoring Sensor ROM Library Functions 2.25 CRC_Baicheva_Calc() 2.25.1 Description This function calculates a 8-bit CRC checksum for a memory area in RAM using a fixed polynomial +x+1). It supports the standardized TPMS data protocol from the German Association of the Automotive Industry (VDA) and is optimal for data word length of 119 bits and below.
  • Page 96: Execution Information

    SP37 Tire Pressure Monitoring Sensor ROM Library Functions Table 111 CRC8_Baicheva_Calc: Resources (cont’d) Type Used or Modified ACC, PSW Stack 0 Bytes 1) Two additional bytes, not included here, are needed to call the library function 2.25.7 Execution Information Table 112...
  • Page 97: Read_Id()

    SP37 Tire Pressure Monitoring Sensor ROM Library Functions 2.26 Read_ID() 2.26.1 Description This function returns the unique serial number of the device and a product description code. 2.26.2 Actions • Read 4-byte ID • Read 1 byte product code 2.26.3...
  • Page 98: Resource Usage

    SP37 Tire Pressure Monitoring Sensor ROM Library Functions 2.26.6 Resource Usage Table 115 Read_ID: Resources Type Used or Modified Registers R0, R3, R4, R5, R6, R7 ACC, DPH, DPL, PSW Stack 2 Bytes 1) Two additional bytes, not included here, are needed to call the library function 2.26.7...
  • Page 99: Manurevnb()

    SP37 Tire Pressure Monitoring Sensor ROM Library Functions 2.27 ManuRevNb() 2.27.1 Description This function returns the Infineon SP37 revision number 2.27.2 Actions • Read 2-byte Revision Number from ROM and return it 2.27.3 Prototype signed int ManuRevNb (void) 2.27.4 Inputs...
  • Page 100: Execution Information

    SP37 Tire Pressure Monitoring Sensor ROM Library Functions 2.27.7 Execution Information Table 120 ManuRevNb: Execution Time and Charge Consumption Parameter Symbol Values Unit Note / Test Condition Min. Typ. Max. Execution Time – µs DIVIC = 00 Charge Consumption –...
  • Page 101: Fw_Revision_Nb()

    Library code revision will be returned xxxx = SP37 FLASH Library version R6(MSB), unsigned int ROM_Rev Pointer to the RAM location where the ROM R7(LSB) idata* code revision will be returned 0A32 = SP37 ROM Library Version A5 ROM Library Function Guide Revision 1.0, 2011-12-15...
  • Page 102: Resource Usage

    SP37 Tire Pressure Monitoring Sensor ROM Library Functions 2.28.6 Resource Usage Table 123 FW_Revision_Nb: Resources Type Used or Modified Registers R0, R5, R7 Stack 2 Bytes 1) Two additional bytes, not included here, are needed to call the library function 2.28.7...
  • Page 103: Erase_Userconfigsector()

    SP37 Tire Pressure Monitoring Sensor ROM Library Functions 2.29 Erase_UserConfigSector() 2.29.1 Description This function erases the FLASH user configuration sector located at FLASH address 5780 -- 57FF if the Lockbyte 3 is not set. If Lockbyte 3 is set this function will return -1 without any action.
  • Page 104: Execution Information

    SP37 Tire Pressure Monitoring Sensor ROM Library Functions 2.29.7 Execution Information Table 128 Erase_UserConfigSector: Execution Time and Charge Consumption Parameter Symbol Values Unit Note / Test Condition Min. Typ. Max. Execution Time – 103000 111300 µs DIVIC = 00 Charge Consumption –...
  • Page 105: Writeflashuserconfigsectorline()

    SP37 Tire Pressure Monitoring Sensor ROM Library Functions 2.30 WriteFlashUserConfigSectorLine() 2.30.1 Description This function writes one line in the FLASH user configuration sector located at FLASH address 5780 -- 57FF the Lockbyte 3 is not set. If Lockbyte 3 is set this function will return -1 without any action.
  • Page 106: Outputs

    SP37 Tire Pressure Monitoring Sensor ROM Library Functions 2.30.5 Outputs Table 130 WriteFlashUserConfigurationSectorLine: Output values Register/ Address Type Name Description signed char Statusbyte 0: success -1: failed 2.30.6 Resource Usage Table 131 WriteFlashUserConfigurationSectorLine: Resources Type Used or Modified Registers R0, R1, R2, R3, R4, R5, R6, R7...
  • Page 107: Writeflashcodesectorline()

    . If the SP37 is in RUN mode and Lockbyte 2 is not set the write is performed, otherwise this function will return -1. The line contents are verified after the entire line has been written. In the event that the write verification fails, this function will return -2.
  • Page 108: Outputs

    SP37 Tire Pressure Monitoring Sensor ROM Library Functions 2.31.5 Outputs Table 134 WriteFlashCodeSectorLine: Output values Register/ Address Type Name Description signed char Statusbyte 0: success -1: Lockbyte 2 is set (Code Sector Lock), without writing anything; or the function was called while the device is in debug Mode.
  • Page 109: Flashsetlock()

    SP37 Tire Pressure Monitoring Sensor ROM Library Functions 2.32 FlashSetLock() 2.32.1 Description This function sets the Lockbyte 3 which protects the User Configuration sector. This function returns -1 and has no effect if executed in DEBUG mode. Attention: This function shows only effect if the Lockbyte 2 that protects the Code Sector is set.
  • Page 110: Resource Usage

    SP37 Tire Pressure Monitoring Sensor ROM Library Functions 2.32.6 Resource Usage Table 139 FlashSetLock: Resources Type Used or Modified Registers R0, R1, R2, R3, R4, R5, R6, R7 ACC, B, CFG1, CRC0, CRC1, CRCC, CRCD, DIVIC, DPH, DPL, TCON, TH1, TL1...
  • Page 111: Ecc_Check()

    SP37 Tire Pressure Monitoring Sensor ROM Library Functions 2.33 ECC_Check() 2.33.1 Description This function evaluates the Error Code Correction (ECC) result bit. This bit shows if an error in the read/executed FLASH has been detected since the last call of this function.
  • Page 112: Execution Information

    SP37 Tire Pressure Monitoring Sensor ROM Library Functions 2.33.7 Execution Information Table 144 ECC_Check: Execution Time and Charge Consumption Parameter Symbol Values Unit Note / Test Condition Min. Typ. Max. Execution Time – µs DIVIC = 00 Charge Consumption –...
  • Page 113: Crc16_Check()

    SP37 Tire Pressure Monitoring Sensor ROM Library Functions 2.34 CRC16_Check() 2.34.1 Description This function computes a 16-bit CRC of a code block from a start address with a defined length from FLASH, which includes a pre-computed 16-bit CRC, which is stored in the last 2 Bytes of the memory block ((StartAddr + Length - 2) is CRC High) and ((StartAddr + Length - 1) is CRC Low).
  • Page 114: Resource Usage

    SP37 Tire Pressure Monitoring Sensor ROM Library Functions 2.34.6 Resource Usage Table 147 CRC16_Check: Resources Type Used or Modified Registers R4, R5, R6, R7 ACC, B, CRC0, CRC1, CRCD, DPH, DPL, PSW Stack 0 Bytes 1) Two additional bytes, not included here, are needed to call the library function 2.34.7...
  • Page 115: Hirc_Clock_Check()

    SP37 Tire Pressure Monitoring Sensor ROM Library Functions 2.35 HIRC_Clock_Check() 2.35.1 Description This function measures the frequency of the 12 MHz RC Oscillator, using the crystal oscillator as a measurement standard. It evaluates whether the 12 MHz RC Oscillator is working in the specified range (see [1]).
  • Page 116: Resource Usage

    SP37 Tire Pressure Monitoring Sensor ROM Library Functions 2.35.6 Resource Usage Table 151 HIRC_Clock_Check: Resources Type Used or Modified Registers R0, R1, R2, R3, R4, R5, R6, R7 ACC, B, CFG0, DIVIC, DPH, DPL, PSW, TCON, TH0, TH1, TL0, TL1, TMOD...
  • Page 117: Getcompvalue()

    SP37 Tire Pressure Monitoring Sensor ROM Library Functions 2.36 GetCompValue() 2.36.1 Description This function retrieves an 8 bit value from a 2 dimensional lookup table depending on input values Value1 and Value2. The lookup table is a M by N matrix and can be of any size from 2 x 2 up to 15 x 15 holding 225 different values in its maximum configuration.
  • Page 118: Actions

    SP37 Tire Pressure Monitoring Sensor ROM Library Functions 2.36.2 Actions • Compare Value1 with defined thresholds from threshold type 1 • Compare Value2 with defined thresholds from threshold type 2 • Return compensated value 2.36.3 Prototype unsigned char GetCompValue(unsigned char code * TablePointer, unsigned char Value1, unsigned char Value2) 2.36.4...
  • Page 119: Figure 15 Lookup Table Organization

    SP37 Tire Pressure Monitoring Sensor ROM Library Functions Number ([N -1] = 1=one, 2=two,…, 14=fourteen ) of threshold upper half-byte points for Value1 (e.g. temperature ) TablePointer + 0 Number ([M -1] = 1=one , 2=two,…, 14=fourteen ) of threshold...
  • Page 120: Outputs

    SP37 Tire Pressure Monitoring Sensor ROM Library Functions 2.36.5 Outputs Table 154 GetCompValue: Output values Register/ Address Type Name Description unsigned char Compensated Value Returns the compensated value from the lookup table defined by selected column and row 2.36.6 Resource Usage...
  • Page 121: Wait100Usmultiples()

    SP37 Tire Pressure Monitoring Sensor ROM Library Functions 2.37 Wait100usMultiples() 2.37.1 Description This function performs a delay of 100 µs multiples. It clears the CPU clock divider SFR DIVIC, initializes the timers according to the delay time, and uses IDLE state during the delay time. In case an unexpected resume event occurs, the IDLE state will be left and the function remain in RUN state until the delay is elapsed.
  • Page 122: Resource Usage

    SP37 Tire Pressure Monitoring Sensor ROM Library Functions 2.37.6 Resource Usage Table 159 Wait100usMultiples: Resources Type Used or Modified Registers R6, R7 ACC, B, CFG0, CFG2, DIVIC, DPTR, PSW, TCON, TH0, TL0, TH1, TL1, TMOD Stack 0 Bytes 1) Two additional bytes, not included here, are needed to call the library function 2.37.7...
  • Page 123: Send_Rf_Telegram()

    2.38.1 Description In principle, transmission of an RF telegram using the SP37 can be divided into two distinct portions: RF Peripheral Initialization, and RF Data Transmission. In the case of the Send_RF_Telegram() function, the application program must perform the Initialization, and the Send_RF_Telegram() function addresses Data Transmission. To permit arbitrary RF telegram formats, an interpreted table-driven approach is employed.
  • Page 124: Start Of Table Indicator

    SP37 Tire Pressure Monitoring Sensor ROM Library Functions 2.38.1.3 Start of Table indicator The Start of Table is always the first byte of the PDT. The Start of Table is detailed in Figure START of TABLE delayOSC n.u. Figure 17 Datagram format Bits 4..0 - delayOSC - define the delay for the StartXtalOsc() used in the RF_Transmission routine.
  • Page 125: Delay Pattern Descriptor

    The random delay is obtained using the SP37 Pseudo Random Number (PRN) generator peripheral. In order to achieve some "randomness" between individual devices, it is recommended to seed the PRN generator with a value unique to each device.
  • Page 126: Flow Chart Of Send_Rf_Telegram()

    SP37 Tire Pressure Monitoring Sensor ROM Library Functions END of TABLE Figure 20 End of Table The exact value of the EOT byte indicates how many times the PDT should be processed. • process Pattern Descriptor once • process Pattern Descriptor twice •...
  • Page 127: Figure 21 Flow Chart Of The Send_Rf_Telegram() Function

    SP37 Tire Pressure Monitoring Sensor ROM Library Functions RF_Telegram_Function Declaration of the table: Descriptor Array Declaration of the table: Descriptor Array Declaration of the size of the array RF Transmitter Configuration (434MHz) Start of the table: Delay of OSC, Battery...
  • Page 128: Actions

    SP37 Tire Pressure Monitoring Sensor ROM Library Functions 2.38.3 Actions • Set the Timer mode and reload values to achieve the appropriate baudrate • Process the Pattern Descriptor Table (one or more repetitions, as determined by EOT byte) and transmit the data •...
  • Page 129: Outputs

    SP37 Tire Pressure Monitoring Sensor ROM Library Functions 2.38.6 Outputs Table 162 Send_RF_Telegram: Output values Register/ Address Type Name Description signed char StatusByte: 0: Success -1: Error in data vector descriptor 2.38.7 Resource Usage Table 163 Send_RF_Telegram: Resources Type Used or Modified...
  • Page 130: Table 165 Send_Rf_Telegram: Charge Consumption

    SP37 Tire Pressure Monitoring Sensor ROM Library Functions Table 165 Send_RF_Telegram: Charge Consumption Parameter Symbol Values Unit Note / Test Condition Min. Typ. Max. Function overhead for – 3,23 5,498 µC 1 transmission burst 1 chip transmitted – 0,278 0,512 µC...
  • Page 131: Code Example

    SP37 Tire Pressure Monitoring Sensor ROM Library Functions 2.38.9 Code Example // Library function prototypes #include "SP37_ROMLibrary.h" void main() // Return value of send RF telegram is stored in sendRF_StatusByte signed char sendRF_StatusByte; // Array for pattern descriptor table unsigned char idata descriptorPtr[10];...
  • Page 132: Internal_Sfr_Refresh()

    SP37 Tire Pressure Monitoring Sensor ROM Library Functions 2.39 Internal_SFR_Refresh() 2.39.1 Description This function refreshes on demand all internal registers which are refreshed by reset only. 2.39.2 Actions • Loads default values into the internal SFRs which are refreshed at reset only 2.39.3...
  • Page 133: Execution Information

    SP37 Tire Pressure Monitoring Sensor ROM Library Functions 2.39.7 Execution Information Table 169 Internal_SFR_Refresh: Execution Time and Charge Consumption Parameter Symbol Values Unit Note / Test Condition Min. Typ. Max. Execution Time – 29,2 µs DIVIC = 00 Charge Consumption –...
  • Page 134: Reference Documents

    SP37 Tire Pressure Monitoring Sensor Reference Documents Reference Documents This section contains documents used for cross- reference throughout this document. SP37 Datasheet ROM Library Function Guide Revision 1.0, 2011-12-15...
  • Page 135 . i n f i n e o n . c o m Published by Infineon Technologies AG...

Table of Contents