background image

Globals and formats

FXTH87xx11 and FXTH87xx12 Embedded Firmware User Guide, Rev. 2.1

Freescale Semiconductor, Inc.

3

2.2

Measurement error format

2.2.1

Definition of Signal Ranges

Each measured parameter (pressure, voltage, temperature, and acceleration) results from an ADC 
conversion of an analog signal. This ADC result may then be passed by the firmware to the application 
software as either the raw ADC result or further compensated and scaled for an output between one and 
the maximum digital value minus one. The minimum digital value of zero and the maximum digital value 
are reserved as error codes.

The signal ranges and their significant data points are shown in 

Figure 1

. In this definition the signal source 

would normally output a signal between S

INLO

 and S

INHI

. Due to process, temperature and voltage 

variations this signal may increase its range to S

INMIN

 to S

INMAX

. In all cases the signal will be between 

the supply rails, so that the ADC will convert it to a range of digital numbers between 0 and 1023 (or 0 and 
4095 in the case of temperature readings). These digital numbers will have corresponding D

INMIN

, D

INLO

D

INHI

, D

INMAX

 values. The ADC digital value is taken by the firmware and compensated and scaled to 

give the required output code range.

Digital input values below D

INMIN

 and above D

INMAX

 are immediately flagged as being out of range and 

generate error bits and the output is forced to the corresponding railed-high or railed-low values. 

Digital values below D

INLO

 (but above D

INMIN

) or above D

INHI

 (but not D

INMAX

) will most likely cause 

an output that would be less than 1 or greater than 510, respectively. These cases are considered underflow 
or overflow, respectively. Underflow results will be forced to a value of 1. Overflow results will be forced 
to a value of 510.

Digital values between D

INLO

 and D

INHI 

will normally produce an output between 1 to 510 (for a 9-bit 

result). In some isolated cases due to compensation calculations and rounding the result may be less than 
1 or greater than 510, in which case the underflow and overflow rule mentioned above is used.

Содержание FXTH87 11 Series

Страница 1: ...introduction a section describing global variables and standard formats used throughout the functions and a third section describing each function 2 Globals and formats 2 1 Global variables Table 1 summarizes all global variables used by Freescale firmware and their locations Developers must account for these variables when creating new user firmware 1 Introduction 1 2 Globals and formats 1 2 1 Gl...

Страница 2: ...and is located at address 8E Users must account for this variable when developing for the FXTH87xx11 and FXTH87xx12 and can ignore the contents of said variable as long as it is not overwritten It is used internally by the TPMS_READ_ACCEL family of functions and its purpose it to communicate the next measurement s sampling rate when the u8Avg argument is set to a value greater than 2 Table 1 Globa...

Страница 3: ...he ADC will convert it to a range of digital numbers between 0 and 1023 or 0 and 4095 in the case of temperature readings These digital numbers will have corresponding DINMIN DINLO DINHI DINMAX values The ADC digital value is taken by the firmware and compensated and scaled to give the required output code range Digital input values below DINMIN and above DINMAX are immediately flagged as being ou...

Страница 4: ...e Definitions SENSOR ANALOG ADC RAW DIGITAL CALCULATED DIGITAL 9 BIT EXAMPLE 10 BIT CONVERSION VOLTAGE SIGNAL SOURCE ADC FIRMWARE ROUTINE 511 510 0 1 256 0 1023 512 VDD 2 VDD VDD SINMAX SINHI SINMIN SINLO DINMAX DINHI DINLO DINMIN NORMAL CASE UNDERFLOW LOWER ERROR CASE FORCE OUTPUT TO ZERO CASE OVERFLOW CASE FORCE OUTPUT TO 511 UPPER ERROR CASE ...

Страница 5: ...0 Acceleration error not detected in last firmware subroutine call 1 Acceleration error detected in last firmware subroutine call BIT3 AXERR X Axis Accelerometer Measurement Error if applicable This status bit indicates an error was detected by a bonding wire failure to the g cell or a ADC reading of the X axis accelerometer that is outside of the normally accepted range 0 Acceleration error not d...

