FXTH87xx22FWUG FXTH87xx22 Embedded Firmware User Guide Rev. 2.3 1 May 2018 User guide 1 Introduction This document describes the embedded firmware found in all derivatives of the FXTH87xx22 device. The intended audience for this document is firmware architects, developers, coders and testers working with the FXTH87xx22 device. Firmware for the FXTH87xx22 is derived directly from MPXY86xx s Firmware Rel04. Known bugs are carried over, and noted in this document when appropriate. This document is divided into three sections: This 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 2.1.1 TPMS INTERRUPT FLAG The TPM1Ch0 and TPM1Ch1 interrupt vectors are exchanged compared to what is defined in the product specification. This implies that upon interrupt of TPM1Ch0 the user interrupt vector Vtpm1ch1 located at address DFF2:DFF3 will be accessed. And upon interrupt of TPM1Ch1 the user interrupt vector Vtpm1ch0 located at address DFF4:DFF5 will be accessed. This global variable keeps track of interrupts that have occurred. FXTH87xx22 Embedded Firmware uses it to keep track of expected interrupts. It can also be utilized by the user for its own purposes. If an LFR interrupt occurs while a firmware function is under execution, the LFR User Interrupt Vector will not be accessed, and the bit 2 (Table 1) will be the only indication available. Users should check this bit, either prior to entering the firmware function or after the firmware function, to assure LF interrupts are not missed. Also, a number of firmware functions utilize the Stop1 or Stop4 modes, which disable the hardware watchdog block. In order to provide a back-up recovery, users should utilize either the RTI or PWU which can be programmed for interrupt if a software or firmware routine has consumed too much time. The watchdog is automatically restarted when the program goes back in RUN mode. The TPMS INTERRUPT FLAG is not cleared automatically. Users must clear this variable after power-on-reset. Table 1 shows the TPMS INTERRUPT FLAG format. The trigger condition column describes what is necessary for that flag to be set.NXP Semiconductors FXTH87xx22FWUG FXTH87xx22 Embedded Firmware User Guide Table 1.TPMS INTERRUPT FLAG format and trigger conditions Flag Bit Trigger condition LVD Interrupt 7 LVD interrupt entered. PWU Interrupt 6 PWU interrupt entered. TOF Interrupt 5 TOF interrupt entered. LFR Error Interrupt 4 LFR interrupt entered and LFERF bit of the LFS register is set. ADC Interrupt 3 ADC interrupt entered. LFR Interrupt 2 LFR interrupt entered and LFERF bit of the LFS register is clear. RTI Interrupt 1 RTI interrupt entered. KBI Interrupt 0 KBI interrupt entered. TPMS INTERRUPT FLAG is 1 byte long and is located at address 8F. Users must account for this variable when developing for the FXTH87xx22. 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 and S . Due to INLO INHI process, temperature and voltage variations this signal may increase its range to S INMIN to S . In all cases the signal will be between the supply rails, so that the ADC INMAX 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 , D , and D values. The ADC digital value is taken by the firmware and INLO INHI INMAX compensated and scaled to give the required output code range. Digital input values below D and above D are immediately flagged as being out INMIN INMAX of range and generate error bits and the output is forced to the corresponding railed-high or railed-low values. Digital values below D (but above D ) or above D (but not D ) will most INLO INMIN INHI INMAX 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 and D will normally produce an output between 1 to INLO INHI 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. FXTH87xx22FWUG All information provided in this document is subject to legal disclaimers. NXP B.V. 2018. All rights reserved. User guide Rev. 2.3 1 May 2018 2 / 45