Страница 6: ...For example calling the TPMS_READ_VOLTAGE routine will only modify the voltage element of the array The rest will remain unchanged Compensation routines do not modify any elements in the UUMA 2 4 Simulated SPI interface Signal Format The FXTH87xx11 and FXTH87xx12 include three routines TPMS_MSG_INIT TPMS_MSG_READ and TPMS_MSG_WRITE that when used together allow the user to perform serial communica...

Страница 7: ...ormation on the use of the Simulated SPI interface routines refer to Section 3 2 30 Section 3 2 31 and Section 3 2 32 2 5 Rapid Decompression Event Array T_RDE Format The FXTH87xx11 and FXTH87xx12 includes a routine called TPMS_RDE_ADJUST_PRESSURE that requires a pointer to an array of elements using a custom format called T_RDE Said format is easily manageable using a typedef instruction as shown...

Страница 8: ...e LFR module in the best known configuration for Manchester encoded reception LFR registers will be configured differently depending on the user selected sensitivity Table 5 and Table 6 describe these settings Table 5 Customer configurable TPMS7 LF Registers with SENS 1 Page 0 Bit name Register name 7 6 5 4 3 2 1 0 LFCTL1 LFEN SRES CARMOD PAGE IDSEL SENS LFCTL2 LFSTM LFONTM LFCTL3 LFDO TOGMOD SYNC...

Страница 9: ...C LFCDTM LFCTL4 LFDRIE LFERIE LFCDIE LFIDIE DECEN VALEN TIMOUT LFS LFDRF LFERF LFCDF LFIDF LFOVF LFEOMF LPSM LFIAK LFDATA RXDATA LFIDL ID7 ID6 ID5 ID4 ID3 ID2 ID1 ID0 LFIDH ID15 ID14 ID13 ID12 ID11 ID10 ID9 ID8 Page 1 Bit name Register name 7 6 5 4 3 2 1 0 LFCTL1 LFEN SRES CARMOD PAGE IDSEL SENS 2 LFCTRLE 0 0 0 LFCTRLD 1 0 DEQS 1 1 1 0 0 LFCTRLC 0 0 0 1 AZEN LOWQ DEQEN LFCTRLB 1 1 LFFAF LFCAF LFPO...

Страница 10: ...e Address Return type Function E000 void TPMS_RESET E003 UINT8 TPMS_READ_VOLTAGE E006 UINT8 TPMS_COMP_VOLTAGE E009 UINT8 TPMS_READ_TEMPERATURE E00C UINT8 TPMS_COMP_TEMPERATURE E00F UINT8 TPMS_READ_PRESSURE E012 UINT8 TPMS_COMP_PRESSURE E015 UINT8 TPMS_READ_ACCELERATION_X E018 UINT8 TPMS_READ_DYNAMIC_ACCEL_X E01B UINT8 TPMS_COMP_ACCELERATION_X E01E UINT8 TPMS_READ_ACCELERATION_Z E021 UINT8 TPMS_REA...

Страница 11: ... the user in DFFE DFFF No further initialization is performed Stack size 3 bytes Power Management This function executes entirely in RUN mode Interrupt Management This function does not await interrupts It is not affected by interrupts either Resources Stack E057 void TPMS_RF_DYNAMIC_POWER E05A void TPMS_MSG_INIT E05D UINT8 TPMS_MSG_READ E060 UINT8 TPMS_MSG_WRITE E063 UINT8 TPMS_CHECKSUM_XOR E066 ...

Страница 12: ...asurements below 2 1 V are not guaranteed for accuracy Stack size 22 bytes Approx Duration 102 usec Power Management This function requires the core to be configured for STOP4 mode and running at full bus speed Interrupt Management This function utilizes the ADC interrupt to wake up from STOP mode Resources ADC bandgap Input Parameters UINT16 u16UUMA Pointer to Universal Uncompensated Measurement ...

Страница 13: ...6UUMA Pointer to Universal Uncompensated Measurement Array as described in Section 2 3 Uncompensated voltage will be utilized from this array Returns UINT8 u8Status Valid error flags outputs are described in Table 9 3 2 4 UINT8 TPMS_READ_TEMPERATURE UINT16 u16UUMA Description Performs a 12 bit uncompensated temperature measurement and places it in the UUMA While waiting for the ADC to converge thi...

Страница 14: ...ibed in Section 2 3 Only the 12 bit uncompensated temperature result will be updated Returns UINT8 u8Status Valid error flags outputs are described in Table 10 WARNING The Bandgap bit BIT0 in the SPMSC1 register must be set prior to calling this function for results to be valid Table 10 Valid output conditions for TPMS_READ_TEMPERATURE u8Status Value Measurement Value Condition 40 0FFF Uncompensat...

Страница 15: ...turns UINT8 u8Status Valid error flags outputs are described in Table 11 3 2 6 UINT8 TPMS_READ_PRESSURE UINT16 u16UUMA UINT8 u8Avg Description Performs an 10 bit uncompensated pressure measurement and places it in the UUMA While waiting for the ADC to converge this function goes into STOP4 If the ADC for an unexpected reason fails to converge this function has a built in time out After five contin...

Страница 16: ... to this function result in a fault the pressure reading will be forced to 0 and the appropriate pressure temperature and or voltage flags will be set in the status flag If Pout 100 kPa the over underflow status flag will be set and u16CompPressure will be forced to 001 If Pout 900 kPa u16CompPressure will be 1FE and the over underflow status flag will be set If the passed uncompensated voltage me...

Страница 17: ...ell If the ADC value is over or under the normal operating condition the acceleration error status flag will be set The expected acceleration result will be forced to either 0 or 1023 rail high or rail low If the ADC times out with no result the ADC error status flag will be set Stack size 31 bytes Approx Duration 2901 usec 500 Hz filter 1 reading 4255 usec 250 Hz filter 1 reading Power Management...

Страница 18: ...ffset Index Offset when result of function is 256 counts assuming stand trim Span does not change 0 70 g 1 60 g 2 50 g 3 40 g 4 30 g 5 20 g 6 10 g 7 0 g default 8 10 g 9 20 g 10 30 g 11 40 g 12 50 g 13 60 g 14 70 g 15 80 g Table 15 Valid output conditions for TPMS_READ_ACCELERATION_X u8Status Value Measurement Value Condition 08 03FF Uncompensated acceleration reading outside of valid range high 0...

Страница 19: ...g to Table 14 An updated offset value is returned at the end of the function In case the acceleration is too high or too low and function has run out of offset steps a value of 255 0 1 or 16 15 1 shall be returned UINT16 Pointer to the Universal Uncompensated Measurement Array Uncompensated acceleration will be updated accordingly Returns UINT8 u8Status Refer to TPMS_READ_ACCELERATION_X for more i...

Страница 20: ...e bit is set it will flag it accordingly as well If the ADC value is over or under the normal operating condition the acceleration error status flag will be set The expected acceleration result will be forced to either 0 or 1023 rail high or rail low If the ADC times out with no result the ADC error status flag will be set Stack size 31 bytes Approx Duration 2901 usec 500 Hz filter 1 reading 4255 ...

Страница 21: ...esult is too high or too low it will change the dynamic offset value and re execute TPMS_READ_ACCELERATION_Z until a the result is valid or b the result is railed high or low and there are no more offset steps Offset and uncompensated acceleration inside the UUMA are updated Stack size 48 bytes Approx Duration 29065 usec from one extreme to the center 2816 usec best case Power Management This func...

Страница 22: ...d valid uncompensated voltage temperature and acceleration readings are available in the UUMA for this routine to return a meaningful value If u16CompAccel rails low u16CompAccel will be forced to 1 and the over underflow status flag will be set If u16CompAccel rails high u16CompAccel will be forced to 1FE and the over underflow status flag will be set If the passed uncompensated voltage measureme...

Страница 23: ... Input Parameters UINT16 u16UUMA Pointer to Universal Uncompensated Measurement Array as described in Section 2 3 Only the 10 bit uncompensated acceleration result will be updated UINT8 u8Avg Number of measurements to average into one result The value can be set to 1 2 4 8 16 or 32 UINT8 u8FiltSelect If non zero 250 Hz filter enabled Otherwise 500 Hz filter selected UINT8 u8DynamicOffsetX Selects ...

Страница 24: ...alue Condition 08 03FF Uncompensated X acceleration reading outside of valid range high 08 0000 Uncompensated X acceleration reading outside of valid range low 28 03FF Uncompensated X acceleration reading outside of valid range high and LVWF set 28 0000 Uncompensated X acceleration reading outside of valid range low and LVWF set 10 03FF Uncompensated Z acceleration reading outside of valid range h...

Страница 25: ...ode Interrupt Management This function does not await interrupts It is not affected by interrupts either Resources UUMA Input Parameters UINT16 u16CompAccel Updated 9 bit compensated X axis acceleration followed by Z axis acceleration UINT16 u16UUMA Pointer to Universal Uncompensated Measurement Array as described in Section 2 3 Uncompensated voltage temperature and acceleration will be taken from...

Страница 26: ...rns UINT8 u8Status Valid error flags outputs are described in Table 21 3 2 18 UINT8 TPMS_READ_V1 UINT16 u16Result UINT8 u8Avg Description Performs an 10 bit uncompensated measurement at pin PTA1 Stack size 23 bytes Approx Duration 107 usec Power Management This function requires the core to be configured for STOP4 mode and running at full bus speed Interrupt Management This function utilizes the A...

Страница 27: ...ze 9 bytes Approx Duration 1747 usec Power Management This function executes entirely in RUN mode It requires the MCU to be configured for 4 MHz bus clock Interrupt Management This function does not await any interrupts It WILL be affected by interrupts Resources TPM SIMOPT2 RFM Input Parameters None Returns UINT8 u8WDIV WDIV compensated value WARNING This routine writes to SIMOPT2 Any configurati...

Страница 28: ... configuration involving this register must be performed before calling this routine 3 2 21 void TPMS_RF_ENABLE UINT8 u8Switch Description This function enables or disables the RF module in the FXTH87xx11 and FXTH87xx12 and transfers adequate PLL trim data to the module It should be called prior to any other RF operation Stack size 4 bytes Approx Duration 378 usec Power Management This function ex...

Страница 29: ...unction reads several consecutive bytes from the dedicated RFM buffer registers and copies them to a given address in RAM It assumes that BUFF0 is location 0 The data is transferred from the LSB bit of the RFM data registers to the LSB of the target memory address standard data bit order This function manages the RFM s buffer paged memory In case the required buffer address is out of bounds the ro...

Страница 30: ... not be affected by interrupts Resources RFM Input Parameters UINT8 u8Size Number of bytes to read UINT8 u8RamBuffer Target memory location UINT8 u8RFMBuffer Buffer register 0 to 31 to read Returns void 3 2 25 void TPMS_RF_WRITE_DATA UINT8 u8Size UINT8 u8RAMBuffer UINT8 u8RFMBuffer Description This function copies several consecutive bytes from RAM into the dedicated RFM Output Buffer It assumes t...

Страница 31: ...RUN mode Interrupt Management This function does not await any interrupts It will not be affected by interrupts Resources RFM Input Parameters UINT8 u8Size Number of bytes to write UINT8 u8RamBuffer Source memory location UINT8 8uRFMBuffer Starting buffer register 0 to 31 to write Returns void 3 2 27 void TPMS_RF_CONFIG_DATA UINT16 u16RFParam Description This function is included for backward comp...

Страница 32: ... interrupts It will not be affected by interrupts Resources RFM Input Parameters UINT8 u8BufferSize Number of bits in the buffer 1 for example to transmit one bit u8BufferSize should equal 0 Returns void Table 23 Description of Element 0 in the u16RFParam Array Bits Description 15 8 Prescaler value Described in Data Sheet as RFCR0 7 End Of Message If 1 EOM is set if 0 it s not set 6 Polarity Bit I...

Страница 33: ...s RFM Input Parameters UINT8 u8CompT Compensated temperature reading UINT8 u8CompV Compensated voltage reading UINT8 pu8PowerManagement This is a pointer to an array of five elements as described below Table 24 pu8PowerManagement format Index Value Description 0 Dynamic Compensation switch as described in Table 25 1 Offset step for power target when temperature is lower than 0 C Negative values ad...

Страница 34: ...be affected by interrupts Resources Pins PTA1 and PTA0 Input Parameters None Returns void 3 2 31 UINT8 TPMS_MSG_READ void Description This function is in charge to read any incoming message at a network level via an emulated serial interface on PTA1 and PTA0 As the master the FXTH87xx11 and FXTH87xx12 manages the clock on PTA1 On falling edge of the clock the module reads a new data bit on PTA0 pr...

Страница 35: ...s Pins PTA1 and PTA0 Input Parameters UINT8 u8SendByte Byte to be outputted through the emulated serial interface Returns UINT8 u8ReadByte Incoming byte from the emulated serial interface 3 2 33 UINT8 TPMS_CHECKSUM_XOR UINT8 u8Buffer UINT8 u8Size UINT8 u8Checksum Description Calculates a checksum for the given buffer based on XOR operations Stack size 5 bytes Approx Duration 80 usec for 8 bytes of...

Страница 36: ...tes UINT8 u8Remainder Initial remainder This argument is useful when the function is used recursively It must equal 0 if there is no previous data Returns UINT8 u8NewCRC New calculated CRC8 3 2 35 UINT16 TPMS_CRC16 UINT8 u8Buffer UINT16 u16MByteSize UINT16 u16Remainder Description Calculates a CRC16 on a portion of the designated memory area by using a look up table Polynomial used is 1021 standar...

Страница 37: ...16 u16Process The number from which to get the square root from Returns UINT16 Root of the number 10 3 2 37 void TPMS_READ_ID UINT8 u8Code Description Copies the device s UniqueID and firmware version stored in firmware flash to RAM Stack size 2 bytes Approx Duration 32 usec Power Management This function executes entirely in RUN mode Interrupt Management This function does not await any interrupt...

Страница 38: ...dingly for a Manchester reception that the module s interrupts are enabled and that the first byte has already been received and is waiting in the LFR received buffer While waiting for the next byte this function goes into STOP4 If the byte for an unexpected reason is not received this function has a built in time out After five continuous non LFR interrupts the function will assume a failed LFR r...

Страница 39: ... as follows On P cell wire bond error sets pressure error flag On g cell wire bond or Self Test error sets acceleration error flag On ADC error sets the ADCERR flag Stack size 36 bytes Approx Duration 14 926 usec all checks 106 usec ADC only 3 089 usec P cell only 3 087 usec X Axis l wire bond only 3 089 usec Z Axis 1 wire bond only 5622 usec g cell Self Test only Power Management This function re...

Страница 40: ...ec for 8 bytes of data Power Management This function executes entirely in RUN mode Interrupt Management This function does not await any interrupts It will be affected by interrupts Resources Global RAM locations 0090 00CA Input Parameters UINT16 u16Address Flash starting address UINT8 u8Buffer Source memory address UINT8 u8Size Number of data bytes to be written Returns void WARNING This routine...

Страница 41: ...ne Returns UINT16 u16Status 0 in case the calculated checksum and the stored one are the same or the calculated checksum in case they are different 3 2 43 UINT8 TPMS_FLASH_ERASE UINT16 u16Address Description This function erases 1 page 512 bytes of flash at a time Stack size 11 bytes Approx Duration 22744 usec Power Management This function executes entirely in RUN mode Interrupt Management This f...

Страница 42: ... description of this register UINT16 u16Key Due to the irreversible status after the execution of this routine this argument is used as a fail safe to guarantee desired execution of the function Only when u16Key is equal to the least significant word of the UniqueID will this function execute successfully Returns UINT8 u8Status according to table below WARNING This routine can only be executed onc...

Страница 43: ...6 TPMS_WAVG UINT8 u8PNew UINT16 u16POld UINT8 u8Avg Description This subroutine calculates a new weighed average value for a given new and old measurement readings by using the following equation Eqn 1 Stack size 12 bytes Approx Duration 38 usec average of 2 43 usec average of 4 48 usec average of 8 53 usec average of 16 56 usec average of 32 Power Management This function executes entirely in RUN...

Страница 44: ...returns CLEAR and doesn t affect any passed argument Stack size 4 bytes Approx Duration 9 usec Power Management Interrupt Management This function does not await any interrupts It should not be affected by interrupts Resources Core Input Parameters UINT16 pu16UUMA Pointer to Universal Uncompensated Measurement Array as described in Section 2 3 No values are affected T_RDE ptRDEValues Pointer to an...

Страница 45: ...luding without limitation consequential or incidental damages Typical parameters that may be provided in Freescale data sheets and or specifications can and do vary in different applications and actual performance may vary over time All operating parameters including typicals must be validated for each customer application by customer s technical experts Freescale does not convey any license under...

Отзывы: