FXTH870xD Sensor Data Sheet
FXTH870xD Sensor Data Sheet
24 PTB0
— 64-byte, low-power, parameter registers
23 N/C
22 N/C
21 N/C
20 N/C
19 N/C
on top lid
RF 11
VREG 12
9
8
VDD 7
VSSA
This document contains information on a new product. Specifications and information herein
are subject to change without notice.
© 2014-2015 Freescale Semiconductor, Inc. All rights reserved.
• Internal oscillators
— MCU bus clock of 0.5, 1, 2 and 4 MHz (1, 2, 4 and 8 MHz HFO)
— Low frequency, low power time clock (LFO) with 1 ms period
— Medium frequency, controller clock (MFO) of 8 sec period
• Low-voltage detection
• Normal temperature restart in hardware (over- or under-temperature detected by software)
ORDERING INFORMATION
Part number Accelerometer axis Package Range Code1
FXTH870502DT1 Z 2264 (7 x 7, 1-hole lid) 100-450 kPa $08
FXTH870511DT1 XZ 2264 (7 x 7, 1-hole lid) 100-450 kPa $0C
FXTH870902DT1 Z 2264 (7 x 7, 1-hole lid) 100-900 kPa $18
FXTH870911DT1 XZ 2264 (7 x 7, 1-hole lid) 100-900 kPa $1C
FXTH870912DT1 XZ Ext. Range 2264 (7 x 7, 1-hole lid) 100-900 kPa $1E
Related Documentation
The FXTH870xD device features and operations are described in a variety of reference manuals, user guides, and application
notes. To find the most-current versions of these documents:
1. Go to the Freescale homepage at:
http://www.freescale.com/
2. In the Keyword search box at the top of the page, enter the device number FXTH870xD.
FXTH870xD
Sensors
Freescale Semiconductor, Inc. 2
Contents
1 General Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.1 Overall Block Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.2 Multi-Chip Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.3 System Clock Distribution. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.4 Reference Documents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
2 Pins and Connections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
2.1 Package Pinout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
2.2 Recommended Application. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
2.3 Signal Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
3 Modes of Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
3.1 Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
3.2 RUN Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
3.3 WAIT Mode. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
3.4 ACTIVE BACKGROUND Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
3.5 STOP Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
4 Memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
4.1 MCU Memory Map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
4.2 Reset and Interrupt Vectors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
4.3 MCU Register Addresses and Bit Assignments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
4.4 High Address Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
4.5 MCU Parameter Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
4.6 MCU RAM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
4.7 FLASH . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
4.8 Security. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
4.9 FLASH Registers and Control Bits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
5 Reset, Interrupts and System Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
5.1 Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
5.2 MCU Reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
5.3 Computer Operating Properly (COP) Watchdog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
5.4 SIM Test Register (SIMTST) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
5.5 Interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
5.6 Low-Voltage Detect (LVD) System. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
5.7 System Clock Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
5.8 Keyboard Interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
5.9 Real Time Interrupt. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
5.10 Temperature Sensor and Restart System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
5.11 Reset, Interrupt and System Control Registers And Bits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
5.12 System STOP Exit Status Register (SIMSES) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
6 General Purpose I/O . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
6.1 Unused Pin Configuration. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
6.2 Pin Behavior in STOP Modes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
6.3 General Purpose I/O Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
6.4 Port A Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
6.5 Port B Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
7 Keyboard Interrupt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
7.1 Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
7.2 Modes of Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
7.3 Block Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
7.4 External Signal Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
7.5 Register Definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
7.6 Functional Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
8 Central Processing Unit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
8.1 Introduction. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
8.2 Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
8.3 Programmer’s Model and CPU Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
8.4 Addressing Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
8.5 Special Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
8.6 HCS08 Instruction Set Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
FXTH870xD
Sensors
Freescale Semiconductor, Inc. 1
9 Timer Pulse-Width Module. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
9.1 Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
9.2 TPM1 Configuration Information. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
9.3 External Signal Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
9.4 Register Definition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
9.5 Functional Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
9.6 TPM1 Interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
10 Other MCU Resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
10.1 Pressure Measurement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
10.2 Temperature Measurements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
10.3 Voltage Measurements. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
10.4 Optional Acceleration Measurements. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
10.5 Optional Battery Condition Check . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
10.6 Measurement Firmware . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
10.7 Thermal Shutdown . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
11 Periodic Wakeup Timer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
11.1 Block Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
11.2 Wakeup Divider Register - PWUDIV . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
11.3 PWU Control/Status Register 0 - PWUCS0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
11.4 PWU Control/Status Register 1 - PWUCS1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
11.5 PWU Wakeup Status Register - PWUS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
11.6 Functional Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
12 LF Receiver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
12.1 Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
12.2 Modes of Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
12.3 Power Management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
12.4 Input Amplifier. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
12.5 LFR Data Mode States . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
12.6 Carrier Detect . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
12.7 Auto-Zero Sequence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
12.8 Data Recovery . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
12.9 Data Clock Recovery and Synchronization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
12.10 Manchester Decode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
12.11 Duty-Cycle For Data Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
12.12 Input Signal Envelope. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
12.13 Telegram Verification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
12.14 Error Detection and Handling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
12.15 Continuous ON Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
12.16 Initialization Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
12.17 LFR Register Definition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100
13 RF Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
13.1 RF Data Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
13.2 RF Output Buffer Data Frame . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
13.3 Transmission Randomization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
13.4 RFM in STOP1 Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117
13.5 Data Encoding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117
13.6 RF Output Stage. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119
13.7 RF Interrupt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120
13.8 Datagram Transmission Times. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120
13.9 RFM Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121
13.10 RFM Control Register 1 - RFCR1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121
13.11 RFM Control Register 2 - RFCR2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122
13.12 RFM Control Register 3 - RFCR3. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125
13.13 RFM Control Register 4 - RFCR4. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126
13.14 RFM Control Register 5 - RFCR5. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126
13.15 RFM Control Register 6 - RFCR6. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127
13.16 RFM Control Register 7 - RFCR7. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127
13.17 PLL Control Registers A- PLLCR[1:0], RPAGE = 0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128
13.18 PLL Control Registers B- PLLCR[3:2], RPAGE = 0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129
13.19 EPR Register - EPR (RPAGE = 1) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130
13.20 RF DATA Registers - RFD[31:0] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131
13.21 VCO Calibration Machine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132
FXTH870xD
Sensors
2 Freescale Semiconductor, Inc.
14 Firmware . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133
14.1 Software Jump Table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133
14.2 Function Documentation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133
14.3 Memory Resource Usage. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138
15 Development Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139
15.1 Introduction. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139
15.2 Background Debug Controller (BDC) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139
15.3 Register Definition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144
16 Battery Charge Consumption Modeling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147
16.1 Standby Current . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147
16.2 Measurement Events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147
16.3 Transmission Events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147
16.4 Total Consumption . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147
17 Electrical Specifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148
17.1 Maximum Ratings. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148
17.2 Operating Range . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148
17.3 Electrical Characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149
17.4 Power Consumption (MCU) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150
17.5 Control Timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151
17.6 Voltage Measurement Characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152
17.7 Temperature Measurement Characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153
17.8 Pressure Measurement Characteristic (100 to 450 kPa ranges) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154
17.9 Pressure Measurement Characteristic (100 to 900 kPa Ranges) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155
17.10 Optional Acceleration Sensor Characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156
17.11 LFR Sensitivity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159
17.12 LFR Characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160
17.13 LFR Power Consumption . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160
17.14 RF Output Stage. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162
17.15 Power Consumption RF Transmissions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164
18 Mechanical Specifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 166
18.1 Maximum Ratings. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 166
18.2 Media Compatibility . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 166
18.3 Mounting Recommendations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 166
19 Package Outline . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 168
20 Revision History . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172
FXTH870xD
Sensors
Freescale Semiconductor, Inc. 3
1 General Information
1.1 Overall Block Diagram
The block diagram of the FXTH870xD is shown in Figure 1. This diagram covers all the main blocks mentioned above and their
main signal interactions. Power management controls and bus control signals are not shown in this block diagram for clarity.
FXTH870xD
Sensors
4 Freescale Semiconductor, Inc.
SENSOR MEASUREMENT
TRANSDUCERS SMI MCU
PWU
INTERFACE
PRESS TIMER
P SENSOR
(SMI)
XZ Z LFO LFO
1 ms RTI
ACCEL ACCEL TIMER
(OPTION) (OPTION)
BKGD/
VSENS PTA4
LVD
XZ Z
OSC
TEMP MCU CORE
ADC10 VDD VDD
RESTART S08
10-BIT
TEMP VTP AVDD AVDD
TEMP SENSOR 6-CHAN
HFO 64 Byte
1, 2, 4 or 8 PARAMETER
AVSS
MHz REGISTER
BANDGAP V0
REF
MFO MFO VSS
RAM
8 Sec
MEMORY
V1 512
VREG V2
8K USER
FLASH
AVDD MEMORY RESET
8K
VOLT FIRMWARE
VREG REG MEMORY
RFVDD
DX TPM1
BIT TIMER/PWM
XI XTAL RATE 2-CHAN
OSC GEN
RF LVD
XO
LF LFA
RECVR
(LFR)
256-BIT LFI LFB
RF CONTROLLER
DATA
VCO/PLL BUFFER
FRACTL
DIVIDER
DATA
ENCODE
RF RF PTA0
AMP
RVSS PTA1
KEY
GP PTA2
RFM BOARD
KBI WAKEUP I/O
PTA3
PTB0
PTB1
FXTH870xD
Sensors
Freescale Semiconductor, Inc. 5
SYSTEM MCU
LFO ADC10
OSC RTICLKS CONTROL CLOCK
1 mS LOGIC
PERIOD
PAR
ADC10 REG RAM FLASH
BUSCLKS[1:0] RTI
ADCCLK ADC10
HFO OSC fOSC fBUS 4 kbps
1, 2, 4, 2
and 8 MHz
LF
CLSA, CLKSB
COPCLKS (125 kHz)
CPU
WATCH LFRO
TPM1 LFR
DOG OSCILL
CH0 CH1
BDC fLFO (1 kHz)
PTA3 RANDOM
TCLKDIV (0 - 1 MHz)
PWU DX (500 kHz)
fLFO (1 kHz)
PTA2 RANDOM
8 (0 - 1 MHz)
LFOSEL
fMFO
fMFO
BIT MFO
RATE RF STATE OSC
GEN MACHINE 8 Sec
XTL
OSC
26 MHz fXCO
XI XO DATA
PLL VCO
BUFFER SENSOR MEASUREMENT
INTERFACE
RF
OUT 41.67 kHz 41.67 kHz 41.67 kHz
Sampling Sampling Sampling
TRANSDUCERS
FXTH870xD
Sensors
6 Freescale Semiconductor, Inc.
2 Pins and Connections
This section describes the pin layout and general function of each pin.
Top View
ID Feature
24 PTB0
23 N/C
22 N/C
21 N/C
20 N/C
19 N/C
on top lid +Y
PTB1 1 18 PTA3
Y-AXIS
ORIENTATION
PTA2 2 17 LFA
PTA1 3 16 LFB
-Y
PTA0 4 15 BKGD/PTA4
RESET 5 14 X0
-X +X
VSS 6 13 X1 X-AXIS
ORIENTATION
RFVSS 10
RF 11
VREG 12
9
8
VDD 7
VDDA
VSSA
N/C = No Connect: Do not connect PCB pads to signal traces, power/ground or multi-layer via.
Pressure +Z
Port
Z-AXIS
ORIENTATION
Side View
FXTH870xD
Sensors
Freescale Semiconductor, Inc. 7
2.3 Signal Properties
The following sections describe the general function of each pin.
g
L1 and matching network
optimized for specific PWB and
antenna layout. Recommend
R2 and R3, <10 k 0603 minimum size for L1 and
recommended for R2 R3
highest EMC resistance other matching network inductors
BKGD/PTA4 for maximum efficiency.
RESET
ANT
AVDD
3.0 V VDD L1
BATTERY RF MATCHING
0.1 µF 0.1 µF NETWORK
VSS
AVSS RVSS
FXTH870xxx
LFA
R1
LF VREG
COIL
C1
LFB XI C4*
PTA0
C1 and R1 optimized XO
XTAL
for coil used, but PTA1 470 nF
recommended
PTA2 C5
RC < 15.3 sec. C2 C3
PTA3 C2, C3, C4
optimized
PTB0
for crystal
PTB1
GENERAL
PURPOSE I/O
The device C4, although drawn here as a capacitor, may be any type of passive component(s) sufficient to block
or reduce unwanted external radiated signals from corrupting the crystal oscillator circuit: PCB traces for the LFA
/ LFB, AVDD / VDD, and VSS / AVSS pins and bypass capacitors should be minimized to reduce unwanted external
radiated signals from corrupting the power input circuits.
FXTH870xD
Sensors
8 Freescale Semiconductor, Inc.
Care should be taken to reduce measurement signal noise by separating the VDD, VSS, AVDD, AVSS and RVSS pins using a “star”
connection such that each metal trace does not share any load currents with other external devices as shown in Figure 6.
2.3.5 RF Pin
The RF pin is the RF energy data supplied by the FXTH870xD to an external antenna.
FXTH870xD
Sensors
Freescale Semiconductor, Inc. 9
2.3.9 PTA[3:2] Pins
The PTA[3:2] pins are general purpose I/O pin. These two pins can be configured as normal bidirectional I/O pin with
programmable pullup or pulldown devices and/or wakeup interrupt capability; or one or both can be connected to the two input
channels of the Timer Pulse Width (TPM1) module. The pulldown devices can only be activated if the wakeup interrupt capability
is enabled. User software must configure the general purpose I/O pins so that they do not result in “floating” inputs as described
in Section 6.1. PTA[3:2] map to Keyboard Interrupt function bits [3:2].
FXTH870xD
Sensors
10 Freescale Semiconductor, Inc.
3 Modes of Operation
The operating modes of the FXTH870xD are described in this section. Entry into each mode, exit from each mode, and
functionality while in each of the modes are described.
3.1 Features
• ACTIVE BACKGROUND DEBUG mode for code development
• STOP modes:
— System clocks stopped
— STOP1: Power down of most internal circuits, including RAM, for maximum power savings; voltage regulator in
standby
— STOP4: All internal circuits powered and full voltage regulation maintained for fastest recovery
FXTH870xD
Sensors
Freescale Semiconductor, Inc. 11
3.5 STOP Modes
One of two stop modes are entered upon execution of a STOP instruction when the STOPE bit in the system option register is
set. In all STOP modes, all internal clocks are halted except for the low frequency 1 kHz oscillator (LFO) which runs continuously
whenever power is applied to the VDD and VSS pins. If the STOPE bit is not set when the CPU executes a STOP instruction, the
MCU will not enter any of the STOP modes and an illegal opcode reset is forced. The STOP modes are selected by setting the
appropriate bits in SPMSC2. Table 1 summarizes the behavior of the MCU in each of the STOP1 and STOP4 modes. The STOP2
mode found in other Freescale S08 family members is not available; but the STOP3 mode is present like other members of the
Freescale S08 family members.
NOTE
If there are any pending interrupts that have yet to be serviced then the device will not go
into the STOP1 mode. Be certain that all interrupt flags have been cleared before entry to
STOP1 mode.
FXTH870xD
Sensors
12 Freescale Semiconductor, Inc.
Table 1. STOP Mode Behavior (continued)
Specific to the tire pressure monitoring application the parameter registers and the LFO with wakeup timer are powered up at all
times whenever voltage is applied to the supply pins. The LFR detector and MFO may be periodically powered up by the LFR
decoder.
FXTH870xD
Sensors
Freescale Semiconductor, Inc. 13
ADC10
The internal asynchronous ADC10 clock is always used as the conversion clock. The ADC10 can continue operation during
STOP4 mode. Conversions can be initiated while the MCU is the STOP4 mode. All ADC10 module registers contain their reset
values following exit from STOP1 mode.
LFR
When the MCU enters STOP mode the detectors in the LFR will remain powered up depending on the states of the bits selecting
the periodic sampling. Refer to Section 12 for more details.
Bandgap Reference
The bandgap reference is enabled whenever the sensor measurement interface requires sensor or voltage measurements.
TPM1
When the MCU enters STOP mode, the clock to the TPM1 module stops and the module halts operation. If the MCU is configured
to go into STOP1 mode, the TPM1 module will be reset upon wakeup from STOP and must be re-initialized.
Voltage Regulator
The voltage regulator enters a low-power standby state when the MCU enters any of the STOP modes except STOP4 (LVDSE
= 1 or ENBDM =1).
Temperature Sensor
The temperature sensor is powered up on command from the MCU.
Temperature Restart
When the MCU enters a STOP mode the temperature restart will remain powered up if the TRE bit is set. If the temperature restart
level is reached the MCU will restart from the reset vector.
FXTH870xD
Sensors
14 Freescale Semiconductor, Inc.
4 Memory
The overall memory map of the FXTH870xD resides on the MCU.
$0000
DIRECT PAGE REGISTERS
$004F
$0050
PARAMETER REGISTERS $008F
$0090
RAM 512 BYTES
$028F
$0290
UNIMPLEMENTED
5488 BYTES
$17FF
$1800
HIGH PAGE REGISTERS
$182B
$182C
41964 BYTES $BFFF
$C000
USER FLASH
8128 BYTES
$DFBF
$DFC0
USER VECTORS
$DFFF
$E000
FIRMWARE JUMP TABLE
$E03F
$E040
FIRMWARE FLASH
8128 BYTES
$FFFF
FXTH870xD
Sensors
Freescale Semiconductor, Inc. 15
Table 2. Vector Summary (continued)
FXTH870xD
Sensors
16 Freescale Semiconductor, Inc.
Table 3. MCU Direct Page Register Summary (continued)
FXTH870xD
Sensors
Freescale Semiconductor, Inc. 17
Table 5. LFR Register Summary - LPAGE = 1
FXTH870xD
Sensors
18 Freescale Semiconductor, Inc.
Table 7. RFM Register Summary - RPAGE = 1
FXTH870xD
Sensors
Freescale Semiconductor, Inc. 19
4.4 High Address Registers
High-page registers are used much less often, so they are located above $1800 in the memory map. This leaves more room in
the direct page for more frequently used registers and variables. The registers control system level features as given in Table 8.
FXTH870xD
Sensors
20 Freescale Semiconductor, Inc.
None of the RAM locations are used directly by the firmware provided by Freescale. The firmware routines utilize RAM only
through stack operations; and the user needs to be aware of stack depth required by each routine as described in the
CodeWarrior project files supplied by Freescale.
4.7 FLASH
The FLASH memory is intended primarily for program storage. The operating program can be loaded into the FLASH memory
after final assembly of the application product using the single-wire BACKGROUND DEBUG interface. Because no special
voltages are needed for FLASH erase and programming operations, in-application programming is also possible through other
software-controlled communication paths. For a more detailed discussion of in-circuit and in-application programming, refer to
the HCS08 Family Reference Manual, Volume I, Freescale document order number HCS08RMV1/D.
4.7.1 Features
Features of the FLASH memory include:
• User Program FLASH Size — 8192 bytes (16 pages of 512 bytes each)
• Single power supply program and erase
• Command interface for fast program and erase operation
• Up to 100,000 program/erase cycles at typical voltage and temperature
• Flexible block protection
• Security feature for FLASH and RAM
• Auto power-down for low-frequency read accesses
FXTH870xD
Sensors
Freescale Semiconductor, Inc. 21
2. Write the command code for the desired command to FCMD. The five valid commands are blank check (0x05), byte
program (0x20), burst program (0x25), page erase (0x40), and mass erase (0x41). The command code is latched into
the command buffer.
3. Write a 1 to the FCBEF bit in FSTAT to clear FCBEF and launch the command (including its address and data
information).
A partial command sequence can be aborted manually by writing a 0 to FCBEF any time after the write to the memory array and
before writing the 1 that clears FCBEF and launches the complete command. Aborting a command in this way sets the FACCERR
access error flag which must be cleared before starting a new command.
A strictly monitored procedure must be obeyed or the command will not be accepted. This minimizes the possibility of any
unintended changes to the FLASH memory contents. The command complete flag (FCCF) indicates when a command is
complete. The command sequence must be completed by clearing FCBEF to launch the command. Figure 9 is a flowchart for
executing all of the commands except for burst programming. The FCDIV register must be initialized before using any FLASH
commands. This must be done only once following a reset.
FXTH870xD
Sensors
22 Freescale Semiconductor, Inc.
WRITE TO FCDIV (1) Note 1: Required only once after reset.
0
FACCERR?
1
CLEAR ERROR
WRITE TO FLASH
TO BUFFER ADDRESS AND DATA
FPVIOL OR YES
FACCERR? ERROR EXIT
NO
0
FCCF?
1
DONE
FXTH870xD
Sensors
Freescale Semiconductor, Inc. 23
WRITE TO FCDIV (1) Note 1: Required only once after reset.
0
FACCERR?
1
CLEAR ERROR
0
FCBEF?
1
WRITE TO FLASH
TO BUFFER ADDRESS AND DATA
FPVIO OR YES
FACCERR? ERROR EXIT
NO
YES
NEW BURST COMMAND?
NO
0 FCCF?
1
DONE
FXTH870xD
Sensors
24 Freescale Semiconductor, Inc.
• Writing the byte program, burst program, or page erase command code (0x20, 0x25, or 0x40) with a BACKGROUND
DEBUG command while the MCU is secured (the BACKGROUND DEBUG controller can only do blank check and mass
erase commands when the MCU is secure.)
• Writing 0 to FCBEF to cancel a partial command.
FXTH870xD
Sensors
Freescale Semiconductor, Inc. 25
4.8 Security
The FXTH870xD includes circuitry to prevent unauthorized access to the contents of FLASH and RAM memory. When security
is engaged, FLASH and RAM are considered secure resources. Direct-page registers, high-page registers, and the
BACKGROUND DEBUG controller are considered unsecured resources. Programs executing within secure memory have
normal access to any MCU memory locations and resources. Attempts to access a secure memory location with a program
executing from an unsecured memory space or through the BACKGROUND DEBUG interface are blocked (writes are ignored
and reads return all 0s).
Security is engaged or disengaged based on the state of two nonvolatile register bits (SEC0[1:0]) in the FOPT register. During
reset, the contents of the nonvolatile location NVOPT are copied from FLASH into the working FOPT register in high-page
register space. A user engages security by programming the NVOPT location, which can be done at the same time the FLASH
memory is programmed. The 1:0 state disengages security and the other three combinations engage security. Notice the erased
state (1:1) makes the MCU secure. During development, whenever the FLASH is erased, it is good practice to immediately
program the SEC00 bit to 0 in NVOPT so SEC[1:0] = 1:0. This would allow the MCU to remain unsecured after a subsequent
reset.
The on-chip debug module cannot be enabled while the MCU is secure. The separate BACKGROUND DEBUG controller can
still be used for background memory access commands, but the MCU cannot enter ACTIVE BACKGROUND mode except by
holding BKGD/MS low at the rising edge of reset.
A user can choose to allow or disallow a security unlocking mechanism through an 8-byte backdoor security key. If the nonvolatile
KEYEN bit in NVOPT/FOPT is 0, the backdoor key is disabled and there is no way to disengage security without completely
erasing all FLASH locations. If KEYEN is 1, a secure user program can temporarily disengage security by:
1. Writing 1 to KEYACC in the FCNFG register. This makes the FLASH module interpret writes to the backdoor
comparison key locations (NVBACKKEY through NVBACKKEY+7) as values to be compared against the key rather
than as the first step in a FLASH program or erase command.
2. Writing the user-entered key values to the NVBACKKEY through NVBACKKEY+7 locations. These writes must be
done in order starting with the value for NVBACKKEY and ending with NVBACKKEY+7. STHX must not be used for
these writes because these writes cannot be done on adjacent bus cycles. User software normally would get the key
codes from outside the MCU system through a communication interface such as a serial I/O.
3. Writing 0 to KEYACC in the FCNFG register. If the 8-byte key that was just written matches the key stored in the
FLASH locations, SEC[1:0] are automatically changed to 1:0 and security will be disengaged until the next reset.
The security key can be written only from secure memory (either RAM or FLASH), so it cannot be entered through
BACKGROUND commands without the cooperation of a secure user program.
The backdoor comparison key (NVBACKKEY through NVBACKKEY+7) is located in FLASH memory locations in the nonvolatile
register space so users can program these locations exactly as they would program any other FLASH memory location. The
nonvolatile registers are in the same 512-byte block of FLASH as the reset and interrupt vectors, so block protecting that space
also block protects the backdoor comparison key. Block protects cannot be changed from user application programs, so if the
vector space is block protected, the backdoor security key mechanism cannot permanently change the block protect, security
settings, or the backdoor key.
Security can always be disengaged through the BACKGROUND DEBUG interface by taking these steps:
1. Disable any block protections by writing FPROT. FPROT can be written only with BACKGROUND DEBUG commands,
not from application software.
2. Mass erase FLASH if necessary.
3. Blank check FLASH. Provided FLASH is completely erased, security is disengaged until the next reset.
To avoid returning to secure mode after the next reset, program NVOPT so SEC[1:0] = 1:0.
NOTE
Enabling the security feature disables Freescale ability to perform failure analysis without
first completely erasing all flash memory contents. If the security feature is implemented,
customer shall be responsible for providing to Freescale unsecured parts for any failure
analysis to begin or supplying the entire contents of the device flash memory data as part of
the return process, to allow Freescale to erase and subsequently restore the device to its
original condition.
FXTH870xD
Sensors
26 Freescale Semiconductor, Inc.
4.9 FLASH Registers and Control Bits
The FLASH module has nine 8-bit registers in the high-page register space, three locations in the nonvolatile register space in
FLASH memory which are copied into three corresponding high-page control registers at reset. There is also an 8-byte
comparison key in FLASH memory. Refer to Table 8 and Table 9 for the absolute address assignments for all FLASH registers.
This section refers to registers and control bits only by their names. A Freescale Semiconductor-provided equate or header file
normally is used to translate these names into the appropriate absolute addresses.
$1820 7 6 5 4 3 2 1 0
R DIVLD
PRDIV8 DIV5 DIV4 DIV3 DIV2 DIV1 DIV0
W
Reset: 0 0 0 0 0 0 0 0
= Reserved
Field Description
Divisor Loaded Status Flag — When set, this read-only status flag indicates that the FCDIV register has been written since
7 reset. Reset clears this bit and the first write to this register causes this bit to become set regardless of the data written.
DIVLD 0 FCDIV has not been written since reset; erase and program operations disabled for FLASH
1 FCDIV has been written since reset; erase and program operations enabled for FLASH
Prescale (Divide) FLASH Clock by 8
6
0 Clock input to the FLASH clock divider is the bus rate clock
PRDIV8
1 Clock input to the FLASH clock divider is the bus rate clock divided by 8
Divisor for FLASH Clock Divider — The FLASH clock divider divides the bus rate clock (or the bus rate clock divided by 8 if
PRDIV8 = 1) by the value in the 6-bit DIV5:DIV0 field plus one. The resulting frequency of the internal FLASH clock must fall
within the range of 200 kHz to 150 kHz for proper FLASH operations. Program/Erase timing pulses are one cycle of this internal
5:0 FLASH clock which corresponds to a range of 5 s to 6.7 s. The automated programming logic uses an integer number of
these pulses to complete an erase or program operation.
DIV[5:0]
• if PRDIV8 = 0 — fFCLK = fBus ([DIV5:DIV0] + 1)
• if PRDIV8 = 1 — fFCLK = fBus (8 ([DIV5:DIV0] + 1))
Table 11 shows the appropriate values for PRDIV8 and DIV5:DIV0 for selected bus frequencies.
FXTH870xD
Sensors
Freescale Semiconductor, Inc. 27
4.9.2 FLASH Options Register (FOPT and NVOPT)
During reset, the contents of the nonvolatile location NVOPT are copied from FLASH into FOPT. Bits 5 through 2 are not used
and always read 0. This register may be read at any time, but writes have no meaning or effect. To change the value in this
register, erase and reprogram the NVOPT location in FLASH memory as usual and then issue a new MCU reset.
$1821 7 6 5 4 3 2 1 0
R KEYEN FNORED 0 0 0 0 SEC01 SEC00
W
Reset: This register is loaded from nonvolatile location NVOPT during reset.
= Reserved
Field Description
Backdoor Key Mechanism Enable — When this bit is 0, the backdoor key mechanism cannot be used to disengage security.
The backdoor key mechanism is accessible only from user (secured) firmware. BDM commands cannot be used to write key
comparison values that would unlock the backdoor key. For more detailed information about the backdoor key mechanism, refer
7
to Section 4.8.”
KEYEN
0 No backdoor key access allowed
1 If user firmware writes an 8-byte value that matches the nonvolatile backdoor key (NVBACKKEY through NVBACKKEY+7
in that order), security is temporarily disengaged until the next MCU reset
Vector Redirection Disable — When this bit is 1, then vector redirection is disabled.
6
0 Vector redirection enabled
FNORED
1 Vector redirection disabled
Security State Code — This 2-bit field determines the security state of the MCU as shown in Table 13. When the MCU is
1:0 secure, the contents of RAM and FLASH memory cannot be accessed by instructions from any unsecured source including the
SEC0[1:0] BACKGROUND DEBUG interface. For more detailed information about security, refer to Section 4.8. SEC01:SEC00 changes
to 1:0 after successful backdoor key entry or a successful blank check of FLASH.
SEC01:SEC00 Description
0:0 secure
0:1 secure
1:0 unsecured
1:1 secure
$1823 7 6 5 4 3 2 1 0
R 0 0 0 0 0 0 0
KEYACC
W
Reset: 0 0 0 0 0 0 0 0
= Reserved
FXTH870xD
Sensors
28 Freescale Semiconductor, Inc.
Table 14. FCNFG Register Field Descriptions
Field Description
Enable Writing of Access Key — This bit enables writing of the backdoor comparison key. For more detailed information about
5 the backdoor key mechanism, refer to Section 4.8.
KEYACC 0 Writes to 0xFFB0–0xFFB7 are interpreted as the start of a FLASH programming or erase command
1 Writes to NVBACKKEY (0xFFB0–0xFFB7) are interpreted as comparison key writes
$1824 7 6 5 4 3 2 1 0
R FPS7 FPS6 FPS5 FPS4 FPS3 FPS2 FPS1 FPDIS
(1) (1) (1) (1) (1) (1) (1) (1)
W
Reset: This register is loaded from nonvolatile location NVPROT during reset.
1. Background commands can be used to change the contents of these bits in FPROT.
Field Description
7:1 FLASH Protect Select Bits — When FPDIS = 0, this 7-bit field determines the ending address of unprotected FLASH locations
FPS[7:1] at the high address end of the FLASH. Protected FLASH locations cannot be erased or programmed.
FLASH Protection Disable
0
0 FLASH block specified by FPS[7:1] is block protected (program and erase not allowed)
FPDIS
1 No FLASH block is protected
$1825 7 6 5 4 3 2 1 0
R FCCF 0 FBLANK 0 0
FCBEF FPVIOL FACCERR
W
Reset: 1 1 0 0 0 0 0 0
= Reserved
Field Description
FLASH Command Buffer Empty Flag — The FCBEF bit is used to launch commands. It also indicates that the command
buffer is empty so that a new command sequence can be executed when performing burst programming. The FCBEF bit is
7 cleared by writing a one to it or when a burst program command is transferred to the array for programming. Only burst program
FCBEF commands can be buffered.
0 Command buffer is full (not ready for additional commands)
1 A new burst program command can be written to the command buffer
FXTH870xD
Sensors
Freescale Semiconductor, Inc. 29
Table 16. FSTAT Register Field Descriptions (continued)
Field Description
FLASH Command Complete Flag — FCCF is set automatically when the command buffer is empty and no command is being
processed. FCCF is cleared automatically when a new command is started (by writing 1 to FCBEF to register a command).
6
Writing to FCCF has no meaning or effect.
FCCF
0 Command in progress
1 All commands complete
Protection Violation Flag — FPVIOL is set automatically when FCBEF is cleared to register a command that attempts to erase
5 or program a location in a protected block (the erroneous command is ignored). FPVIOL is cleared by writing a 1 to FPVIOL.
FPVIOL 0 No protection violation
1 An attempt was made to erase or program a protected location
Access Error Flag — FACCERR is set automatically when the proper command sequence is not obeyed exactly (the
erroneous command is ignored), if a program or erase operation is attempted before the FCDIV register has been initialized,
or if the MCU enters STOP while a command was in progress. For a more detailed discussion of the exact actions that are
4
considered access errors, see Section 4.7.5. FACCERR is cleared by writing a 1 to FACCERR. Writing a 0 to FACCERR has
FACCERR no meaning or effect.
0 No access error
1 An access error has occurred
FLASH Verified as All Blank (erased) Flag — FBLANK is set automatically at the conclusion of a blank check command if
the entire FLASH array was verified to be erased. FBLANK is cleared by clearing FCBEF to write a new valid command. Writing
2 to FBLANK has no meaning or effect.
FBLANK 0 After a blank check command is completed and FCCF = 1, FBLANK = 0 indicates the FLASH array is not completely erased
1 After a blank check command is completed and FCCF = 1, FBLANK = 1 indicates the FLASH array is completely erased
(all 0xFF)
$1826 7 6 5 4 3 2 1 0
R 0 0 0 0 0 0 0 0
W FCMD7 FCMD6 FCMD5 FCMD4 FCMD3 FCMD2 FCMD1 FCMD0
Reset: 0 0 0 0 0 0 0 0
All other command codes are illegal and generate an access error.
It is not necessary to perform a blank check command after a mass erase operation. Only blank check is required as part of the
security unlocking mechanism.
FXTH870xD
Sensors
30 Freescale Semiconductor, Inc.
5 Reset, Interrupts and System Configuration
This section discusses basic reset and interrupt mechanisms and the various sources of reset and interrupts in the FXTH870xD.
Some interrupt sources from peripheral modules are discussed in greater detail within other sections of this product specification.
This section gathers basic information about all reset and interrupt sources in one place for easy reference. A few reset and
interrupt sources, including the computer operating properly (COP) watchdog and real-time interrupt (RTI), are not part of on-chip
peripheral systems, but are part of the system control logic.
5.1 Features
Reset and interrupt features include:
• Multiple sources of reset for flexible system configuration and reliable operation
• Reset status register (SRS) to indicate source of most recent reset
• Separate interrupt vectors for each module (reduces polling overhead)
COPT COP
Clock COP Overflow Time
COPCLKS Overflow
2 1 0 Source (ms, nominal)
Count
0 0 0 0 LFO 25 32
0 0 0 1 LFO 26 64
7
0 0 1 0 LFO 2 128
0 0 1 1 LFO 28 256
9
0 1 0 0 LFO 2 512
0 1 0 1 LFO 210 1024
FXTH870xD
Sensors
Freescale Semiconductor, Inc. 31
Table 18. COP Watchdog Timeout Period (continued)
COPT COP
Clock COP Overflow Time
COPCLKS Overflow
2 1 0 Source (ms, nominal)
Count
0 1 1 0 LFO 211 2048
11
0 1 1 1 LFO 2 2048
BUSCLKS[1:0]
1:1 (0.5 MHz) 1:0 (1 MHz) 0:1 (2 MHz) 0:0 (4MHz)
13
1 0 0 0 Bus Clock 2 16.384 8.192 4.096 2.048
1 0 0 1 Bus Clock 214 32.768 16.384 8.192 4.096
1 0 1 0 Bus Clock 215 65.536 32.768 16.384 8.192
1 0 1 1 Bus Clock 216 131.072 65.536 32.768 16.384
1 1 0 0 Bus Clock 217 262.144 131.072 65.536 32.768
1 1 0 1 Bus Clock 218 524.288 262.144 131.072 65.536
1 1 1 0 Bus Clock 219 1048.576 524.288 262.144 131.072
1 1 1 1 Bus Clock 219 1048.576 524.288 262.144 131.072
After any reset, the COP timer is enabled. This provides a reliable way to detect code that is not executing as intended. If the
COP watchdog is not used in an application, it can be disabled by clearing the COPE bit in the write-once SIMOPT1 register.
Even if the application will use the reset default settings in COPE, COPCLKS and COPT[2:0], the user should still write to write-
once SIMOPT1 during reset initialization to lock in the settings. That way, they cannot be changed accidentally if the application
program gets lost.
The write to SRS that services (clears) the COP timer should not be placed in an interrupt service routine (ISR) because the ISR
could continue to be executed periodically even if the main application program fails. When the MCU is in ACTIVE
BACKGROUND DEBUG mode, the COP timer is temporarily disabled.
Field Description
7
Reserved Bit — These bits are reserved for factory trim and should not be altered by the user.
reserved
6:4 Temperature Restart High threshold — Binary coded from 0x00 to 0x07; recommend applications overwrite to 0x06 at each
TRH wakeup cycle.
3:1
Reserved Bit — These bits are reserved for factory trim and should not be altered by the user.
reserved
Temperature Restart Outside
1 TR module is outside the TREARM temperature range and will restart the MCU if the TRE bit is set and
0
temperature falls back within the TRESET temperature range.
TRO
0 TR module is within the TRESET temperature range and the MCU cannot be armed to restart when
temperature falls back to the TRESET range. The TRE bit cannot be set.
FXTH870xD
Sensors
32 Freescale Semiconductor, Inc.
5.5 Interrupts
Interrupts provide a way to save the current CPU status and registers, execute an interrupt service routine (ISR), and then restore
the CPU status so processing resumes where it left off before the interrupt. Other than the software interrupt (SWI), which is a
program instruction, interrupts are caused by hardware events. The debug module can also generate an SWI under certain
circumstances.
If an event occurs in an enabled interrupt source, an associated read-only status flag will become set. The CPU will not respond
until and unless the local interrupt enable is a logic 1 to enable the interrupt. The I bit in the CCR must be a logic 0 to allow
interrupts. The global interrupt mask (I bit) in the CCR is initially set after reset which masks (prevents) all maskable interrupt
sources. The user program initializes the stack pointer and performs other system setup before clearing the I bit to allow the CPU
to respond to interrupts. When the CPU receives a qualified interrupt request, it completes the current instruction before
responding to the interrupt. The interrupt sequence follows the same cycle-by-cycle sequence as the SWI instruction and consists
of:
• Saving the CPU registers on the stack
• Setting the I bit in the CCR to mask further interrupts
• Fetching the interrupt vector for the highest-priority interrupt that is currently pending
• Filling the instruction queue with the first three bytes of program information starting from the address fetched from the
interrupt vector locations
While the CPU is responding to the interrupt, the I bit is automatically set to avoid the possibility of another interrupt interrupting
the ISR itself (this is called nesting of interrupts). Normally, the I bit is restored to 0 when the CCR is restored from the value
stacked on entry to the ISR. In rare cases, the I bit may be cleared inside an ISR (after clearing the status flag that generated the
interrupt) so that other interrupts can be serviced without waiting for the first service routine to finish. This practice is not
recommended for anyone other than the most experienced programmers because it can lead to subtle program errors that are
difficult to debug.
The interrupt service routine ends with a return-from-interrupt (RTI) instruction which restores the CCR, A, X, and PC registers
to their pre interrupt values by reading the previously saved information off the stack.
When two or more interrupts are pending when the I bit is cleared, the highest priority source is serviced first.
For compatibility with the M68HC08, the H register is not automatically saved and restored. It is good programming practice to
push H onto the stack at the start of the interrupt service routine (ISR) and restore it just before the RTI that is used to return from
the ISR.
FXTH870xD
Sensors
Freescale Semiconductor, Inc. 33
UNSTACKING Towards LOWER Addresses
ORDER
7 0
SP after
5 1 CONDITION CODE REGISTER interrupt stacking
4 2 ACCUMULATOR
3 3 INDEX REGISTER* (LOW BYTE X)
2 4 PROGRAM COUNTER HIGH
1 5 PROGRAM COUNTER LOW
SP before
the interrupt
STACKING
ORDER Towards HIGHER Addresses
* High byte (H) of index register is not automatically stacked.
Figure 19. Interrupt Stack Frame
FXTH870xD
Sensors
34 Freescale Semiconductor, Inc.
Table 20. Vector Summary
Jump Table
Vector Vector Vector Module
Vector Addr Flags Enables Description
Priority No. Name Source
(High/Low)
15 $DFE0 - $DFE1 Vkbi KBI KBF KBIE Keyboard interrupt pins PTA[3:0]
14 $DFE2 - $DFE3 Reserved
13 $DFE4 - $DFE5 Reserved
Interrupt from the RTI when the periodic
12 $DFE6 - $DFE7 Vrti Sys Ctrl RTIF RTIE
wakeup timer has timed out.
Interrupt from LFR in data mode when a valid
LFIDF LFIDIE
wake ID has been received.
Interrupt from LFR in carrier mode when a
LFCDF LFCDIE
carrier present for the required time.
11 $DFE8 - $DFE9 Vlfrcvr LFR Interrupt from LFR in the manchester decode
LFERF LFERIE
mode when an error is detected.
Interrupt from LFR in the manchester decode
Lower LFDRF LFDRIE mode when an 8-bit data byte has been
successfully received.
10 $DFEA - $DFEB Reserved
Interrupt from the RFM when the data buffer
RFIF
has been completely sent.
9 $DFEC - $DFED Vrf RFM RFIEN
Interrupt from the RFM when transmission
RFEF
error detected.
8 $DFEE - $DFEF Reserved
Interrupt from the TPM1 when the timer
7 $DFF0 - $DFF1 Vtpm1ovf TPM1 TOF TOIE
overflows.
Interrupt from the TPM1 when the selected
6 $DFF2 - $DFF3 Vtpm1ch1 TPM1 CH1F CH1IE
event for channel 1 occurs.
Interrupt from the TPM1 when the selected
5 $DFF4 - $DFF5 Vtpm1ch0 TPM1 CH0F CH0IE
event for channel 0 occurs.
Interrupt from the PWU when the wakeup time
4 $DFF6 - $DFF7 Vwuktmr PWU WUKI WUK[5:0]
interval has elapsed.
Interrupt from the LVD when the supply
3 $DFF8 - $DFF9 Vlvd Sys Ctrl LVDF LVDIE
voltage has dropped below the LVD threshold.
2 $DFFA - $DFFB Reserved
Interrupt from the CPU when an SWI
1 $DFFC - $DFFD Vswi SWI opcode — —
Higher instruction has been executed.
Sys Ctrl - POR — — Reset from power on sequence.
Reset from PWU when the reset interval
Sys Ctrl - PRF PRF PRST[5:0]
elapsed.
Sys Ctrl - COP — COPE Reset when COP watchdog times out.
Reset from the LVD when the supply voltage
Sys Ctrl - LVD — LVDRE
has dropped below the LVD threshold.
0 $DFFE -$DFFF Vreset
Reset when the temperature falls below the
Temp Restart — TRE
temperature restart threshold
Reset from the CPU when trying to execute an
Illegal opcode — —
illegal opcode.
Reset from the CPU when trying to access an
Illegal address — —
illegal address.
FXTH870xD
Sensors
Freescale Semiconductor, Inc. 35
5.6 Low-Voltage Detect (LVD) System
The FXTH870xD includes a system to detect low voltage conditions in order to protect memory contents and control MCU system
states during supply voltage variations. The system is comprised of a power-on reset (POR) circuit and an LVD circuit with a user
selectable trip voltage, either high (VLVDH) or low (VLVDL). The LVD circuit is enabled when LVDE in SPMSC1 is high and the trip
voltage is selected by LVDV in SPMSC3. The LVD is disabled upon entering any of the STOP modes unless the LVDSE bit is
set. If LVDSE and LVDE are both set, then the MCU cannot enter STOP1.
HFO Frequency
CPU Bus Frequency (MHz)
BUSCLKS1 BUSCLKS0 (MHz)
0 0 8 4
0 1 4 2
1 0 2 1
1 1 1 0.5
FXTH870xD
Sensors
36 Freescale Semiconductor, Inc.
5.9 Real Time Interrupt
The RTI uses the internal low frequency oscillator (LFO) as its clock source. The RTI can be used as a periodic interrupt in MCU
RUN mode, or can be used as a periodic wakeup from all low power modes. The LFO is always active and cannot be powered
off by any software control. The control bits for the RTI are shown in Figure 20.
Field Description
RTI Interrupt Flag — The RTIF bit indicates when a wakeup interrupt has been generated by the RTI. This bit is cleared by
7 writing a one to the RTIACK bit. Writing a zero to this bit has no effect. Reset clears this bit.
RTIF 0 Wakeup interrupt not generated or was previously acknowledged.
1 Wakeup interrupt generated.
Acknowledge RTIF Interrupt Flag — The RTIACK bit clears the RTIF bit if written with a one. Writing a zero to the RTIACK bit
6 has no effect on the RTIF bit. Reading the RTIACK bit returns a zero. Reset has no effect on this bit.
RTIACK 0 No effect.
1 Clear RTIF bit.
RTI Interrupt Clock Select — This read-write bit selects the clock source for the real-time interrupt request
5
0 Real-time interrupt request clock source is the LFO.
RTICLKS
1 Real-time interrupt request clock source is the HFO (MCU must be in the RUN mode).
RTIF Interrupt Enable — The RTIE bit enables RTI interrupts if written with a one. Reset clears this bit.
4
0 Disable RTI interrupts.
RTIE
1 Enable RTI interrupts.
3
Unused
Unused
2:0 RTI Interrupt Delay Selects — The RTIS[2:0] bits select the timing of the RTI interrupts as given
RTIS[2:0] in Table 24. Reset clears these bits.
FXTH870xD
Sensors
Freescale Semiconductor, Inc. 37
Table 24. Real-Time Interrupt Period
FXTH870xD
Sensors
38 Freescale Semiconductor, Inc.
Table 25. SRS Register Field Descriptions
Field Description
Power-On Reset — This bit indicates reset was caused by the power-on detection logic. Because the internal supply voltage
was ramping up at the time, the low-voltage reset (LVR) status bit is also set to indicate that the reset occurred while the internal
7
supply was below the LVR threshold.
POR
0 Reset not caused by POR
1 POR caused reset
External Reset Pin — This bit indicates reset was caused by an active-low level on the external reset pin if the device was in
6 either the STOP1 or RUN modes. This bit is not set if the external reset pin is pulled low when the device is in the STOP1 mode.
PIN 0 Reset not caused by external reset pin
1 Reset came from external reset pin
Computer Operating Properly (COP) Watchdog — This bit indicates that reset was caused by the COP watchdog timer timing
5 out. This reset source may be blocked by COPE = 0.
COP 0 Reset not caused by COP timeout
1 Reset caused by COP timeout
Illegal Opcode — This bit indicates reset was caused by an attempt to execute an unimplemented or illegal opcode. The STOP
instruction is considered illegal if STOP is disabled by STOPE = 0 in the SOPT register. The BGND instruction is considered
4
illegal if ACTIVE BACKGROUND mode is disabled by ENBDM = 0 in the BDCSC register.
ILOP
0 Reset not caused by an illegal opcode
1 Reset caused by an illegal opcode
Illegal Address — This bit indicates reset was caused by an attempt to access either data or an instruction at an unimplemented
3 memory address.
ILAD 0 Reset not caused by an illegal address
1 Reset caused by an illegal address
Programmable Wakeup — This bit indicates reset was caused by a PWU reset in run, WAIT, STOP4, and STOP3. After STOP1
2 exit, PRF in PWUCSI indicates PWU was the source of a wakeup.
PWU 0 Reset not caused by PWU.
1 Reset caused by PWU.
Low Voltage Detect — If the LVDRE and LVDSE bits are set and the supply drops below the LVD trip voltage, an LVD reset will
1 occur. This bit is also set by POR.
LVD 0 Reset not caused by LVD trip or POR.
1 Reset caused by LVD trip or POR.
0
Unused Bit — This bit always reads as a logical zero. Writes
Unused
Field Description
COP Enable — This control bit enables the COP watchdog. This bit is a write-once bit so that only the first write after reset is
7 honored. Reset sets the COPE bit.
COPE 0 COP Watchdog disabled.
1 COP Watchdog enabled.
FXTH870xD
Sensors
Freescale Semiconductor, Inc. 39
Table 26. SIMOPT1 Register Field Descriptions (continued)
Field Description
COP Clock Select — This control bit selects the clock source for the COP watchdog timer. This bit is a write-once bit so that
6 only the first write after reset is honored. This bit is cleared by an MCU reset.
COPCLKS 0 Select the LFO oscillator output.
1 Select the CPU bus clock.
STOP Mode Select — This control bit enables/disables the STOP instruction to enter a STOP mode defined by the SPMSCR2
5 register. This bit is a write-once bit so that only the first write after reset is honored. This bit is cleared by an MCU reset.
STOPE 0 Disable STOP modes.
1 Enable STOP modes.
RF Module Enable — This bit enables or disables the RF module. This bit is not affected by any reset or power on after STOP
4 exit. It is only initialized at the first power up. This bit can be written anytime.
RFEN 1 RF module enabled.
0 RF module disabled.
Temperature Restart Enable — This control bit enables the temperature restart circuit to interrupt the MCU after being
3 shutdown at either a very high or very low temperature. This bit is cleared by an MCU reset.
TRE 0 Temperature restart disabled.
1 Temperature restart enabled.
Temperature Restart Level — This control bit selects whether the temperature restart circuit will interrupt the MCU after being
2 shutdown on returning from either a very high or very low temperature. This bit is cleared by an MCU reset.
TRH 0 Temperature restart interrupts MCU on return from a very low temperature.
1 Temperature restart interrupts MCU on return from a very high temperature.
BKGD Pin Enable — BKGDPE can be used to allow the BKGD/PTA4 pin to be shared in applications as an input-only general
1 purpose I/O pin:
BKGDPE 0 BKGD function disabled, PTA4 enabled.
1 BKGD function enabled, PTA4 disabled.
0
Reserved register bit, always reads 1.
Reserved
Field Description
7
Unused Bit — This bit is unused and reads as a logic zero.
Unused
6:4 COP Watchdog Time Out — These control bits select the timeout period for the COP watchdog timer as given in Table 18.
COPT[2:0] These bits are set by an MCU reset to select the longest watchdog timeout period. These bits are write-once after power up.
TPM1 Channel 0 Clock Source — This bit determines which signal is connected to the TPM1 Channel 0, see Section 9.
3
0 Select clock input driven by PTA2.
LFOSEL
1 Select clock input driven by the LFO.
TPM1 Channel 0 CLock Source Divider — The divider for the clock Source for TPM1 Channel 0, see Section 9.
2
0 Select RFM Dx clock source divided by 1.
TCLKDIV
1 Select RFM Dx clock source divided by 8.
FXTH870xD
Sensors
40 Freescale Semiconductor, Inc.
Table 27. SIMOPT2 Register Field Descriptions (continued)
Field Description
Bus Clock Select — Bus clock frequency selection by changing HFO FLL ratio as shown in Figure 2. The bus clock frequency
is always the HFO frequency divided by two. These bits are cleared by a reset and can be written at any time.
1:0
00 Bus Frequency = 4 MHz (HFO = 8 MHz)
BUSCLKS
01 Bus Frequency = 2 MHz (HFO = 4 MHz)
[1:0]
10 Bus Frequency = 1 MHz (HFO = 2 MHz)
11 Bus Frequency = 0.5 MHz (HFO = 1 MHz)
$1809 7 6 5 4 3 2 1(1) 0
R LVDF 0
LVDIE LVDRE(2) LVDSE LVDE(2) 0 BGBE
W LVDACK
Reset: 0 0 0 1 1 1 0 0
= Reserved
1. Bit 1 is a reserved bit that must always be written to 0.
2. This bit can be written only one time after reset. Additional writes are ignored.
Figure 24. System Power Management Status and Control 1 Register (SPMSC1)
Field Description
7
Low-Voltage Detect Flag — Provided LVDE = 1, this read-only status bit indicates a low-voltage detect event.
LVDF
6 Low-Voltage Detect Acknowledge — This write-only bit is used to acknowledge low voltage detection errors (write 1 to clear
LVDACK LVDF). Reads always return logic 0.
Low-Voltage Detect Interrupt Enable — This read/write bit enables hardware interrupt requests for LVDF.
5
0 Hardware interrupt disabled (use polling)
LVDIE
1 Request a hardware interrupt when LVDF = 1
Low-Voltage Detect Reset Enable — This read/write bit enables LVDF events to generate a hardware reset (provided LVDE
4 = 1).
LVDRE 0 LVDF does not generate hardware resets
1 Force an MCU reset when LVDF = 1
Low-Voltage Detect Stop Enable — Provided LVDE = 1, this read/write bit determines whether the low-voltage detect function
3 operates when the MCU is in STOP mode.
LVDSE 0 Low-voltage detect disabled during STOP mode
1 Low-voltage detect enabled during STOP mode
Low-Voltage Detect Enable — This read/write bit enables low-voltage detect logic and qualifies the operation of other bits in
2 this register.
LVDE 0 LVD logic disabled
1 LVD logic enabled
0 Reserved Bit — This bit is reserved should not be altered by the user. Any read returns a logical zero. Any write should be a
Reserved logical zero.
Bandgap Buffer Enable — The BGBE bit is used to enable an internal buffer for the bandgap voltage reference for use by the
0 ADC module on one of its internal channels.
BGBE 0 Bandgap buffer disabled
1 Bandgap buffer enabled
FXTH870xD
Sensors
Freescale Semiconductor, Inc. 41
5.11.5 System Power Management Status and Control 2 Register (SPMSC2)
This register is used to configure the STOP mode behavior of the MCU.
$180A 7 6 5 4 3 2 1 0
R 0 0 0 PDF 0 0
PDC(1) 0
W PPDACK
Power-on reset: 0 0 0 0 0 0 0 0
Any other reset: 0 0 U U 0 0 0 0
= Reserved U = Unaffected by reset
1. This bit can be written only one time after reset. Additional writes are ignored.
Figure 25. System Power Management Status and Control 2 Register (SPMSC2)
Field Description
7:5
Reserved Bits — These bits are reserved should not be altered by the user. Any read returns a logical zero.
Reserved
Power Down Flag — This read-only status bit indicates the MCU has recovered from STOP1 mode.
4
0 MCU has not recovered from STOP1 mode
PDF
1 MCU recovered from STOP1 mode
3
Reserved Bit — This bit is reserved should not be altered by the user. Any read returns a logical zero.
Reserved
2
Partial Power Down Acknowledge — Writing a logic 1 to PPDACK clears the PDF bit.
PPDACK
Power Down Control — The PDC bit controls entry into the power down (STOP1) mode
1
0 Power down mode are disabled
PDC
1 Power down mode are enabled
0 Reserved Bit — This bit is reserved should not be altered by the user. Any read returns a logical zero. Any write should be a
Reserved logical zero.
$180C 7 6 5 4 3 2 1 0
R LVWF 0 0 0 0 0
LVDV LVWV
W LVWACK
Power-on reset: 0(1) 0 0 0 0 0 0 0
LVD reset: 0(1) 0 U U 0 0 0 0
Any other reset: 0(1) 0 U U 0 0 0 0
= Reserved U = Unaffected by reset
1. LVWF will be set in the case when VSupply transitions below the trip point or after reset and VSupply is already below VLVW.
Figure 26. System Power Management Status and Control 3 Register (SPMSC3)
Field Description
Low-Voltage Warning Flag — The LVWF bit indicates the low voltage warning status.
7
0 Low voltage warning not present
LVWF
1 Low voltage warning is present or was present
FXTH870xD
Sensors
42 Freescale Semiconductor, Inc.
Table 30. SRTISC Register Field Descriptions (continued)
Field Description
6 Low-Voltage Warning Acknowledge — The LVWF bit indicates the low voltage warning status.
LVWACK Writing a logic 1 to LVWACK clears LVWF to a logic 0 if a low voltage warning is not present.
Low-Voltage Detect Voltage Select — The LVDV bit selects the LVD trip point voltage (VLVD).
5
0 Low trip point selected (VLVD = VLVDL)
LVDV
1 High trip point selected (VLVD = VLVDH)
Low-Voltage Warning Voltage Select — The LVWV bit selects the LVW trip point voltage (VLVW).
4
0 Low trip point selected (VLVW = VLVDL)
LVWV
1 High trip point selected (VLVW = VLVDH)
3:0
Reserved Bits — These bits are reserved should not be altered by the user. Any read returns a logical zero.
Reserved
Field Description
7:6 Reserved Bits — These bits are reserved for Freescale firmware control. Application software shall assure these two bits are
Reserved never overwritten.
Keyboard Flag — This bit indicates that any keyboard pin caused the last exit from STOP mode.
5
0 Keyboard pin did not cause the last exit from STOP mode
KBF
1 Keyboard pin caused the last exit from STOP mode
IRQ Flag — This bit indicates that IRQ pin caused the last exit from STOP mode.
4
0 IRQ pin did not cause the last exit from STOP mode
IRQF
1 IRQ pin caused the last exit from STOP mode
Temperature Restart Flag — This bit indicates that the temperature restart module caused the last exit from STOP mode.
3
0 TR module did not cause the last exit from STOP mode
TRF
1 TR module caused the last exit from STOP mode
PWU Flag — This bit indicates that the PWU module caused the last exit from STOP mode.
2
0 PWU module did not cause the last exit from STOP mode
PWUF
1 PWU module caused the last exit from STOP mode
LFR Flag — This bit indicates that the LFR module caused the last exit from STOP mode.
1
0 LFR module did not cause the last exit from STOP mode
LFF
1 LFR module caused the last exit from STOP mode
RFM Flag — This bit indicates that the RFM module caused the last exit from STOP mode.
0
0 RFM module did not cause the last exit from STOP mode
RFF
1 RFM module caused the last exit from STOP mode
FXTH870xD
Sensors
Freescale Semiconductor, Inc. 43
6 General Purpose I/O
This section explains software controls related to general purpose input/output (I/O) and pin control. The FXTH870xD has seven
general-purpose I/O pins which are comprised of a general use 5-bit port A and a 2-bit port B.
PTA[4:0] pins are shared with on-chip peripheral functions. PTB[1:0] pins are GPIO only, and are multiplexed with the LF receiver
block (see Section 6.5 for additional details regarding mutually exclusive operations).The peripheral modules have priority over
the general purpose I/O so that when a peripheral is enabled, the general purpose I/O functions associated with the shared pins
are disabled. After reset, the shared peripheral functions are disabled so that the pins are controlled by the general purpose I/O.
All of the general purpose I/O are configured as inputs (PTxDDn = 0) with pullup devices disabled (PTxPEn = 0).
To avoid extra current drain from floating input pins, the user’s application software must configure these pins so that they do not
float (see Section 6.1).
Reading and writing of general purpose I/O is performed through the port data registers. The direction, either input or output, is
controlled through the port data direction registers. The general purpose I/O port function for an individual pin is illustrated in the
block diagram in Figure 28.
PTxDDn
D Q Output Enable
PTxDn
D Q Output Data
1
Port Read
Data 0 Synchronizer Input Data
BUSCLKS
FXTH870xD
Sensors
44 Freescale Semiconductor, Inc.
PTA[3:0] KBEDEy
only
KBIPGy
VDD
PTxPEn
RPU
PTxDDn
Write
PTxDn
PTA[3:0] KBEDGy
only
KBIPEy
PTxPEn
RPD
KBI interrupt
KBACK KBMOD
The data direction control bit (PTxDDn) determines whether the output buffer for the associated pin is enabled, and also controls
the source for port data register reads. The input buffer for the associated pin is always enabled unless the pin is enabled as an
analog function.
When a shared digital function is enabled for a pin, the output buffer is controlled by the shared function. However, the data
direction register bit still controls the source for reads of the port data register.
When a shared analog function is enabled for a pin, both the input and output buffers are disabled. A value of 0 is read for any
port data bit where the bit is an input (PTxDDn = 0) and the input buffer is disabled. In general, whenever a pin is shared with
both an alternate digital function and an analog function, the analog function has priority such that if both the digital and analog
functions are enabled, the analog function controls the pin.
It is a good programming practice to write to the port data register before changing the direction of a port pin to become an output.
This ensures that the pin will not be driven momentarily with an old data value that happened to be in the port data register.
FXTH870xD
Sensors
Freescale Semiconductor, Inc. 45
An internal pullup device can be enabled for each port pin by setting the corresponding bit in one of the pullup enable registers
(PTxPEn). The pullup device is disabled if the pin is configured as an output by the general purpose I/O control logic or any shared
peripheral function regardless of the state of the corresponding pullup enable register bit. The pullup device is also disabled if the
pin is controlled by an analog function.
FXTH870xD
Sensors
46 Freescale Semiconductor, Inc.
Table 33. Port A Data Register Field Descriptions
Field Description
Port A Data Register Bit — For port A pins that are inputs, reads return the logic level on the pin. For port A pins that are
configured as outputs, reads return the last value written to this register.
4:0
Writes are latched into all bits of this register. For port A pins that are configured as outputs, the logic level is driven out the
PTAD
corresponding MCU pin.
[4:0]
Reset forces PTAD to all 0s, but these 0s are not driven out the corresponding pins because reset also configures all port pins
as high-impedance inputs with pullups disabled.
Field Description
Internal Pullup Enable for Port A Bit n — Each of these control bits determines if the internal pullup device is enabled for the
3:0 associated PTA pin. For port A pins that are configured as outputs, these bits have no effect and the internal pullup devices are
PTAPE disabled.
[3:0] 0 Internal pullup device disabled for port A bit n.
1 Internal pullup device enabled for port A bit n.
Field Description
Data Direction for Port A Bit n — These read/write bits control the direction of port A pins and what is read for PTADD reads.
3:0
0 Input (output driver disabled) and reads return the pin value.
PTADD
1 Output driver enabled for port A bit n and PTADD reads return the contents of PTADDn. PTA4 is input-only, therefore bit 4 will
[3:0]
always be 0.
FXTH870xD
Sensors
Freescale Semiconductor, Inc. 47
6.5 Port B Registers
Port B PTB[1:0] functions are multiplexed with the LF receiver block such that the port B GPIOs become high impedance when
the LF block has been enabled. When the LF block is disabled, port B pins operate as described here.
Field Description
Port B Data Register Bit n — For port B pins that are inputs, reads return the logic level on the pin. For port B pins that are
1:0 configured as outputs, reads return the last value written to this register.
PTBD Writes are latched into all bits of this register. For port B pins that are configured as outputs, the logic level is driven out the
[1:0] corresponding MCU pin.
Reset forces PTBD to all 0s, but these 0s are not driven out the corresponding pins because reset also configures all port pins
as high-impedance inputs with pullups disabled.
Field Description
Internal Pullup Enable for Port B Bit n — Each of these control bits determines if the internal pullup device is enabled for the
1:0 associated PTB pin. For port B pins that are configured as outputs, these bits have no effect and the internal pullup devices are
PTBPE disabled.
[1:0] 0 Internal pullup device disabled for port B bit n.
1 Internal pullup device enabled for port B bit n.
Field Description
1:0 Data Direction for Port B Bit n — These read/write bits control the direction of port B pins and what is read for PTBDD reads.
PTBDD 0 Input (output driver disabled) and reads return the pin value.
[1:0] 1 Output driver enabled for port B bit n and PTBDD reads return the contents of PTBDDn.
FXTH870xD
Sensors
48 Freescale Semiconductor, Inc.
7 Keyboard Interrupt
The FXTH870xD has a KBI module with general purpose I/O pins.
7.1 Features
The KBI features include:
• Up to four keyboard interrupt pins with individual pin enable bits.
• Each keyboard interrupt pin is programmable as falling edge (or rising edge) only, or both falling edge and low level (or both
rising edge and high level) interrupt sensitivity.
• One software enabled keyboard interrupt.
• Exit from low-power modes.
KBACK BUSCLK
1 VDD RESET
KBF
KBIP0 0
S D CLR Q
KBIPE0
SYNCHRONIZER
CK
KBEDG0
KEYBOARD STOP STOP BYPASS KBI
INTERRUPT FF
1 INTERRUP
KBIPn 0
KBMOD
S KBIPEn
KBIE
KBEDGn
FXTH870xD
Sensors
Freescale Semiconductor, Inc. 49
7.5 Register Definitions
The KBI includes three registers:
• An 4-bit pin status and control register.
• An 4-bit pin enable register.
• An 4-bit edge select register.
$000C 7 6 5 4 3 2 1 0
R 0 0 0 0 KBF 0
KBIE KBMOD
W KBACK
Reset: 0 0 0 0 0 0 0 0
= Reserved
Field Description
7:4 Unused register bits, always read 0.
Keyboard Interrupt Flag — KBF indicates when a keyboard interrupt is detected. Writes have no effect on KBF.
3
0 No keyboard interrupt detected.
KBF
1 Keyboard interrupt detected.
2
Keyboard Acknowledge — Writing a 1 to KBACK is part of the flag clearing mechanism. KBACK always reads as 0.
KBACK
Keyboard Interrupt Enable — KBIE determines whether a keyboard interrupt is requested.
1
0 Keyboard interrupt request not enabled.
KBIE
1 Keyboard interrupt request enabled.
Keyboard Detection Mode — KBMOD (along with the KBEDG bits) controls the detection mode of the keyboard interrupt pins.
0
0 Keyboard detects edges only.
KBMOD
1 Keyboard detects both edges and levels.
$000D 7 6 5 4 3 2 1 0
R
KBIPE3 KBIPE2 KBIPE1 KBIPE0
W
Reset: 0 0 0 0 0 0 0 0
Field Description
Keyboard Pin Enables — Each of the KBIPEn bits enable the corresponding keyboard interrupt pin.
3:0
0 Pin not enabled as keyboard interrupt.
KBIPEn
1 Pin enabled as keyboard interrupt.
FXTH870xD
Sensors
50 Freescale Semiconductor, Inc.
7.5.3 KBI Edge Select Register (KBIES)
KBIES contains the edge select control bits.
$000E 7 6 5 4 3 2 1 0
R
KBEDG7 KBEDG6 KBEDG5 KBEDG4 KBEDG3 KBEDG2 KBEDG1 KBEDG0
W
Reset: 0 0 0 0 0 0 0 0
Field Description
Keyboard Edge Selects — Each of the KBEDGn bits selects the falling edge/low level or rising edge/high level function of the
7:0 corresponding pin).
KBEDGn 0 Falling edge/low level.
1 Rising edge/high level.
FXTH870xD
Sensors
Freescale Semiconductor, Inc. 51
8 Central Processing Unit
8.1 Introduction
This section provides summary information about the registers, addressing modes, and instruction set of the CPU of the HCS08
Family. For a more detailed discussion, refer to the HCS08 Family Reference Manual, volume 1, Freescale Semiconductor
document order number HCS08RMV1/D.
The HCS08 CPU is fully source- and object-code-compatible with the M68HC08 CPU. Several instructions and enhanced
addressing modes were added to improve C compiler efficiency and to support a new BACKGROUND DEBUG system which
replaces the monitor mode of earlier M68HC08 microcontrollers (MCU).
8.2 Features
Features of the HCS08 CPU include:
• Object code fully upward-compatible with M68HC05 and M68HC08 Families
• All registers and memory are mapped to a single 64-Kbyte address space
• 16-bit stack pointer (any size stack anywhere in 64-Kbyte address space)
• 16-bit index register (H:X) with powerful indexed addressing modes
• 8-bit accumulator (A)
• Many instructions treat X as a second general-purpose 8-bit register
• Seven addressing modes:
— Inherent — Operands in internal registers
— Relative — 8-bit signed offset to branch destination
— Immediate — Operand in next object code byte(s)
— Direct — Operand in memory at 0x0000–0x00FF
— Extended — Operand anywhere in 64-Kbyte address space
— Indexed relative to H:X — Five submodes including auto-increment
— Indexed relative to SP — Improves C efficiency dramatically
• Memory-to-memory data move instructions with four address mode combinations
• Overflow, half-carry, negative, zero, and carry condition codes support conditional branching on the results of signed,
unsigned, and binary-coded decimal (BCD) operations
• Efficient bit manipulation instructions
• Fast 8-bit by 8-bit multiply and 16-bit by 8-bit divide instructions
• STOP and WAIT instructions to invoke low-power operating modes
FXTH870xD
Sensors
52 Freescale Semiconductor, Inc.
8.3 Programmer’s Model and CPU Registers
Figure 40 shows the five CPU registers. CPU registers are not part of the memory map.
7 0
ACCUMULATOR A
7 0
CONDITION CODE REGISTER V 1 1 H I N Z C CCR
CARRY
ZERO
NEGATIVE
INTERRUPT MASK
HALF-CARRY (FROM BIT 3)
TWO’S COMPLEMENT OVERFLOW
FXTH870xD
Sensors
Freescale Semiconductor, Inc. 53
8.3.4 Program Counter (PC)
The program counter is a 16-bit register that contains the address of the next instruction or operand to be fetched.
During normal program execution, the program counter automatically increments to the next sequential memory location every
time an instruction or operand is fetched. Jump, branch, interrupt, and return operations load the program counter with an
address other than that of the next sequential location. This is called a change-of-flow.
During reset, the program counter is loaded with the reset vector that is located at 0xFFFE and 0xFFFF. The vector stored there
is the address of the first instruction that will be executed after exiting the reset state.
7 0
CONDITION CODE REGISTER V 1 1 H I N Z C CCR
CARRY
ZERO
NEGATIVE
INTERRUPT MASK
HALF-CARRY (FROM BIT 3)
TWO’S COMPLEMENT OVERFLOW
Field Description
Two’s Complement Overflow Flag — The CPU sets the overflow flag when a two’s complement overflow occurs. The signed
7 branch instructions BGT, BGE, BLE, and BLT use the overflow flag.
V 0 No overflow
1 Overflow
Half-Carry Flag — The CPU sets the half-carry flag when a carry occurs between accumulator bits 3 and 4 during an add-without-
carry (ADD) or add-with-carry (ADC) operation. The half-carry flag is required for binary-coded decimal (BCD) arithmetic
4 operations. The DAA instruction uses the states of the H and C condition code bits to automatically add a correction value to the
H result from a previous ADD or ADC on BCD operands to correct the result to a valid BCD value.
0 No carry between bits 3 and 4
1 Carry between bits 3 and 4
Interrupt Mask Bit — When the interrupt mask is set, all maskable CPU interrupts are disabled. CPU interrupts are enabled when
the interrupt mask is cleared. When a CPU interrupt occurs, the interrupt mask is set automatically after the CPU registers are
saved on the stack, but before the first instruction of the interrupt service routine is executed.
3
Interrupts are not recognized at the instruction boundary after any instruction that clears I (CLI or TAP). This ensures that the next
I
instruction after a CLI or TAP will always be executed without the possibility of an intervening interrupt, provided I was set.
0 Interrupts enabled
1 Interrupts disabled
Negative Flag — The CPU sets the negative flag when an arithmetic operation, logic operation, or data manipulation produces
a negative result, setting bit 7 of the result. Simply loading or storing an 8-bit or 16-bit value causes N to be set if the most
2
significant bit of the loaded or stored value was 1.
N
0 Non-negative result
1 Negative result
Zero Flag — The CPU sets the zero flag when an arithmetic operation, logic operation, or data manipulation produces a result
1 of 0x00 or 0x0000. Simply loading or storing an 8-bit or 16-bit value causes Z to be set if the loaded or stored value was all 0s.
Z 0 Non-zero result
1 Zero result
FXTH870xD
Sensors
54 Freescale Semiconductor, Inc.
Table 43. CCR Register Field Descriptions (continued)
Field Description
Carry/Borrow Flag — The CPU sets the carry/borrow flag when an addition operation produces a carry out of bit 7 of the
accumulator or when a subtraction operation requires a borrow. Some instructions — such as bit test and branch, shift, and rotate
0
— also clear or set the carry/borrow flag.
C
0 No carry out of bit 7
1 Carry out of bit 7
FXTH870xD
Sensors
Freescale Semiconductor, Inc. 55
8.4.6.3 Indexed, 8-Bit Offset (IX1)
This variation of indexed addressing uses the 16-bit value in the H:X index register pair plus an unsigned 8-bit offset included in
the instruction as the address of the operand needed to complete the instruction.
8.4.6.4 Indexed, 8-Bit Offset with Post Increment (IX1+)
This variation of indexed addressing uses the 16-bit value in the H:X index register pair plus an unsigned 8-bit offset included in
the instruction as the address of the operand needed to complete the instruction. The index register pair is then incremented
(H:X = H:X + 0x0001) after the operand has been fetched. This addressing mode is used only for the CBEQ instruction.
8.4.6.5 Indexed, 16-Bit Offset (IX2)
This variation of indexed addressing uses the 16-bit value in the H:X index register pair plus a 16-bit offset included in the
instruction as the address of the operand needed to complete the instruction.
8.4.6.6 SP-Relative, 8-Bit Offset (SP1)
This variation of indexed addressing uses the 16-bit value in the stack pointer (SP) plus an unsigned 8-bit offset included in the
instruction as the address of the operand needed to complete the instruction.
8.4.6.7 SP-Relative, 16-Bit Offset (SP2)
This variation of indexed addressing uses the 16-bit value in the stack pointer (SP) plus a 16-bit offset included in the instruction
as the address of the operand needed to complete the instruction.
FXTH870xD
Sensors
56 Freescale Semiconductor, Inc.
certain that the interrupt service routine does not use any instructions or auto-increment addressing modes that might change
the value of H.
The software interrupt (SWI) instruction is like a hardware interrupt except that it is not masked by the global I bit in the CCR and
it is associated with an instruction opcode within the program so it is not asynchronous to program execution.
FXTH870xD
Sensors
Freescale Semiconductor, Inc. 57
X = Index register, lower order (least significant) 8 bits
PC = Program counter
PCH = Program counter, higher order (most significant) 8 bits
PCL = Program counter, lower order (least significant) 8 bits
SP = Stack pointer
Memory and addressing
M = A memory location or absolute data, depending on addressing mode
M:M + 0x0001 = A 16-bit value in two consecutive memory locations. The higher-order (most significant) 8 bits are
located at the address of M, and the lower-order (least significant) 8 bits are located at the next higher
sequential address.
Source form
Everything in the source forms columns, except expressions in italic characters, is literal information that must appear in the
assembly source file exactly as shown. The initial 3- to 5-letter mnemonic is always a literal expression. All commas, pound signs
(#), parentheses, and plus signs (+) are literal characters.
n — Any label or expression that evaluates to a single integer in the range 0–7
opr8i — Any label or expression that evaluates to an 8-bit immediate value
opr16i — Any label or expression that evaluates to a 16-bit immediate value
opr8a — Any label or expression that evaluates to an 8-bit value. The instruction treats this 8-bit value as
the low order 8 bits of an address in the direct page of the 64-Kbyte address space (0x00xx).
opr16a — Any label or expression that evaluates to a 16-bit value. The instruction treats this value as an
address in the 64-Kbyte address space.
oprx8 — Any label or expression that evaluates to an unsigned 8-bit value, used for indexed addressing
oprx16 — Any label or expression that evaluates to a 16-bit value. Because the HCS08 has a 16-bit
address bus, this can be either a signed or an unsigned value.
rel — Any label or expression that refers to an address that is within –128 to +127 locations from the
next address after the last byte of object code for the current instruction. The assembler will
calculate the 8-bit signed offset and include it in the object code for this instruction.
FXTH870xD
Sensors
58 Freescale Semiconductor, Inc.
Address modes
INH = Inherent (no operands)
IMM = 8-bit or 16-bit immediate
DIR = 8-bit direct
EXT = 16-bit extended
IX = 16-bit indexed no offset
IX+ = 16-bit indexed no offset, post increment (CBEQ and MOV only)
IX1 = 16-bit indexed with 8-bit offset from H:X
IX1+ = 16-bit indexed with 8-bit offset, post increment
(CBEQ only)
IX2 = 16-bit indexed with 16-bit offset from H:X
REL = 8-bit relative offset
SP1 = Stack pointer with 8-bit offset
SP2 = Stack pointer with 16-bit offset
Bus Cycles(1)
Effect
Operand
Address
Opcode
on CCR
Mode
Source
Operation Description
Form
V H I N Z C
FXTH870xD
Sensors
Freescale Semiconductor, Inc. 59
Table 44. HCS08 Instruction Set Summary (Sheet 2 of 8)
Bus Cycles(1)
Effect
Operand
Address
Opcode
on CCR
Mode
Source
Operation Description
Form
V H I N Z C
FXTH870xD
Sensors
60 Freescale Semiconductor, Inc.
Table 44. HCS08 Instruction Set Summary (Sheet 3 of 8)
Bus Cycles(1)
Effect
Operand
Address
Opcode
on CCR
Mode
Source
Operation Description
Form
V H I N Z C
FXTH870xD
Sensors
Freescale Semiconductor, Inc. 61
Table 44. HCS08 Instruction Set Summary (Sheet 4 of 8)
Bus Cycles(1)
Effect
Operand
Address
Opcode
on CCR
Mode
Source
Operation Description
Form
V H I N Z C
FXTH870xD
Sensors
62 Freescale Semiconductor, Inc.
Table 44. HCS08 Instruction Set Summary (Sheet 5 of 8)
Bus Cycles(1)
Effect
Operand
Address
Opcode
on CCR
Mode
Source
Operation Description
Form
V H I N Z C
FXTH870xD
Sensors
Freescale Semiconductor, Inc. 63
Table 44. HCS08 Instruction Set Summary (Sheet 6 of 8)
Bus Cycles(1)
Effect
Operand
Address
Opcode
on CCR
Mode
Source
Operation Description
Form
V H I N Z C
Nibble Swap
NSA A (A[3:0]:A[7:4]) – – – – – – INH 62 1
Accumulator
ORA #opr8i IMM AA ii 2
ORA opr8a DIR BA dd 3
ORA opr16a EXT CA hh ll 4
ORA oprx16,X Inclusive OR IX2 DA ee ff 4
A (A) | (M) 0 – – Þ Þ –
ORA oprx8,X Accumulator and Memory IX1 EA ff 3
ORA ,X IX FA 3
ORA oprx16,SP SP2 9EDA ee ff 5
ORA oprx8,SP SP1 9EEA ff 4
Push Accumulator onto
PSHA Push (A); SP (SP) – 0x0001 – – – – – – INH 87 2
Stack
Push H (Index Register
PSHH Push (H); SP (SP) – 0x0001 – – – – – – INH 8B 2
High) onto Stack
Push X (Index Register
PSHX Push (X); SP (SP) – 0x0001 – – – – – – INH 89 2
Low) onto Stack
Pull Accumulator from
PULA SP (SP + 0x0001); PullA – – – – – – INH 86 3
Stack
Pull H (Index Register
PULH SP (SP + 0x0001); PullH – – – – – – INH 8A 3
High) from Stack
Pull X (Index Register
PULX SP (SP + 0x0001); PullX – – – – – – INH 88 3
Low) from Stack
ROL opr8a DIR 39 dd 5
ROLA INH 49 1
ROLX C INH 59 1
Rotate Left through Carry Þ – – Þ Þ Þ
ROL oprx8,X b7
IX1 69 ff 5
b0
ROL ,X IX 79 4
ROL oprx8,SP SP1 9E69 ff 6
ROR opr8a DIR 36 dd 5
RORA INH 46 1
RORX Rotate Right through C INH 56 1
Þ – – Þ Þ Þ
ROR oprx8,X Carry b7 b0
IX1 66 ff 5
ROR ,X IX 76 4
ROR oprx8,SP SP1 9E66 ff 6
SP 0xFF
RSP Reset Stack Pointer – – – – – – INH 9C 1
(High Byte Not Affected)
SP (SP) + 0x0001; Pull (CCR)
SP (SP) + 0x0001; Pull (A)
RTI Return from Interrupt SP (SP) + 0x0001; Pull (X) Þ Þ Þ Þ Þ Þ INH 80 9
SP (SP) + 0x0001; Pull (PCH)
SP (SP) + 0x0001; Pull (PCL)
SP SP + 0x0001PullPCH)
RTS Return from Subroutine – – – – – – INH 81 6
SP SP + 0x0001; Pull (PCL)
SBC #opr8i IMM A2 ii 2
SBC opr8a DIR B2 dd 3
SBC opr16a EXT C2 hh ll 4
SBC oprx16,X IX2 D2 ee ff 4
Subtract with Carry A (A) – (M) – (C) Þ – – Þ Þ Þ
SBC oprx8,X IX1 E2 ff 3
SBC ,X IX F2 3
SBC oprx16,SP SP2 9ED2 ee ff 5
SBC oprx8,SP SP1 9EE2 ff 4
SEC Set Carry Bit C1 – – – – – 1 INH 99 1
SEI Set Interrupt Mask Bit I1 – – 1 – – – INH 9B 1
FXTH870xD
Sensors
64 Freescale Semiconductor, Inc.
Table 44. HCS08 Instruction Set Summary (Sheet 7 of 8)
Bus Cycles(1)
Effect
Operand
Address
Opcode
on CCR
Mode
Source
Operation Description
Form
V H I N Z C
FXTH870xD
Sensors
Freescale Semiconductor, Inc. 65
Table 44. HCS08 Instruction Set Summary (Sheet 8 of 8)
Bus Cycles(1)
Effect
Operand
Address
Opcode
on CCR
Mode
Source
Operation Description
Form
V H I N Z C
01 5 11 5 21 3 31 5 41 4 51 4 61 5 71 5 81 6 91 3 A1 2 B1 3 C1 4 D1 4 E1 3 F1 3
BRCLR0 BCLR0 BRN CBEQ CBEQA CBEQX CBEQ CBEQ RTS BLT CMP CMP CMP CMP CMP CMP
3 DIR 2 DIR 2 REL 3 DIR 3 IMM 3 IMM 3 IX1+ 2 IX+ 1 INH 2 REL 2 IMM 2 DIR 3 EXT 3 IX2 2 IX1 1 IX
02 5 12 5 22 3 32 5 42 5 52 6 62 1 72 1 82 5+ 92 3 A2 2 B2 3 C2 4 D2 4 E2 3 F2 3
BRSET1 BSET1 BHI LDHX MUL DIV NSA DAA BGND BGT SBC SBC SBC SBC SBC SBC
3 DIR 2 DIR 2 REL 3 1 INH 1 INH 1 INH 1 INH 1 INH 2 REL 2 IMM 2 DIR 3 EXT 3 IX2 2 IX1 1 IX
EXT
03 5 13 5 23 3 33 5 43 1 53 1 63 5 73 4 83 11 93 3 A3 2 B3 3 C3 4 D3 4 E3 3 F3 3
BRCLR1 BCLR1 BLS COM COMA COMX COM COM SWI BLE CPX CPX CPX CPX CPX CPX
3 DIR 2 DIR 2 REL 2 DIR 1 INH 1 INH 2 IX1 1 IX 1 INH 2 REL 2 IMM 2 DIR 3 EXT 3 IX2 2 IX1 1 IX
04 5 14 5 24 3 34 5 44 1 54 1 64 5 74 4 84 1 94 2 A4 2 B4 3 C4 4 D4 4 E4 3 F4 3
BRSET2 BSET2 BCC LSR LSRA LSRX LSR LSR TAP TXS AND AND AND AND AND AND
3 DIR 2 DIR 2 REL 2 DIR 1 INH 1 INH 2 IX1 1 IX 1 INH 1 INH 2 IMM 2 DIR 3 EXT 3 IX2 2 IX1 1 IX
05 5 15 5 25 3 35 4 45 3 55 4 65 3 75 5 85 1 95 2 A5 2 B5 3 C5 4 D5 4 E5 3 F5 3
BRCLR2 BCLR2 BCS STHX LDHX LDHX CPHX CPHX TPA TSX BIT BIT BIT BIT BIT BIT
3 DIR 2 DIR 2 REL 2 DIR 3 IMM 2 DIR 3 IMM 2 DIR 1 INH 1 INH 2 IMM 2 DIR 3 EXT 3 IX2 2 IX1 1 IX
06 5 16 5 26 3 36 5 46 1 56 1 66 5 76 4 86 3 96 5 A6 2 B6 3 C6 4 D6 4 E6 3 F6 3
BRSET3 BSET3 BNE ROR RORA RORX ROR ROR PULA STHX LDA LDA LDA LDA LDA LDA
3 DIR 2 DIR 2 REL 2 DIR 1 INH 1 INH 2 IX1 1 IX 1 INH 3 2 IMM 2 DIR 3 EXT 3 IX2 2 IX1 1 IX
EXT
07 5 17 5 27 3 37 5 47 1 57 1 67 5 77 4 87 2 97 1 A7 2 B7 3 C7 4 D7 4 E7 3 F7 2
BRCLR3 BCLR3 BEQ ASR ASRA ASRX ASR ASR PSHA TAX AIS STA STA STA STA STA
3 DIR 2 DIR 2 REL 2 DIR 1 INH 1 INH 2 IX1 1 IX 1 INH 1 INH 2 IMM 2 DIR 3 EXT 3 IX2 2 IX1 1 IX
08 5 18 5 28 3 38 5 48 1 58 1 68 5 78 4 88 3 98 1 A8 2 B8 3 C8 4 D8 4 E8 3 F8 3
BRSET4 BSET4 BHCC LSL LSLA LSLX LSL LSL PULX CLC EOR EOR EOR EOR EOR EOR
3 DIR 2 DIR 2 REL 2 DIR 1 INH 1 INH 2 IX1 1 IX 1 INH 1 INH 2 IMM 2 DIR 3 EXT 3 IX2 2 IX1 1 IX
09 5 19 5 29 3 39 5 49 1 59 1 69 5 79 4 89 2 99 1 A9 2 B9 3 C9 4 D9 4 E9 3 F9 3
BRCLR4 BCLR4 BHCS ROL ROLA ROLX ROL ROL PSHX SEC ADC ADC ADC ADC ADC ADC
3 DIR 2 DIR 2 REL 2 DIR 1 INH 1 INH 2 IX1 1 IX 1 INH 1 INH 2 IMM 2 DIR 3 EXT 3 IX2 2 IX1 1 IX
0A 5 1A 5 2A 3 3A 5 4A 1 5A 1 6A 5 7A 4 8A 3 9A 1 AA 2 BA 3 CA 4 DA 4 EA 3 FA 3
BRSET5 BSET5 BPL DEC DECA DECX DEC DEC PULH CLI ORA ORA ORA ORA ORA ORA
3 DIR 2 DIR 2 REL 2 DIR 1 INH 1 INH 2 IX1 1 IX 1 INH 1 INH 2 IMM 2 DIR 3 EXT 3 IX2 2 IX1 1 IX
0B 5 1B 5 2B 3 3B 7 4B 4 5B 4 6B 7 7B 6 8B 2 9B 1 AB 2 BB 3 CB 4 DB 4 EB 3 FB 3
BRCLR5 BCLR5 BMI DBNZ DBNZA DBNZX DBNZ DBNZ PSHH SEI ADD ADD ADD ADD ADD ADD
3 DIR 2 DIR 2 REL 3 DIR 2 INH 2 INH 3 IX1 2 IX 1 INH 1 INH 2 IMM 2 DIR 3 EXT 3 IX2 2 IX1 1 IX
0C 5 1C 5 2C 3 3C 5 4C 1 5C 1 6C 5 7C 4 8C 1 9C 1 BC 3 CC 4 DC 4 EC 3 FC 3
BRSET6 BSET6 BMC INC INCA INCX INC INC CLRH RSP JMP JMP JMP JMP JMP
3 DIR 2 DIR 2 REL 2 DIR 1 INH 1 INH 2 IX1 1 IX 1 INH 1 INH 2 DIR 3 EXT 3 IX2 2 IX1 1 IX
0D 5 1D 5 2D 3 3D 4 4D 1 5D 1 6D 4 7D 3 9D 1 AD 5 BD 5 CD 6 DD 6 ED 5 FD 5
BRCLR6 BCLR6 BMS TST TSTA TSTX TST TST NOP BSR JSR JSR JSR JSR JSR
3 DIR 2 DIR 2 REL 2 DIR 1 INH 1 INH 2 IX1 1 IX 1 INH 2 REL 2 DIR 3 EXT 3 IX2 2 IX1 1 IX
0E 5 1E 5 2E 3 3E 6 4E 5 5E 5 6E 4 7E 5 8E 2+ 9E AE 2 BE 3 CE 4 DE 4 EE 3 FE 3
BRSET7 BSET7 BIL CPHX MOV MOV MOV MOV STOP Page 2 LDX LDX LDX LDX LDX LDX
3 DIR 2 DIR 2 REL 3 3 DD 2 DIX+ 3 IMD 2 IX+D 1 INH 2 IMM 2 DIR 3 EXT 3 IX2 2 IX1 1 IX
EXT
0F 5 1F 5 2F 3 3F 5 4F 1 5F 1 6F 5 7F 4 8F 2+ 9F 1 AF 2 BF 3 CF 4 DF 4 EF 3 FF 2
BRCLR7 BCLR7 BIH CLR CLRA CLRX CLR CLR WAIT TXA AIX STX STX STX STX STX
3 DIR 2 DIR 2 REL 2 DIR 1 INH 1 INH 2 IX1 1 IX 1 INH 1 INH 2 IMM 2 DIR 3 EXT 3 IX2 2 IX1 1 IX
FXTH870xD
Sensors
66 Freescale Semiconductor, Inc.
Table 45. Opcode Map (Sheet 2 of 2)
Bit-Manipulation Branch Read-Modify-Write Control Register/Memory
9E60 6 9ED0 5 9EE0 4
NEG SUB SUB
3 SP1 4 SP2 3 SP1
9ED2 5 9EE2 4
SBC SBC
4 SP2 3 SP1
9ED5 5 9EE5 4
BIT BIT
4 SP2 3 SP1
9E6C 6
INC
3 SP1
9E6D 5
TST
3 SP1
Note: All Sheet 2 Opcodes are Preceded by the Page 2 Prebyte (9E)
FXTH870xD
Sensors
Freescale Semiconductor, Inc. 67
9 Timer Pulse-Width Module
The timer pulse-width module (TPM1) is a two channel timer system that supports traditional input capture, output compare, or
edge-aligned PWM on each channel. All the features and functions of the TPM1 are as described in the MC9S08RC16 product
specification. The user has the option to connect the two timer channels to the PTA2:3 pins, if those pins are not needed for an
LFR channel or other general purpose I/O function. The following clock source and frequency selections are available using the
system option register 2 as shown in Figure 23 and Table 27.
In addition one channel of the TPM1 can be connected to a 500 kHz clock (DX) derived from the crystal oscillator on the RFM.
This selection is made by setting the TPM1 to use an external clock. This clock source allows time calibration of the LFO as
described in the Section 14.
9.1 Features
The TPM1 has the following features:
• May be configured for buffered, center-aligned pulse-width modulation (CPWM) on all channels
• Clock sources independently selectable
• Selectable clock sources (device dependent): bus clock, fixed system clock
• Clock prescaler taps for divide by 1, 2, 4, 8, 16, 32, 64, or 128
• 16-bit free-running or up/down (CPWM) count operation
• 16-bit modulus register to control counter range
• Timer system enable
• One interrupt per channel plus a terminal count interrupt
• Channel features:
— Each channel may be input capture, output compare, or buffered edge-aligned PWM
— Rising-edge, falling-edge, or any-edge input capture trigger
— Set, clear, or toggle output compare action
— Selectable polarity on PWM outputs
FXTH870xD
Sensors
68 Freescale Semiconductor, Inc.
9.2.1 Block Diagram
Figure 42 shows the structure of a TPM1.
ELS0B ELS0A
CHANNEL 0
PORT TPMCH0
16-BIT COMPARATOR LOGIC
TPMC0VH:TPMC0VL CH0F
16-BIT LATCH INTERRUPT
LOGIC
MS0B MS0A CH0IE
INTERNAL BUS
TPMC1VH:TPMC1VL CH1F
FXTH870xD
Sensors
Freescale Semiconductor, Inc. 69
9.4 Register Definition
The TPM1 includes:
• An 8-bit status and control register (TPMSC)
• A 16-bit counter (TPMCNTH:TPMCNTL)
• A 16-bit modulo register (TPMMODH:TPMMODL)
Each timer channel has:
• An 8-bit status and control register (TPMCnSC)
• A 16-bit channel value register (TPMCnVH:TPMCnVL)
$0010 7 6 5 4 3 2 1 0
R TOF
TOIE CPWMS CLKSB CLKSA PS2 PS1 PS0
W
Reset 0 0 0 0 0 0 0 0
= Reserved
Field Description
Timer Overflow Flag — This flag is set when the TPM1 counter changes to 0x0000 after reaching the modulo value
programmed in the TPM1 counter modulo registers. When the TPM1 is configured for CPWM, TOF is set after the counter has
reached the value in the modulo register, at the transition to the next lower count value. Clear TOF by reading the TPM1 status
7 and control register when TOF is set and then writing a 0 to TOF. If another TPM1 overflow occurs before the clearing sequence
TOF is complete, the sequence is reset so TOF would remain set after the clear sequence was completed for the earlier TOF. Reset
clears TOF. Writing a 1 to TOF has no effect.
0 TPM1 counter has not reached modulo value or overflow
1 TPM1 counter has overflowed
Timer Overflow Interrupt Enable — This read/write bit enables TPM1 overflow interrupts. If TOIE is set, an interrupt is
6 generated when TOF equals 1. Reset clears TOIE.
TOIE 0 TOF interrupts inhibited (use software polling)
1 TOF interrupts enabled
Center-Aligned PWM Select — This read/write bit selects CPWM operating mode. Reset clears this bit so the TPM1 operates
in up-counting mode for input capture, output compare, and edge-aligned PWM functions. Setting CPWMS reconfigures the
5 TPM1 to operate in up-/down-counting mode for CPWM functions. Reset clears CPWMS.
CPWMS 0 All TPM channels operate as input capture, output compare, or edge-aligned PWM mode as selected by the MSnB:MSnA
control bits in each channel’s status and control register
1 All TPM channels operate in center-aligned PWM mode
Clock Source Select — As shown in Table 46, this 2-bit field is used to disable the TPM1 system or select one of three clock
4:3
sources to drive the counter prescaler. The internal DX source is synchronized to the bus clock by an on-chip synchronization
CLKS[B:A]
circuit.
Prescale Divisor Select — This 3-bit field selects one of eight divisors for the TPM1 clock input as shown in Table 48. This
2:0
prescaler is located after any clock source synchronization or clock source selection, so it affects whatever clock source is
PS[2:0]
selected to drive the TPM1 system.
FXTH870xD
Sensors
70 Freescale Semiconductor, Inc.
Table 48. Prescale Divisor Selection
$0011 7 6 5 4 3 2 1 0
R Bit 15 14 13 12 11 10 9 Bit 8
W Any write to TPMCNTH clears the 16-bit counter.
Reset 0 0 0 0 0 0 0 0
$0012 7 6 5 4 3 2 1 0
R Bit 7 6 5 4 3 2 1 Bit 0
W Any write to TPMCNTL clears the 16-bit counter.
Reset 0 0 0 0 0 0 0 0
$0013 7 6 5 4 3 2 1 0
R
Bit 15 14 13 12 11 10 9 Bit 8
W
Reset 0 0 0 0 0 0 0 0
FXTH870xD
Sensors
Freescale Semiconductor, Inc. 71
$0014 7 6 5 4 3 2 1 0
R
Bit 7 6 5 4 3 2 1 Bit 0
W
Reset 0 0 0 0 0 0 0 0
$0015 7 6 5 4 3 2 1 0
R 0 0
CH0F CH0IE MS0B MS0A ELS0B ELS0A
W
Reset 0 0 0 0 0 0 0 0
= Reserved
Field Description
Channel 0 Flag — When channel n is configured for input capture, this flag bit is set when an active edge occurs on the channel
n pin. When channel 0 is an output compare or edge-aligned PWM channel, CH0F is set when the value in the TPM1 counter
registers matches the value in the TPM1 channel 0 value registers. This flag is seldom used with center-aligned PWMs because
it is set every time the counter matches the channel value register, which correspond to both edges of the active duty cycle
period.
7 A corresponding interrupt is requested when CH0F is set and interrupts are enabled (CH0IE = 1). Clear CH0F by reading
CH0F TPM1C0SC while CH0F is set and then writing a 0 to CH0F. If another interrupt request occurs before the clearing sequence
is complete, the sequence is reset so CH0F would remain set after the clear sequence was completed for the earlier CH0F.
This is done so a CH0F interrupt request cannot be lost by clearing a previous CH0F. Reset clears CH0F. Writing a 1 to CH0F
has no effect.
0 No input capture or output compare event occurred on channel 0
1 Input capture or output compare event occurred on channel 0
Channel 0 Interrupt Enable — This read/write bit enables interrupts from channel 0. Reset clears CH0IE.
6
0 Channel 0 interrupt requests disabled (use software polling)
CH0IE
1 Channel 0 interrupt requests enabled
5 Mode Select B for TPM1 Channel 0 — When CPWMS = 0, MS0B = 1 configures TPM1 channel 0 for edge-aligned PWM
MS0B mode. For a summary of channel mode and setup controls, refer to Table 50.
4 Mode Select A for TPM1 Channel 0 — When CPWMS = 0 and MS0B = 0, MS0A configures TPM1 channel 0 for input capture
MS0A mode or output compare mode. Refer to Table 50 for a summary of channel mode and setup controls.
Edge/Level Select Bits — Depending on the operating mode for the timer channel as set by CPWMS:MS0B:MSnA and shown
in Table 50, these bits select the polarity of the input edge that triggers an input capture event, select the level that will be driven
3:2
in response to an output compare match, or select the polarity of the PWM output.
ELS0[B:A]
Setting ELS0B:ELS0A to 0:0 configures the related timer pin as a general-purpose I/O pin unrelated to any timer channel
functions. This function is typically used to temporarily disable an input capture channel or to make the timer pin available as a
general-purpose I/O pin when the associated timer channel is set up as a software timer that does not require the use of a pin.
FXTH870xD
Sensors
72 Freescale Semiconductor, Inc.
Table 50. Mode, Edge, and Level Selection
If the associated port pin is not stable for at least two bus clock cycles before changing to input capture mode, it is possible to
get an unexpected indication of an edge trigger. Typically, a program would clear status flags after changing channel configuration
bits and before enabling channel interrupts or using the status flags to avoid any unexpected behavior.
$0016 7 6 5 4 3 2 1 0
R
Bit 15 14 13 12 11 10 9 Bit 8
W
Reset 0 0 0 0 0 0 0 0
$0017 7 6 5 4 3 2 1 0
R
Bit 7 6 5 4 3 2 1 Bit 0
W
Reset 0 0 0 0 0 0 0 0
FXTH870xD
Sensors
Freescale Semiconductor, Inc. 73
9.4.6 Timer Channel 1 Status and Control Register (TPM1C1SC)
TPM1C1SC contains the channel interrupt status flag and control bits that are used to configure the interrupt enable, channel
configuration, and pin function.
$0018 7 6 5 4 3 2 1 0
R 0 0
CH1F CH1IE MS1B MS1A ELS1B ELS1A
W
Reset 0 0 0 0 0 0 0 0
= Reserved
Field Description
Channel 1 Flag — When channel n is configured for input capture, this flag bit is set when an active edge occurs on the channel
n pin. When channel 1 is an output compare or edge-aligned PWM channel, CH1F is set when the value in the TPM1 counter
registers matches the value in the TPM1 channel 1 value registers. This flag is seldom used with center-aligned PWMs because
it is set every time the counter matches the channel value register, which correspond to both edges of the active duty cycle
period.
7 A corresponding interrupt is requested when CH1F is set and interrupts are enabled (CH1IE = 1). Clear CH1F by reading
CH1F TPM1C1SC while CH1F is set and then writing a 0 to CH1F. If another interrupt request occurs before the clearing sequence
is complete, the sequence is reset so CH1F would remain set after the clear sequence was completed for the earlier CH1F.
This is done so a CH1F interrupt request cannot be lost by clearing a previous CH1F. Reset clears CH1F. Writing a 1 to CH1F
has no effect.
0 No input capture or output compare event occurred on channel 1
1 Input capture or output compare event occurred on channel 1
Channel 1 Interrupt Enable — This read/write bit enables interrupts from channel 1. Reset clears CH1IE.
6
0 Channel 1 interrupt requests disabled (use software polling)
CH1IE
1 Channel 1 interrupt requests enabled
5 Mode Select B for TPM1 Channel 1 — When CPWMS = 0, MS1B = 1 configures TPM1 channel 1 for edge-aligned PWM
MS1B mode. For a summary of channel mode and setup controls, refer to Table 50.
4 Mode Select A for TPM1 Channel 1 — When CPWMS = 0 and MS1B = 0, MS1A configures TPM1 channel 1 for input capture
MS1A mode or output compare mode. Refer to Table 50 for a summary of channel mode and setup controls.
Edge/Level Select Bits — Depending on the operating mode for the timer channel as set by CPWMS:MS1B:MS1A and shown
in Table 50, these bits select the polarity of the input edge that triggers an input capture event, select the level that will be driven
3:2 in response to an output compare match, or select the polarity of the PWM output.
ELS1[B:A] Setting ELS1B:ELS1A to 0:0 configures the related timer pin as a general-purpose I/O pin unrelated to any timer channel
functions. This function is typically used to temporarily disable an input capture channel or to make the timer pin available as a
general-purpose I/O pin when the associated timer channel is set up as a software timer that does not require the use of a pin.
FXTH870xD
Sensors
74 Freescale Semiconductor, Inc.
Table 52. Mode, Edge, and Level Selection (continued)
If the associated port pin is not stable for at least two bus clock cycles before changing to input capture mode, it is possible to
get an unexpected indication of an edge trigger. Typically, a program would clear status flags after changing channel configuration
bits and before enabling channel interrupts or using the status flags to avoid any unexpected behavior.
$0019 7 6 5 4 3 2 1 0
R
Bit 15 14 13 12 11 10 9 Bit 8
W
Reset 0 0 0 0 0 0 0 0
$001A 7 6 5 4 3 2 1 0
R
Bit 7 6 5 4 3 2 1 Bit 0
W
Reset 0 0 0 0 0 0 0 0
9.5.1 Counter
All timer functions are based on the main 16-bit counter (TPM1CNTH:TPM1CNTL). This section discusses selection of the clock
source, up-counting vs. up-/down-counting, end-of-count overflow, and manual counter reset.
After any MCU reset, CLKSB:CLKSA = 0:0 so no clock source is selected and the TPM1 is inactive. Normally, CLKSB:CLKSA
would be set to 0:1 so the bus clock drives the timer counter. The clock source for the TPM1 can be selected to be off, the bus
FXTH870xD
Sensors
Freescale Semiconductor, Inc. 75
clock (BUSCLK), the fixed system clock (XCLK), or an external input. The maximum frequency allowed for the external clock
option is one-fourth the bus rate. Refer to Section 9.4.1 and Table 49 for more information about clock source selection.
When the microcontroller is in ACTIVE BACKGROUND mode, the TPM1 temporarily suspends all counting until the
microcontroller returns to normal user operating mode. During STOP mode, all TPM1 clocks are stopped; therefore, the TPM1
is effectively disabled until clocks resume. During WAIT mode, the TPM1 continues to operate normally.
The main 16-bit counter has two counting modes. When center-aligned PWM is selected (CPWMS = 1), the counter operates in
up-/down-counting mode. Otherwise, the counter operates as a simple up-counter. As an up-counter, the main 16-bit counter
counts from 0x0000 through its terminal count and then continues with 0x0000. The terminal count is 0xFFFF or a modulus value
in TPM1MODH:TPM1MODL.
When center-aligned PWM operation is specified, the counter counts upward from 0x0000 through its terminal count and then
counts downward to 0x0000 where it returns to up-counting. Both 0x0000 and the terminal count value (value in
TPM1MODH:TPM1MODL) are normal length counts (one timer clock period long).
An interrupt flag and enable are associated with the main 16-bit counter. The timer overflow flag (TOF) is a software-accessible
indication that the timer counter has overflowed. The enable signal selects between software polling (TOIE = 0) where no
hardware interrupt is generated, or interrupt-driven operation (TOIE = 1) where a static hardware interrupt is automatically
generated whenever the TOF flag is 1.
The conditions that cause TOF to become set depend on the counting mode (up or up/down). In up-counting mode, the main 16-
bit counter counts from 0x0000 through 0xFFFF and overflows to 0x0000 on the next counting clock. TOF becomes set at the
transition from 0xFFFF to 0x0000. When a modulus limit is set, TOF becomes set at the transition from the value set in the
modulus register to 0x0000. When the main 16-bit counter is operating in up-/down-counting mode, the TOF flag gets set as the
counter changes direction at the transition from the value set in the modulus register and the next lower count value. This
corresponds to the end of a PWM period. (The 0x0000 count value corresponds to the center of a period.)
Because the HCS08 MCU is an 8-bit architecture, a coherency mechanism is built into the timer counter for read operations.
Whenever either byte of the counter is read (TPM1CNTH or TPM1CNTL), both bytes are captured into a buffer so when the other
byte is read, the value will represent the other byte of the count at the time the first byte was read. The counter continues to count
normally, but no new value can be read from either byte until both bytes of the old count have been read.
The main timer counter can be reset manually at any time by writing any value to either byte of the timer count TPM1CNTH or
TPM1CNTL. Resetting the counter in this manner also resets the coherency mechanism in case only one byte of the counter was
read before resetting the count.
FXTH870xD
Sensors
76 Freescale Semiconductor, Inc.
Edge-Aligned PWM Mode
This type of PWM output uses the normal up-counting mode of the timer counter (CPWMS = 0) and can be used when other
channels in the same TPM1 are configured for input capture or output compare functions. The period of this PWM signal is
determined by the setting in the modulus register (TPM1MODH:TPM1MODL). The duty cycle is determined by the setting in the
timer channel value register (TPM1CnVH:TPM1CnVL). The polarity of this PWM signal is determined by the setting in the ELSnA
control bit. Duty cycle cases of 0 percent and 100 percent are possible.
As Figure 54 shows, the output compare value in the TPM1 channel registers determines the pulse width (duty cycle) of the PWM
signal. The time between the modulus overflow and the output compare is the pulse width. If ELSnA = 0, the counter overflow
forces the PWM signal high and the output compare forces the PWM signal low. If ELSnA = 1, the counter overflow forces the
PWM signal low and the output compare forces the PWM signal high.
PERIOD
PULSE
WIDTH
TPMCH
FXTH870xD
Sensors
Freescale Semiconductor, Inc. 77
TPMMODH:TPMMODL COUNT = 0
OUTPUT OUTPUT
COUNT = COMPARE COMPARE COUNT =
TPMMODH:TPMMODL (COUNT DOWN) (COUNT UP) TPMMODH:TPMMODL
TPM1CHn
PULSE WIDTH
2x
PERIOD 2x
FXTH870xD
Sensors
78 Freescale Semiconductor, Inc.
9.6.3 Channel Event Interrupt Description
The meaning of channel interrupts depends on the current mode of the channel (input capture, output compare, edge-aligned
PWM, or center-aligned PWM).
When a channel is configured as an input capture channel, the ELSnB:ELSnA control bits select rising edges, falling edges, any
edge, or no edge (off) as the edge that triggers an input capture event. When the selected edge is detected, the interrupt flag is
set. The flag is cleared by the two-step sequence described in Section 9.6.1.
When a channel is configured as an output compare channel, the interrupt flag is set each time the main timer counter matches
the 16-bit value in the channel value register. The flag is cleared by the two-step sequence described in Section 9.6.1.
FXTH870xD
Sensors
Freescale Semiconductor, Inc. 79
10 Other MCU Resources
It is not intended that physical parameter measurements be made during the time that LFR may be actively receiving/decoding
LF signals; or during the time that the RFM may be actively powered up and/or transmitting RF data. The resulting interactions
will degrade the accuracy of the measurements.
The FXTH870xD measures six physical parameters for use in the tire pressure monitoring application: pressure, temperature,
battery voltage, two external voltages and an optional X- and/or Z-axis acceleration. Each parameter is accessed in a different
manner and all use firmware subroutine calls as described in Section 14. These subroutines initialize some control bits within the
sensor measurement interface, SMI, and then place the MCU into the STOP4 mode until the measurement is completed with an
interrupt back to the MCU.
The accuracy, power consumption and timing specified for any measurement given in the electrical specifications in Section 17
are only guaranteed if the user obtains a reading using the specified firmware subroutine call in Section 14.
The FXTH870xD uses a 6-channel, 10-bit analog-to-digital converter (ADC10) module. The ADC10 module is an analog-to-digital
converter using a successive approximation register (SAR) architecture with sample and hold. Capture of pressure and
acceleration sensor readings is controlled by the sensor measurement interface (SMI) and capture of temperature and voltage
readings are controlled by the MCU.
When making measurements of the various analog voltages the individual blocks. will first be powered up long enough to stabilize
their outputs before a conversion is started. The ADC channels are connected in hardware. Conversions are started and ended
synchronously with the sampling of the voltages.
The accuracy, power consumption and timing specifications given in the electrical specifications in Section 17 are based on using
the assigned firmware subroutines in Section 14 to make these measurements and convert them into an 8-bit, 9-bit or 10-bit
transfer function. These measurement accuracy specifications cannot be guaranteed if the user creates custom software routines
to convert these measurements.
P = P P + 100 – P Eqn. 1
450 CODE 450
The transfer equation of the 100-900 kPa range is:
P = P P + 100 – P Eqn. 2
900 CODE 900
Due to calibration routines and parameters stored in the FXTH870xD, the pressure range is selected at production and cannot
be changed in the field.
NOTE
Lack of change of the pressure measurement over time may indicate the package pressure
port to be blocked or the internal section of the sensor to be contaminated. User application
should maintain either locally or at the system data receiver a record of pressure
measurements along with temperature and/or accelerometer measurements, and possibly
identify the pressure port as blocked or contaminated if no changes are recorded over time.
FXTH870xD
Sensors
80 Freescale Semiconductor, Inc.
10.2 Temperature Measurements
The temperature is measured from a VB sensor built into channel 1 of the ADC10 in the same manner as is done in the
FXTH870xD devices with the resulting transfer equation:
T = T T – 55 Eqn. 3
CODE
V = V V + 1.22 Eqn. 4
INT INT CODE
10.3.2 External Voltages
Measurements of an external voltage on either the PTA0 or PTA1 pins can be made and referenced to the internal bandgap
voltage. The resulting transfer equation:
V = V Gx Eqn. 5
PTAx EXT CODE
where x = 0, 1 refers to PTA0 or PTA1.
A = A A + A @A 1 – A Eqn. 7
y y-STEP yCODE y-STEP yCODE y-STEP
The pressure, and optional X or Z-axis accelerometer also share the same signal path in the Transducer interface and all the
sensors share the same ADC. Therefore only one of the sensors can be accessed at a given moment.
NOTE
The included accelerometers are designed with a self-test feature. Consult sales/application
support for information regarding the recommended use of the accelerometer self-test
features.
FXTH870xD
Sensors
Freescale Semiconductor, Inc. 81
VDD VDD
FXTH870xxx FXTH870xxx
V = V –I R V = V – I +I R
DD0 BATT DD0 BATT DD1 BATT DD1 LOAD BATT
V
DD1
V = V – I + --------------------- R
DD1 BATT DD1 R BATT
LOAD
If it is assumed that IDD0 and IDD1 are not appreciably different at the small change in VDD, then the resulting battery impedance
can be approximated as:
V –V R V –V
DD1 DD0 LOAD DD1 DD0
R = --------------------------------------- = ------------------------------------------------------------------------- Eqn. 9
BATT V V
DD1 DD1
---------------------
R
LOAD
where:
VDD0 is the voltage determined with the external load resistor connected to VSS
VDD1 is the voltage determined with the external load resistor connected to VDD
RLOAD is the resistance of the external load resistance in ohms
RBATT is the implied battery impedance in ohms
It is recommended that this calculation be performed with a reasonable current load on the battery of approximately 3 mA (RLOAD
approximately 1000 ohms).
FXTH870xD
Sensors
82 Freescale Semiconductor, Inc.
10.6 Measurement Firmware
The firmware for making measurements is comprised of two function calls as described in Section 14. Each measurement is a
combination of a “read” that returns the raw ADC output data and a “comp” routine which compensates that raw reading based
on information contained in the Universal Uncompensated Measurement Array (UUMA) assigned in RAM memory.
The read routines fill specific locations in the UUMA with raw data; but the compensation routines depend what is already present
in the UUMA as shown in the data flow in Figure 57.
The user therefore has the option to decide how often each measurement (and its component terms) are made. The resulting
power consumption is then the sum of using these components are defined in the electrical specifications in Section 17.
A typical flow for a compensated pressure measurement would be:
1. Call the TPMS_READ_PRESSURE routine which yields a raw pressure value and fills the UUMA with this data.
2. Call the TPMS_READ_TEMPERATURE routine which yields a raw temperature value and fills the UUMA with this
data.
3. Call the TPMS_READ_VOLTAGE routine which yields a raw voltage value and fills the UUMA with this data.
4. Call the TPMS_COMP_PRESSURE routine which then takes the raw pressure, temperature and voltage values from
the UUMA and compensates to provide a true pressure reading to the accuracy as specified in Section 17.
FXTH870xD
Sensors
Freescale Semiconductor, Inc. 83
Figure 57. Data Flow For Measurements
FXTH870xD
Sensors
84 Freescale Semiconductor, Inc.
10.7 Thermal Shutdown
When the package temperature becomes too low or too high the MCU can be placed into a STOP mode to suspend operation
and prevent transmission of RF signals which may be corrupted at the temperature extremes. Return to normal operation after
the temperature falls back within the recovery temperature range. The presence of either the low or high temperature shutdown
will disable the PWU from causing either a periodic wakeup or a periodic reset. The MCU, temperature sensor and ADC10 are
all functional over the full temperature range from TL to TH.
TRH = 0 TRH = 1
TRO TREARML TRESETL TRESETH TREARMH
TREARM
TRESET
TRO = 1
TRO = 0 TEMPERATURE
FXTH870xD
Sensors
Freescale Semiconductor, Inc. 85
This sequence is further explained by the user software flowchart in Figure 59.
FXTH870xD
Sensors
86 Freescale Semiconductor, Inc.
11 Periodic Wakeup Timer
The periodic wakeup timer (PWU) generates a periodic interrupt to wakeup the MCU from any of the STOP modes. It also has
an optional periodic reset to restart the MCU. It is driven by the LFO oscillator in the RTI module which generates a clock at a
nominal one millisecond interval. The LFO and the wakeup timer are always active and cannot be powered off by any software
control. The control bits are set so that there is either a periodic wakeup, a periodic reset, or both a wakeup interrupt and a
periodic reset. No combination of control bits will disable both the wakeup interrupt and the periodic reset. In addition, there is no
hardware control that can mask a wakeup interrupt once it is generated by the PWU.
TRE PRST
TRO PRF
CONTROL
PRFAK LOGIC WUKI
WUFAK WUF
FXTH870xD
Sensors
Freescale Semiconductor, Inc. 87
11.2 Wakeup Divider Register - PWUDIV
The PWUDIV register contains six bits to select the division of the incoming 1 ms clock period as described in Figure 61.
Field Description
7:6 Unused
Unused
Wakeup Divider Value — The WDIV[5:0] bits select an incoming prescaler for the incoming 1 ms clock period from 504 to 1512.
This results in a clocking of the 6-bit wakeup divider at rates from a nominal 0.504 to 1.512 sec per wakeup clock, WCLK. The
user can use this prescaler to fine tune the wakeup time based on the variation in the LFO frequency. The conversion from the
decimal value of the WDIV bits to the nominal WCLK period is given as:
5:0
WDIV[5:0] 504 + 16 WDIV
t = -------------------------------------------------
WCLK f
LFO
A power on reset presets these bits to a value of $1F (decimal 31) which yields a nominal 1 second output period for WCLK.
Other resets have no effect on these bits.
Field Description
Wakeup Interrupt Flag — The WUF bit indicates when a wakeup interrupt has been generated by the PWU. This bit is cleared
7 by writing a one to the WUFAK bit. Writing a zero to this bit has no effect. Reset clears this bit.
WUF 0 Wakeup interrupt not generated or was previously acknowledged.
1 Wakeup interrupt generated.
Acknowledge WUF Interrupt Flag — The WUFAK bit clears the WUF bit if written with a one. Writing a zero to the WUFAK bit
6 has no effect on the WUF bit. Reading the WUFAK bit returns a zero. Reset has no effect on this bit.
WUFAK 0 No effect.
1 Clear WUF bit.
FXTH870xD
Sensors
88 Freescale Semiconductor, Inc.
Table 55. PWUSC0 Register Field Descriptions (continued)
Field Description
WUF Time Interval — These control bits select the number of WCLK clocks that are needed before the next wakeup interrupt
is generated. The count gives a range of wakeup times from 1 to 63 WCLK clocks.
Depending on the value of the bits for the WDIV[5:0] this time interval can nominally be from 1 to 63 seconds in 1 second steps.
Whenever the WUT[5:0] bits are changed the timeout period is restarted. Writing the same data to the WUT[5:0] bits has no
5:0
effect.
WUT[5:0]
Writing zeros to all of the WUT[5:0] bits forces the wakeup divider to a value of $3F and disables the wakeup interrupt. However,
writing all zeros to the WUT[5:0] bits is inhibited if all of the PRST[5:0] bits are already cleared to zero. This prevents disabling
both the periodic wakeup and the periodic reset at the same time. See Table 56.
The WUT[5:0] bits are preset to a value of $3F (decimal 63) by any resets.
Field Description
Periodic Reset Flag — The PRF bit indicates when a periodic reset has been generated by the PWU. MCU writes to this bit
have no effect. This bit is cleared by writing a one to the PRFAK bit. This bit is cleared by a power on reset, but is unaffected by
7
other resets.
PRF
0 Periodic reset not generated or previously acknowledged.
1 Periodic reset generated.
Acknowledge PRF Interrupt Flag — The PRFAK bit clears the PRF bit if written with a one. Writing a zero to the PRFAK bit
6 has no effect on the PRF bit. Reading the PRFAK bit returns a zero. Reset has no effect on this bit.
PRFAK 0 No effect.
1 Clear PRF bit.
Periodic Reset Time Interval — These control bits select the number of wakeup interrupts that are needed before the next
periodic reset is generated. The decimal count gives a range of periodic reset times from 1 to 63 wakeup interrupts. Depending
on the value of the bits for the WDIV[5:0] and WUT[5:0] this time interval can nominally be from 1 second to 66 minutes with
steps from 1 to 63 seconds. Whenever the PRST[5:0] bits are changed the timeout period is restarted. Writing the same data to
5:0
the PRST[5:0] bits has no effect.
PRST[5:0]
Writing zeros to all of the PRST[5:0] bits forces the periodic reset to be disabled if at least one of the WUT[5:0] bits is set to a
one. This assures that there will be at least a wakeup interrupt. However, writing all zeros to the PRST[5:0] bits is inhibited if all
of the WUT[5:0] bits are already cleared to zero. This prevents disabling both the periodic wakeup and the periodic reset at the
same time. See Table 56. The PRST[5:0] bits are preset to a value of 63 by any resets.
FXTH870xD
Sensors
Freescale Semiconductor, Inc. 89
11.5 PWU Wakeup Status Register - PWUS
The PWUS register shows the current status of the two PWU counters as described in Figure 63. The counter contents are
captured when the register is read.
Field Description
Page Selection — The PSEL read/write bit selects whether the other bits are read from the WUT or PRST counters. This bit is
7 cleared by a power on reset that is not created by an exit from the STOP mode, but is unaffected by other resets.
PSEL 0 CSTAT = WUT counter status
1 CSTAT = PRST counter status
6
Unused — An unused bit that always reads as a logical zero.
unused
Counter Status — These read-only bits show the status of the counter selected by the PSEL bit. The effects of any reset on
5:0
these bits depends on how the reset affects the selected counter. Reading these counters immediately after a WUF or PRF
CSTAT
generated flag will return zero contents.
FXTH870xD
Sensors
90 Freescale Semiconductor, Inc.
12 LF Receiver
The low-frequency receiver (LFR) is a very low-power, low-frequency, receiver system for short-range communication in TPMS.
The module allows an external coil to be connected to two dedicated differential input pins. In TPMS systems a single coil may
be oriented for optimal coupling between the receiver in the tire or wheel and a transmitter coil on the vehicle body or chassis.
This LFR system minimizes power consumption by allowing flexibility in choosing the ratio of on to off times and by turning off
power to blocks of circuitry until they are needed during signal reception and protocol recognition. In addition, this LFR system
can autonomously listen for valid LF signals, check for protocol and ID information so the main MCU can remain in a very low
power standby mode until valid message data has been received.
The LFR can be configured for various message protocols and telegrams to allow it to be used in a broad range of applications.
The message preamble must be a series of Manchester coded bits at the nominal 3.906-kbps data rate. A synchronization pattern
is used to mark the boundary between the preamble and the beginning of Manchester encoded information in the message body.
The synchronization pattern is a non-Manchester specific TPMS pattern. Messages can optionally include none, an 8-bit or a 16-
bit ID value. Messages may contain any number of data bytes with the end-of-message indicated by detecting an illegal
Manchester bit at a data byte boundary.
It is not intended that LFR may be actively receiving/decoding LF signals while physical parameter measurements are being
made; or during the time that the RFM may be actively powered up and/or transmitting RF data. The resulting interactions will
degrade the accuracy of the LF detection.
Data
Data
Summator
Average Slicer
Slicer
Filter
Clamp
Clamp Rectifier0 Rectifier1 Rectifier2 Rectifier3
R
LFA
Amp1 Buff1 Amp2 Buff2 Amp3 Buff3
LFB
Sensitivity
Vref_sensitivity
Logic Block 1:
Carrier
Carrier - On/Off cycling MFO
129 kHz Logic Block 2:
Detector
- Carrier Detection 32kHz
Typ - Data decoding
11kHz_clock
kHz_clock Typ
FXTH870xD
Sensors
Freescale Semiconductor, Inc. 91
12.1 Features
Major features of the LFR module include:
• Differential input LF detector (two dedicated pins):
— Selectable sensitivity (two levels: Low Sens (LS) and High Sens (HS)).
— Thresholds trimmed at the factory with trim setting saved in nonvolatile memory.
— LFR has a reference oscillator (LFRO) trimmed at the factory with trim setting saved in nonvolatile memory.
— Selectable signal sampling time interval and on-time.
— Sample interval and on times controlled by LFR state machine or directly by the MCU.
• Configurable receive mode:
— Simple LF carrier detection/Telegram decode. (CARMOD)
• Configurable message protocol (telegram structure):
— Various SYNC decoding (SYNC[1:0])
6-bit time SYNC requirements
7.5-bit time SYNC requirements
9-bit time SYNC requirements
— Optional ID (ID[1:0])
8-bit or 16-bit ID
On or off
— 0-n bytes of message data. End-of-data marked by loss of Manchester at a byte boundary.
• Optional continuous monitoring and decode of the LF detector.
• Selectable MCU interrupt when a received data byte is ready in an LFR buffer, when a Manchester error is detected in the
frame, when an ID is received or when a valid carrier has been detected.
FXTH870xD
Sensors
92 Freescale Semiconductor, Inc.
12.4 Input Amplifier
The LFR module receives LF modulated signals through a dedicated differential pair of inputs which is connected to an external
coil. The enable control (LFEN) allows the user to enable the LF input depending on the application requirements. The SENS[1:0]
bits in the LFCTL1 register allows the user to select one of two input sensitivity thresholds which determines the signal level
required before the input carrier will be detected. The sensitivity setting is used during carrier detection but does not affect
reception after the carrier has been detected. When the CARMOD bit is cleared, after a carrier with sufficient amplitude,
frequency and duration has been detected the output stage of the amplifier is turned on to allow data reception.
FXTH870xD
Sensors
Freescale Semiconductor, Inc. 93
/)(1 2565(6
'LVDEOHG
DWDQ\VWDWH
/)(1
<(6
/)&')
12
$QDORJSRZHUXS
738 /)2F\FOHV
1RVLJQDODERYH
6QLIIIRUFDUULHU VHQVLWLYLW\WKUHVKROG )UHTXHQF\HUURU
6LJQDODERYHWKUHVKROG
21WLPHFRPSOHWHG $1'9$/(1
6LJQDODERYHWKUHVKROG )UHTXHQF\DQG /)&'70
$1'9$/(1 GXUDWLRQFKHFN QRWUHDFKHG
21WLPHFRPSOHWHG
)UHTXHQF\DQG
:DLW2))WLPH /)&'70GXUDWLRQ2.
7VDPSOLQJ7RQ
&DUULHUYDOLGDWHG
2))WLPHFRPSOHWHG &$502'
&$502' &$502'
12 $1''(&(1
$1''(&(1
,QFUHPHQW&DUULHU&RXQWHU
72*02' 6WDUW7LPHRXW
6WDUWDQDORJGHPRGFKDLQ 5LVHFDUULHUGHWHFWIODJ
6WDUWDQDORJGHPRGHFKDLQ &DUULHUFRXQWHU
<(6 7'(& /)&&
&DUULHUFRXQWHU
1R6<1& "/)6&&
,QYHUW&$502' 'HWHFWHG 6HDUFKIRU6<1&
5LVHFDUULHUGHWHFWIODJ
6<1&'HWHFWHG
,'QRW 7LPHRXW
FRPSOHWH 'HFRGH,'
12 &RQWLQXRXVO\21
&RUUHFW,'
:URQJ,'
12
<(6
5LVH,'IODJ
(UURU
(UURULQILUVWELW
'HFRGH'DWD
72*02'
ELWUHFHLYHG
(UURU
<(6
(UURULQILUVWELW
5LVHHUURUIODJ
'DWD5HDG\IODJ ,QYHUW&$502'
5LVHHUURUDQG(20IODJV
<(6
<(6
12
&RQWLQXRXVO\21
5LVH29)IODJV
12
5LVH'DWD
5HDG\IODJ
2102'(
<(6
12
12 21WLPHFRPSOHWHG
<(6
6ZLWFKRII
:DLW7VDPSOLQJ
/)2F\FOHV
7VDPSOLQJFRPSOHWHG
FXTH870xD
Sensors
94 Freescale Semiconductor, Inc.
12.7 Auto-Zero Sequence
An auto-zero sequence is performed periodically on the input amplifier to cancel offset errors. During reception of the SYNC
pattern and body of the message, auto-zero operations are synchronized to data edges of the incoming signal to avoid interfering
with normal reception. During the auto-zero sequence, the input amplifier is temporarily disconnected from the external coil and
connected to ground. The auto-zero sequence takes roughly 64 sec. It is performed at each LFO period in carrier mode and on
one over four decoded data edges in data mode.
When the DECEN bit is cleared, the auto-zero sequence is performed at each LFO period. During the 64 sec of the auto-zero
sequence, the receiver is holding the state “0” or “1”' previously decoded. Since the LFR receiver is not active during this time,
the possible data-rate that the analog can detect is at least limited by this duration.
FXTH870xD
Sensors
Freescale Semiconductor, Inc. 95
Data Slicer Threshold
LF Input
(shaded area
is LF
carrier)
0.5T 0.5T
T T
Logic “1” Logic “0”
Data Bit
(data slicer
output)
T = 1 Bit Time at the data rate (ex. 256 us at data rate of 3.906 kbps)
Figure 67. Manchester Encoded Datagram for LFPOL = 0
When the LFPOL bit is set, a logic one bit is defined as LF carrier present for the first half of the bit time; and a logic zero bit is
defined as no LF carrier present for the first half of the bit time as shown in Figure 68.
LF Input
(shaded area
is LF
carrier)
0.5T 0.5T
T T
Logic “0” Logic “1”
Data Bit
(data slicer
output)
T = 1 Bit Time at the data rate (ex. 256 s at data rate of 3.906 kbps)
Figure 68. Manchester Encoded Datagram for LFPOL = 1
60 40
40 60
1 0
Figure 69. Definition of Duty-Cycle of 40%
Regarding the SYNC pattern which is non-Manchester coded, the duty cycle is applied on all falling edges with the same
proportion as a 1T Manchester symbol, as shown in Figure 70.
FXTH870xD
Sensors
96 Freescale Semiconductor, Inc.
Figure 70. Impact of Duty-Cycle on SYNC Pattern
LFA
• Antenna Q-factor acts as a 1st order
low pass filter on the LF envelop
C R
• Filter time constant : t = R.C
LFB
Recommended < 15.3 sec
FXTH870xD
Sensors
Freescale Semiconductor, Inc. 97
12.13 Telegram Verification
The LFR has control bits to allow flexibility in the telegram format and protocol to allow the LFR to adapt to a variety of systems.
The LFR can operate in a normal data receive mode where it receives complete telegrams, or in a carrier detect mode where it
only checks for a carrier. In the carrier detect mode, as soon as a carrier is detected, the LFCDF flag is set. If LFCDIE is also set,
an interrupt request is sent to wake the MCU
The format of the complete Manchester encoded datagram is comprised of a Manchester data preamble (series of Manchester
1’s or 0’s), a synchronization period, an optional ID, and zero to n data bytes.
The synchronization period can be used for synchronizing the beginning of the data packet. The SYNC pattern that follows the
preamble can be either a 6-, 7.5- or 9 bit-time non-Manchester pattern as shown in Figure 73.
6-bit
(6T)
Pattern T T
SYNC[1:0] = 01
T 2T 2T T
7.5-bit
(7.5T)
Pattern T T
SYNC[1:0] = 10 1.5T
T 2T 2T T
9-bit
(9T)
Pattern 1.5T T T
SYNC[1:0] = 11
3T T 2T 2T T
Figure 73. SYNC Patterns
These patterns would normally not appear anywhere in the Manchester encoded portion of a message so there is no possibility
that the LFR could accidentally synchronize to a message that was already in progress when the LFR started listening for a
message. These patterns are also complex enough so that it is very unlikely that noise or interference could be mistaken for these
SYNC patterns. In the data mode and after the detection of a valid carrier, the LFR will decode the data stream waiting for the
SYNC word. Should this carrier not be an accepted TPMS type, no SYNC will be received and the LFR module will stay in data
receive mode forever. A timeout counter is thus started after a carrier detection and will stop the receiver if reaching the
programmed value selected by the TIMOUT[1:0] bits in the LFCTL4 register. This timeout counter is clocked by the internal LFRO
clock.
The LFR can be configured to have an optional 0, 8-bit or 16-bit ID after the SYNC pattern. If the ID value matches the received
ID, the message is accepted. The ID value can be used to identify a specific receiver, a message type, or some other identifier
as defined by application software.
Any number of data bytes can be included after the ID. The LFR begins to assemble data bytes from the incoming signal as soon
as the ID check is complete. If the first bit-time after the last bit of the ID does not conform to Manchester coding requirements,
the LFR considers the message complete and terminates the LFR operation without setting the data ready flag (LFDRF). If data
follows the ID, it is serially received and when 8 bits have been received the LFR copies this byte into the LFDATA register and
sets the LFDRF flag. If the LFDRIE interrupt enable is also set (and it should be), an interrupt request is sent to wake the MCU
so it can read the data and process it according to the instructions in the application program. Additional bytes are received until
a bit time that is not Manchester encoded is found. If a non-Manchester bit time is found, the LFERF bit will be set and indicates
a Manchester coding error. If this happens on the first bit of the next byte of the message the LFEOMF bit will also be set.
The preamble is a period of Manchester bits before the SYNC pattern as shown in Figure 74. The SYNC pattern will only be
matched for the bit times specified by the SYNC[1:0] control bits. Depending on the expected SYNC pattern the allowed
preambles is as described for the SYNC[1:0] bits in the LFCTL3 register.
FXTH870xD
Sensors
98 Freescale Semiconductor, Inc.
PREAMBLE SYNC HIGH ID LOW ID DATA DATA
FXTH870xD
Sensors
Freescale Semiconductor, Inc. 99
12.17 LFR Register Definition
The LFR module uses eight addresses in the MCU memory map for data, control, and status registers.This section consists of
register descriptions. Each control register (LFCTLx) should be modify when the LF is off (LFEN = 0). Modification of the control
registers “on-the-fly” might lead to unknown state. Each turn off of the LFR (LFEN = 0) should be followed by at least two LFO
cycles before trying to restart the LFR (LFEN = 1).
Field Description
LF Enable — This read-write control bit is used to enable or disable the LF receiver. Once this bit is set the LFR will go through
a power-up sequence that starts on the next rising edge of the LFO clock. The first complete cycle of the LFO is used to power
up the LFR circuits. Following this startup time the auto-zero sequence is performed for 64sec and then the LFR is ready to
7
receive signals.
LFEN
0 LF receiver in standby.
1 LF receiver active.
Note: Enabling the LF receiver function disables the GPIO Port B functions - see Section 6.5.
Soft Reset — This read/write bit controls the soft reset of the LFR. The bit is self reset and always reads as a logical zero.
6
0 Reset completed
SRES
1 Start a soft reset.
Carrier Mode — This read/write control bit selects the basic operating mode for the LFR.
5
0 Data receive mode.
CARMOD
1 Carrier detect mode - wake the MCU when a carrier signal is detected if LFCDIE is set.
LFR Page Select — This read/write bit is used is used to select the register page access. The LPAGE bit has no effect on the
4 LFCTL1 and LFCTL2 registers. This bit is cleared by LFR reset.
LPAGE 0 Access page 0.
1 Access page 1.
Wakeup ID Selection — Selects the existence and length of the wakeup ID. Reset clears these bits.
00 No ID expected
3:2
01 8-bit ID based on the contents of the LFIDL register
IDSEL[1:0]
10 16-bit ID based on the contents of the LFIDH and LFIDL registers
11 8-bit ID matches the contents of either the LFIDH or LFIDL registers
Sensitivity Control — These two read/write control bits select the sensitivity thresholds for the LFR input. These thresholds
apply to the detection portion of a message. If the input level is below the SNODET_x level, no signal will be detected. If the level
is above SDET_x, the signal will be detected. Sensitivity settings are only used in the carrier detect path and do not affect reception
1:0 of the message body.
SENS[1:0] 00 Performance not specified.
01 Low sensitivity (SDET_L; SNODET_L)
10 High sensitivity (SDET_H; SNODET_H)
11 Performance not specified.
FXTH870xD
Sensors
100 Freescale Semiconductor, Inc.
12.17.2 LF Control Register 2 (LFCTL2)
LFCTL2 contains the selection bits for the length of the LF sampling ON time and the time interval between samples as shown
in Figure 76.
Field Description
LF Sampling Time Interval Select— These read/write control bits select the length of time between when the LFR input detector
is turned on as set by the LFONTM bits in LFCTL2 register. The initial sampling interval starts with the LFO clock following a write
to these bits. A reset of the LFR results in the value being set to binary 0110.
0000 Continuous ON mode (see Section 12.15)
0001 Sampled decoding mode every 16 LFO clock periods (16 milliseconds nominal)
0010 Sampled decoding mode every 32 LFO clock periods (32 milliseconds nominal)
7:4 0011 Sampled decoding mode every 64 LFO clock periods (64 milliseconds nominal)
LFSTM
0100 Sampled decoding mode every 128 LFO clock periods (128 milliseconds nominal)
[3:0]
0101 Sampled decoding mode every 256 LFO clock periods (256 millisecond nominal)
0110 Sampled decoding mode every 512 LFO clock periods (512 milliseconds nominal)
0111 Sampled decoding mode every 1024 LFO clock periods (1024 milliseconds nominal)
1000 Sampled decoding mode every 2048 LFO clock periods (2048 milliseconds nominal)
1001 Sampled decoding mode every 4096 LFO clock periods (4096 milliseconds nominal)
1010-1xxxContinuous ON mode (see Section 12.15)
LF Sampling ON Time Select — These read/write control bits select the length of time that the LFR input
detector is turned on at the beginning of each sampling interval set by the LFSTM bits. This ON time is the net sampling time
with any initialization time (maximum of 2 ms) included in the OFF time prior to the sample ON time (see Figure 77). If a signal
is successfully detected, the length of time the detector remains ON depends on the operating mode. In carrier detect mode
(CARMOD = 1) the detector will be turned off early if the evaluation of the carrier signal is completed before the end of the
scheduled ON time. In data receive mode (CARMOD = 0) the detector will remain ON until the end of the message, an error is
detected or timeout occurrence. Reset forces the LFONTM bits to 0:0:0.
0000 1 LFO clock cycle (1 millisecond nominal)
0001 2 LFO clock cycle (2 milliseconds nominal)
0010 4 LFO clock cycle (4 milliseconds nominal)
3:0 0011 8 LFO clock cycle (8 milliseconds nominal)
LFONTM 0100 16 LFO clock cycle (16 milliseconds nominal)
[3:0] 0101 32 LFO clock cycle (32 milliseconds nominal)
0110 64 LFO clock cycle (64 milliseconds nominal)
0111 128 LFO clock cycle (128 milliseconds nominal)
1000 256 LFO clock cycle (256 milliseconds nominal)
1001 512 LFO clock cycle (512 milliseconds nominal)
1010 1024 LFO clock cycles (1024 milliseconds nominal)
1011 1024 LFO clock cycles (1024 milliseconds nominal)
11xx 1024 LFO clock cycles (1024 milliseconds nominal)
Note: The LFONTM selected time must be less than the LFSTM selected time, otherwise the Continuously ON mode is present.
FXTH870xD
Sensors
Freescale Semiconductor, Inc. 101
LFR Detector Active tDEC
LFONTM
Power Up Power Up
Settling Time Settling Time
LFSTM
LFONTM LF searching for
time segments not to scale SYNC pattern
Figure 77. LF Detector Sampling Timing
Field Description
LF Detector Output — This read-only bit follows the bit slicer output signal that goes high during the presence of a carrier. It
7 may change at any time. This bit is read only and unaffected by any reset.
LFDO 0 LF detector output low (no signal above threshold)
1 LF detector output high (received signal above threshold)
LFR Mode Toggle — This read/write bit enables the toggling of the CARMOD bit at each new LFON sequence. Reset clears
this bit.
6
0 CARMOD bit does not change and determines detector mode.
TOGMOD
1 CARMOD bit will be toggled every LFON detection sequence, starting by CARMOD selection.
Therefore the reception chain will alternately look for a carrier frame or for a data frame.
LF SYNC Selection — Selects the type of SYNC pattern as described in Figure 73. Reset presets these bits to the 01 (6T SYNC)
option. Compatible with preamble consisting of minimum 2 ms Manchester data to allow for proper averaging filter operation.
5:4 00 For factory test purposes, not intended for use in any application.
SYNC[1:0] 01 6T SYNC pattern
10 7.5T SYNC pattern
11 9T SYNC pattern
FXTH870xD
Sensors
102 Freescale Semiconductor, Inc.
Table 61. LFCTL3 Register Field Descriptions (continued)
Field Description
LF Carrier Detect Time — These read/write control bits select the length of time which the LFR input detector must detect a
carrier before validating it. In carrier mode (CARMOD = 1), if the carrier is active for at least the time selected by the LFCDTM[3:0]
bits and the LFCC counter value is reached, the LFCDF flag in the LFS register will be set; and if the LFCDIE control bit is also
set, the MCU will be interrupted (wakeup).
In the data receive mode (CARMOD = 0) the LFCDTM[3:0] bits select the length of time which the LFR input detector must detect
a carrier before the effective receive chain is powered on. Once the carrier has been validated the LFCDTM[3:0] bits ignored
during the decode of the rest of the data.
Reset of the LFR results in LFCDTM[3:0] being reset to 0:0:0:0. The resulting carrier detect times are defined by the following
number of carrier periods needed to validate the carrier, with the corresponding time for a carrier at 125 kHz in parenthesis:
NOTE
The auto-zero sequence needs to be performed every 1 ms. Therefore LFR detection times
of 1024, 2048, 4096 and 8192 sec the auto-zero sequence will be done at each 1 ms
interval. This auto-zero sequence lasts for 64 sec. If the carrier is detected again at the end
of the auto-zero sequence it is assumed that the carrier was there for the complete 64 sec
period of the auto-zero.
FXTH870xD
Sensors
Freescale Semiconductor, Inc. 103
12.17.4 LFR Control Register 4 (LFCTL4)
LFCTL4 contains local interrupt enable control bits. The provided I-interrupts are not globally masked by the I bit in the CPU’s
CCR, setting one or more of these interrupt enable control bits will cause a CPU interrupt to be requested whenever the flag bit
associated with the corresponding LFR interrupt source becomes set. It is good practice to clear any flag bits in the LFS register
before setting interrupt enable bits in this register in order to avoid an immediate interrupt request.
Field Description
LFR Data Register Full Interrupt Enable — This read/write bit enables interrupts to be requested when the LFR data register
is full. Reset clears LFDRIE.
7
0 LFDRF interrupts disabled. Use software polling.
LFDRIE
1 LFR Data Register Full interrupts are enabled. If LFDRIE is set,
then an interrupt is requested when LFDRF = 1.
LFR Error Interrupt Enable — This read/write bit enables interrupts to be requested when the LFR detects an error in reception
6 of a non-Manchester encoded bit time following the SYNC time. Reset clears LFERIE.
LFERIE 0 LFERF interrupts disabled. Use software polling.
1 LFERF interrupts are enabled. If LFERIE is set, then an interrupt is requested when LFERF = 1.
LFR Carrier Detect Interrupt Enable — This read/write bit enables the LFCDF interrupt when the LFR detects the number of
samples with an LF signal defined by the LFCDTM bits in the LFCTL3 register. The LFCDIE is ignored when the LFR is operating
5
in the data mode (CARMOD = 0), except when DECEN is cleared. Reset clears LFCDIE.
LFCDIE
0 LFCDF interrupts disabled.
1 LFR LFCDF interrupts are enabled. If LFCDIE is set, then an interrupt is requested when LFCDF = 1.
LFR ID Detect Interrupt Enable — This read/write bit enables interrupts to be requested when the LFR detects a match to the
4 ID code selected in the LFIDH:L registers. Reset clears LFIDIE.
LFIDIE 0 LFIDF interrupts disabled.
1 LFIDF interrupts are enabled. If LFIDIE is set, then an interrupt is requested when LFIDF = 1.
LF Digital Decode Enable — This read/write bit enables the data processing by the digital decoder. When
disabled, the frame format (Manchester, data-rate, SYNC, data) is not checked. There is no more error flag assertion (data, error,
3
ID). The MCU should then poll the LFDO bit to extract from the analog detector the bit stream. Reset sets the DECEN bit.
DECEN
0 Digital decoder is disabled.
1 Digital decoder is enabled.
LF Validation Enable — This read/write bit enables the carrier validation process. Reset sets this bit.
2
0 Carrier Validation disabled.
VALEN
1 Carrier Validation enabled.
SYNC Time Out Select — These two read/write bits select the period of time that the LFR will search for a SYNC pattern in the
data mode. If the SYNC pattern is not detected the LFR will be turned off after this delay time. These time intervals are clocked
1:0 by the internal LFRO clock. Reset clears TIMOUT bit.
TIMOUT 00 SYNC word is continuously searched — no timeout.
[1:0] 01 SYNC search time set to nominal 8 milliseconds.
10 SYNC search time set to nominal 24 milliseconds.
11 SYNC search time set to nominal 48 milliseconds.
FXTH870xD
Sensors
104 Freescale Semiconductor, Inc.
12.17.5 LFR Status Register (LFS, LPAGE = 0)
LFS contains the data ready status flags. It is only accessible when the LPAGE bit is clear.
Field Description
LF Data Ready Flag — This read-only status flag is set when a complete byte of data has been received by the LFR. An interrupt
is sent to the MCU if the LFDRIE bit is set. Clear LFDRF by writing a one to the LFIAK bit or reading the LFDATA register. LFDRF
7
is also cleared by reset.
LFDRF
0 No new data in LFDATA register.
1 A new byte of data has been received and can be read from the LFDATA register.
LF Receive Error Flag — In data receive mode, this read-only status flag is set when a non-standard bit time is detected in the
Manchester data mode. Any received data bits before the error occurs are placed in the data buffer. In carrier detect mode, this
6 read-only status flag is not used and remains clear. An interrupt is sent to the MCU if the LFERIE bit is set. Clear LFERF by
LFERF writing a one to the LFIAK bit. LFERF is also cleared by reset.
0 Normal operation.
1 Error detected in the Manchester data mode.
LF Carrier Pulse Detect Flag — In carrier detect mode, this read-only status flag is set when the number of consecutive carrier
validations set by the LFCC bits in is reached. Note that the LFCC function is not working if TOGMOD = 1. Clear LFCDF by writing
5
a one to the LFIAK bit. LFCDF is also cleared by reset.
LFCDF
0 Normal operation.
1 Carrier detection has occurred.
LF ID Detect Flag — In data receive mode, this read-only status flag is set when the received ID matches the stored value. This
interrupt can be generated even if no data bits follow the ID. An interrupt is sent to the MCU if the LFIDIE bit is set. Clear LFIDF
4
by writing a one to the LFIAK bit. LFIDF is also cleared by reset.
LFIDF
0 Normal operation.
1 wakeup ID has been detected.
LF Receive Data Overflow Flag — In data receive mode, this read-only status flag is set when a complete byte of data has
been received and written into the LFDATA register, but the previously received byte was not read from LFDATA register yet.
This indicates that the MCU has lost the previously received data byte. In carrier detect mode, this read-only status flag is not
3
used and remains cleared. No separate interrupt is generated by this specific flag bit because the LFDRF flag would serve that
LFOVF purpose. Clear LFOVF by writing a one to the LFIAK bit. LFOVF is also cleared by reset.
0 Normal operation.
1 Previous data over-written before MCU read it.
LF Receive Data EOM Flag — In data receive mode, this read-only status flag is set when a complete byte of data has been
received and written into the LFDATA register and an end-of-message Manchester encoding error occurs. In carrier detect mode,
2 this read-only status flag is not used and remains clear. No interrupt is generated by this flag bit because the LFERF flag would
LFEOMF serve that purpose. Clear LFEOMF by writing a one to the LFIAK bit. LFEOMF is also cleared by reset.
0 No EOM detected.
1 EOM detected.
Low Power Sniff Mode — This bit used to activate the low power consumption during SNIFF mode. It saves approximately 1
1 A with a trade-off of an additional 200 s in transition from carrier to data mode. LPSM is set by reset.
LPSM 0 Low time transition from carrier to data mode
1 Low consumption during sniff mode
LF Interrupt Acknowledge — Writing a one to the LFIAK bit clears the LFDRF, LFERF, LFCDF, LFIDF, LFOVF and LFEOMF
flag bits. When a one is written to the LFIAK, it is automatically cleared at the next positive edge of the MCU bus clock. Then,
0 reading the LFIAK bit is allowed but will always return zero. Writing a zero the LFIAK bit has no effect. Reset has no effect on
LFIAK this bit.
0 No effect.
1 Clears the LFDRF, LFERF, LFCDF, LFIDF, LFOVF and LFEOMF flag bits.
FXTH870xD
Sensors
Freescale Semiconductor, Inc. 105
12.17.6 LFR Data Register (LFDATA, LPAGE = 0)
The LFDATA is a read-only register that contains the most recent received data value. It is only accessible when the LPAGE bit
is clear. As data is serially received by the LFR, it is assembled into 8-bit values. When a new complete 8-bit value is received,
it is moved into the LFDATA register, over-writing any previous value, and the LFDRF data ready flag is set to indicate a value is
available for the MCU to read. If a previous value was ready but was not read out of the LFDATA register before a new data byte
is ready, the LFOVF overflow flag is also set to indicate this overflow condition. Writes to LFDATA have no meaning or effect.
Field Description
7:0
Receive Data [7:0] — This is the received data from the LFR when in the data mode. All bits are read-only and any writes to
RXDATA
these bits will be ignored. Reading this register will clear the LFDRF.
[7:0]
Field Description
ID[15:0] ID bits 15 through 0 — These read/write bits contain bits 15 through 0 of the 16-bit ID value.
FXTH870xD
Sensors
106 Freescale Semiconductor, Inc.
12.17.7.1 LF Control E - LFCTRLE
Field Description
7-3
Reserved bits — Not for user access.
Reserved
LOGAMP AZ Sequencer Control — Control bits for AZ and trim within the LOGAMP.
X00 Nominal AZ sequence - recommended setting
X01 Short amp output release, max delay with Rects
2-0
X10 Short amp output release, max delay with Amp input
AZSC
X11 All short, max delay with end of AZ
0XX Nominal sensitivity trim - recommended setting
1XX Sensitivities shifted by - 4 trim steps
Field Description
SUM AZ release delay — Control the delay between falling edge of SUM d_az_en input and falling edge of internal AZ control
line.
7-6
00 No delay
AVFOF
01 No delay
[1:0]
10 One-half of 125 kHz clock period delay - recommended setting
11 One and one-half of 125 kHz clock periods delay
DeQing status register — This read-only status bit allows the reading of the effective activation of the DeQing System.
5
0 DeQing system not activated
DEQS
1 DeQing system activated
AZ Digital Control of AZ triggering — In data receive mode, this bits control the triggering of AZ sequence with respect to both
LFCPTAZ value (ref. LFCTRLB register) and the state of the demodulation input data state.
4-3 00 AZ starts after LFCPTAZ numbers of input data edges.
AZDC 01 Z starts randomly adding -1, 0 or 1 to LFCPTAZ value between each AZ.
[1:0] 10 AZ starts after LFCPTAZ numbers of input data edges and when the input data (d_data) state is 0.
11 AZ starts after LFCPTAZ numbers of input data edges and when the input data (d_data) state is 1 -
recommended setting.
ON Behavior Mode — This read/write bit selects how an error will affect the ON time. This bit is cleared by reset.
2
0 Any error will stop the ON time.
ONMODE
1 If remaining ON time, the LFR will go back to sniff mode at any error - recommended setting.
FXTH870xD
Sensors
Freescale Semiconductor, Inc. 107
Table 67. LFCTRLD Register Field Descriptions (continued)
Field Description
Accurate 125 kHz Check — The bit controls the CARVAL frequency check method.
00 CARVAL validates on n (2*32 s packets), n depending on LFCDTM value - recommended setting for Low
Sensitivity mode.
1-0
01 CARVAL validates on n (1*32 s packet + 4*8 s packets), n depending on LFCDTM value - optional recommended
CHK125
setting for High Sensitivity mode.
[1:0]
10 CARVAL validates n (8*8 s packet), n depending on LFCDTM value - optional recommended
setting for High Sensitivity mode.
11 Same as 00.
NOTE
Setting CHK125[1:0] to either 0x01 or 0x10 increases the immunity to noise and therefore
carries the side effect of narrowing the 125 kHz carrier bandwidth tolerance.
Field Description
3rd Amplifier gain — These bits controls the 3rd amplifier gain.
7-6 00 Gain of 2 - recommended setting
AMPGAIN 01 Gain of 3
[1:0] 10 Gain of 4
11 Gain of 6
Final stage select — These bits select the final stage of the LOGAMP.
5-4 00 Continuous time biasing - Fixed Gain 6
FINSEL 01 Continuous time biasing - Programmable Gain - recommended setting
[1:0] 10 4th rectifier disabled
11 4th rectifier disabled
Data AZ enable — This bit allows the AZ sequence during data frame.
3
0 AZ during data disabled
AZEN
1 AZ during data enabled - recommended setting
DeQing Resistor — These bits select the resistor added in parallel to the input network.
2-1 00 4 k
LOWQ 01 2 k
[1:0] 10 1 k
11 500
DeQing System enable — The bit controls the DeQing system.
0
0 DeQing disabled.
DEQEN
1 DeQing enabled.
FXTH870xD
Sensors
108 Freescale Semiconductor, Inc.
12.17.10 LFR Control Register B (LFCTRLB, LPAGE = 1)
The LFCTRLB register contains control bits for the LF detector and decoder. It is only accessible when the LPAGE bit is set.
Field Description
Control slicer hysteresis
7-6 00 20 mV hysteresis
HYST 01 40 mV hysteresis
[1:0] 10 50 mV hysteresis
11 30 mV hysteresis - recommended setting
Average filter bi-phase filtering control — Activates bi-phase filtering and control offset value
5-4 00 Standard low pass filtering activated - recommended setting
LFFAF; 01 Standard low pass filtering activated
LFCAF 10 Bi-phase filtering activated - Low offset from input signal low level
11 Bi-phase filtering activated - High offset from input signal low level
LF Manchester Polarity Select — This read/write bit selects the polarity of the transition in the middle of the bit time. The LFPOL
3 is not used in Carrier mode. Reset clears LFPOL bit.
LFPOL 0 Zero is falling edge in middle of a bit time, one is a rising edge in the middle of bit time.
1 Zero is rising edge in middle of a bit time, one is a falling edge in the middle of bit time.
2-0
LF auto-zero counter — Applications to set these bits to 0x06 for proper LF operation. These bits tune the minimum number of
LFCPTAZ
data edges between two auto-zero requests during a data frame.
[2:0]
FXTH870xD
Sensors
Freescale Semiconductor, Inc. 109
12.17.11 LFR Control Register A (LFCTRLA, LPAGE = 1)
The LFCTRLA register contains control bits for the LF detector and factory test selects. It is only accessible when the LPAGE bit
is set.
Field Description
7-4
Reserved bits — Not for user access.
Reserved
LF Successive Carrier Validations Counter — The value of the LFCC[3:0] bits define how many times the carrier detect
sample ON time detected an LF carrier signal before the LFCDF flag bit set. The flag will be risen when the number of ON
samples with a detected carrier greater than the LFCDTM[3:0] reaches the value of the LFCC[3:0] bits plus one. The internal
3-0 count of detected carrier pulses will increment the count as long as they are consecutive samples. When a sample is encountered
LFCC without any detected carrier the count will be reset.
[3:0] The LFCC register is considered reset in data mode. The first carrier validation will lead to start up of the receiver chain.
This feature allows the user to define a number of consecutive carrier detections are required before the flag is risen; and is useful
in detecting long duration carrier pulses.
This counter is disabled if TOGMOD = 1.
FXTH870xD
Sensors
110 Freescale Semiconductor, Inc.
13 RF Module
It is not intended that the RFM may be actively powered up and/or transmitting RF data while physical parameter measurements
are being made; or during the time that the LFR may be actively receiving/decoding LF signals. The resulting interactions will
degrade the performance of the RF output spectrum.
The FXTH870xD consists of an RF module (RFM) with external crystal-driven oscillator, VCO, fractal-n PLL and RF output
amplifier (PA) for an antenna. It also contains a small state machine controller, random time generator and hardware data buffer
for automated output or direct control from the MCU. The overall block diagram is shown in Figure 89.
256-BIT
DATA BUFFER
RF LFSR MODULATION RF
RINT
STATE RANDOM CONTROL
MFO MACHINE GEN
RF
AMP
MCU CONTROL
REGISTERS
AND LOGIC
DX
500 kHz
FRACTIONAL-N
DIVIDER
XI
CRYSTAL PHASE LOW-PASS
VCO
OSCILLATOR DETECTOR FILTER
XO
RF
LVD
AVDD VOLT RF
REG AVDD
AVSS
VREG
FXTH870xD
Sensors
Freescale Semiconductor, Inc. 111
The external crystal connected to the X0 and XI pins provides the carrier frequency as well as the data rate clock needed for the
data rates associated with the OOK or FSK modulation. Therefore the tolerance on the data rate will depend on the
characteristics of the external crystal.
Once the data buffer is emptied the data transfer stops; the RF output stage is turned off; and the SEND control bit is cleared and
an interrupt of the MCU may be generated to wake it from the STOP1 mode. The user can test that the transmission has
completed by reading back the state of the SEND control bit or the RFIF status bit.
There is also the option to send the same data frame from 1 to 16 times with interlaced time intervals when the RF transmitter
PA output stage is off. If multiple frames of data are to be transmitted within a datagram the spacing before the first frame and
between subsequent frames can be controlled by the RFM state machine in several ways:
1. Use of a programmable timer (random, base time, time adder).
2. No time delays.
In addition, the RFM crystal oscillator, VCO and PLL can be turned off during any interframe timing by use of the IFPD bit.
When using the data buffer mode the user’s software should not change any bits in the RFM registers after the SEND has been
set and the transmission is still in progress. Changing RFM register contents during a transmission can lead to data faults or
errors.
FXTH870xD
Sensors
112 Freescale Semiconductor, Inc.
256 2
EOM
Maximum RFB0 RFB1 RFB2 RFB3 RFB4 RFB5 RFBA RFBB RFBC RFBD RFBE RFBF
258-Bit Format
80
RFB0 RFB1 RFB2 RFB3 RFB4 RFB5 RFB6 RFB7 RFB8 RFB9
80-Bit Format
53 2
EOM
53-Bit Format RFB0 RFB1 RFB2 RFB3 RFB4 RFB5 Optional EOM
with all byte lengths
RFB6
Bits [2:0]
2
Minimum
2-Bit Format
Data in each byte defined by user software
RFB0
Bits [1:0]
FXTH870xD
Sensors
Freescale Semiconductor, Inc. 113
13.3 Transmission Randomization
When there are two or more different transmitters, the clock rates of each may drift into synchronism with each other; and there
is the possibility of RF data collisions and the loss of data from both transmitters. In order to reduce possible RF data collisions
each transmission will contain from 1 to 16 frames of data. Each frame may be spaced at after the initially timed transmission
start time and between any two data frames as shown in Figure 91.
t0
Start of Time
Interval for
Datagram Interframe Intervals
Initial Interval
tDATA
Start of Time
Interval for
Datagram
tBASE, tRAND and tFN may be all zero in the initial interval.
tBASE, tRAND and tFN may be all zero in an interframe interval.
All interframe intervals may have different tBASE, tRAND and tFN times.
Note: If tBASE and tFN are both set to non-zero, and tRAND is set to 0, the system
will decrement both tBASE and tFN simultaneously rather than serially, such that the
effective Interframe Interval will be equal to the larger of tBASE or tFN settings.
FXTH870xD
Sensors
114 Freescale Semiconductor, Inc.
13.3.1 Initial Time Interval
When generating an initial time interval the MCU loads the RFM interval generator variables and then goes into the STOP1 mode.
When the initial time interval ends the data in the RFM data buffer is automatically sent and the MCU will wake at the end of the
transmission. The initial time interval is made up of two components:
t = t + 40 t Eqn. 10
INIT BASE RAND
where:
tINIT = Total time interval before first frame is transmitted in ms
tBASE = Base time in ms; 5 ms not recommended
tRAND = Pseudo-random time in ms based on a Galois 7-bit LFSR
The components of this time are described in the following sections.
t = t +t +t Eqn. 11
IFRM BASE RAND FN
where:
tIFRM = Total time interval between each transmitted frame in ms
tBASE = Base time in ms; 5 ms not recommended
tFN = Time adder in ms for frame number
tRAND = Pseudo-random time in ms based on a Galois 7-bit LFSR
The components of this time are described in the following sections.
FXTH870xD
Sensors
Freescale Semiconductor, Inc. 115
7-BIT Random Number
S0 S1 S2 S3 S4 S5 S6
S
D Q D Q D Q D Q D Q D Q D Q
R R R R R R
CLK
RFMRST
7 3
Galois Primitive Polynomial = X + X + 1
1 40 37.2 42.8
Initial
127 5080 4347.2 5434.6
1 1 0.93 1.07
Interframe
127 127 118.1 135.9
Value of Number of Frame Interval Where Nominal Frame Number Time Interval Added (ms)
FNUM[3:0] Frames Time Added Minimum Maximum
0 1 None n/a n/a
1 2 1-2 1 63
2 3 2-3 2 126
3 4 3-4 3 189
4 5 4-5 4 252
5 6 5-6 5 315
6 7 6-7 6 378
7 8 7-8 7 441
8 9 8-9 8 504
FXTH870xD
Sensors
116 Freescale Semiconductor, Inc.
Table 72. Frame Number Interval Times (continued)
Value of Number of Frame Interval Where Nominal Frame Number Time Interval Added (ms)
FNUM[3:0] Frames Time Added Minimum Maximum
9 10 9 - 10 9 567
10 11 10 - 11 10 630
11 12 11 - 12 11 693
12 13 12 - 13 12 756
13 14 13 - 14 13 819
14 15 14 - 15 14 882
15 16 15 - 16 15 945
FXTH870xD
Sensors
Freescale Semiconductor, Inc. 117
LOW HIGH
BIT BIT
FSK = fRF+ f OOK = fRF
Consecutive “0”
Data Bits
Consecutive “1”
Data Bits
“001101”
Data Bits
LOW HIGH
BIT BIT
FSK = fRF+ f OOK = fRF
Consecutive “0”
Data Bits
Consecutive “1”
Data Bits
“001101”
Data Bits
FXTH870xD
Sensors
118 Freescale Semiconductor, Inc.
LOW LOW HIGH HIGH
BIT BIT BIT BIT
FSK = fRF+ f OOK = fRF
FSK = fRF - f OOK = OFF
Consecutive “0”
Data Bits
Consecutive “1”
Data Bits
“001101”
Data Bits
Consecutive “0”
Data Bits
Consecutive “1”
Data Bits
“001101”
Data Bits
FXTH870xD
Sensors
Freescale Semiconductor, Inc. 119
13.6.2 Carrier Frequency
The carrier frequency is established mainly by the external crystal used, but a centering of the fractional-n PLL provides more
precise control. If the CF control bit is clear the PLL will be configured for a carrier center frequency of the 315 MHz. If the CF
control bit is set the PLL will be configured for a carrier center frequency of the 434 MHz.
13.7 RF Interrupt
The RFM will interrupt the MCU when the SEND bit is cleared at the end of a data buffer transmission. This interrupt occurs at
the end of a programmed set of frames. If the number of frame count FNUM[3:0] is set to zero, then only one frame is sent and
the interrupt occurs at the end of that first frame transmitted. If the number of the frame count is greater than zero, then the
interrupt will be generated depending on the state of the IFID bit.
The interrupt will also create a flag bit, RFIF, which can be cleared by writing a logical one to the RFIAK bit. The interrupt can be
enabled/disabled by the RFIEN bit.
FXTH870xD
Sensors
120 Freescale Semiconductor, Inc.
13.9 RFM Registers
The RFM contains twelve registers to control its functions and 32 registers to provide access to the output data buffer.
Field Description
Data Rate - The BPS[7:0] control bits select the data rate for the transmitted datagrams as described by the following equation:
f 5
XTAL 5x10
f = ------------------------------------- = -------------------------
7–0
DATA 52 BPS + 1 BPS + 1
BPS[7:0] where:
fDATA= Data rate in bits/second
fXTAL= External crystal frequency in Hz = 26 MHz
BPS= Value of data rate code (BPS[7:0])
Examples of the value for common data rates are given in Table 74. The BPS[7:0] control bits are set to $34 by the RFMRST
signal which results in a default data rate of 9600 bits/sec.
The BPS[7:0] bits are set to $34 by an RFMRST signal which results in a default data rate of approximately 9600 bps.
FXTH870xD
Sensors
Freescale Semiconductor, Inc. 121
Table 75. RFCR1 Field Descriptions
Field Description
Frame Bit Length - The FRM[7:0] control bits select the number of bits in each datagram. The number of bits is determined by
7-0
the binary value of the FRM[7:0] bits plus one. This makes the range of bits from 2 to 256. A value of $00 for the FRM[7:0] control
FRM[7:0]
bits will result in no frames being sent. The FRM[7:0] control bits are cleared by RFMRST signal.
Field Description
Transmission Start Control- The SEND control bit starts the transmission of data held in the RFM data buffer according to the
bit length specified by the FRM[7:0] bits. The SEND control bit is automatically cleared when the data buffer transmission has
7
ended or by the RFMRST signal. A transmission can be prematurely interrupted by writing a logical zero to the SEND bit.
SEND
0 Data transmission ended or transmission not in progress.
1 Start data transmission or transmission in progress.
Buffer Page Select — The RPAGE bit will select the lower or upper 16 bytes of the RFM data buffer when writing/reading to the
RFD0-RD15 registers. This bit also selects between the lower and upper banks of RFM registers at addresses $0038 through
6
$003B. This bit is cleared by a reset of the MCU.
RPAGE
0 Select the lower 16 bytes of the RFM data buffer.
1 Select the upper 16 bytes of the RFM data buffer.
End Of Message - The EOM control bit selects whether there will be two data bit times of data 1 carrier state at the end of each
5 datagram. The EOM control bit is cleared by a RFMRST.
EOM 0 EOM bit times not added.
1 EOM bit times added.
FXTH870xD
Sensors
122 Freescale Semiconductor, Inc.
Table 76. RFCR2 Field Descriptions (continued)
Field Description
RF Amplifier Power Level - The PWR[4:0] control bits select the optimum power output of the RF power amplifier. These power
output levels assume optimal matching network to the RF pin. The PWR[4:0] control bits are cleared a RFM reset. The PWR
control bits are initially set to 0x00. This setting targets -10 dBm typical power output. The PWR control bits scale the typical
output power level from -1.5 to 8 dBm in steps of 0.5 dB and fixes the low power level mode to -10 dBm, The power control range
is defined as follows:
00000 set output power level to -10 dBm (Default Value)
00001 set output power level to -1.5 dBm
00010 set output power level to -1.0 dBm
00011 set output power level to -0.5 dBm
00100 set output power level to 0.0 dBm
00101 set output power level to 0.5 dBm
00110 set output power level to 1.0 dBm
00111 set output power level to 1.5 dBm
4:0 01000 set output power level to 2.0 dBm
PWR[4:0] 01001 set output power level to 2.5 dBm
01010 set output power level to 3.0 dBm
01011 set output power level to 3.5 dBm
01100 set output power level to 4.0 dBm
01101 set output power level to 4.5 dBm
01110 set output power level to 5.0 dBm
01111 set output power level to 5.5 dBm
10000 set output power level to 6.0 dBm
10001 set output power level to 6.5 dBm
10010 set output power level to 7.0 dBm
10011 set output power level to 7.5 dBm
10100 set output power level to 8.0 dBm
Codes greater than 10100 are reserved for test purposes and should not be used.
FXTH870xD
Sensors
Freescale Semiconductor, Inc. 123
13.11.1 Power Working Domains
The working areas of the RF transmitter are divided into several domains as defined in Figure 101.
PTYP
TA = 25 °C to 60 °C and VDD = 2.5 V to 3.6 V
PTYP is where the power step is adjusted to guarantee 5 dBm. The power consumption in this domain is specified at 5 dBm output
power step at nominal conditions of TA = 25 °C and VDD = 3 VDC.
PMIN
PMIN is where the power step is adjusted to guarantee a minimum of 3 dBm as shown in Figure 101. The power consumption in
this domain is given as the maximum consumption at whatever temperature of supply voltage condition. The PMIN domain is
subdivided into two areas according to the lowest supply voltage encountered (1.8 or 2.5 VDC).
PMIN_COLD
TA = -40 °C to 0 °C and VDD = 1.8 V to 3.6 V
PMIN_HOT
TA = 0 °C to 25 °C and VDD = 2.5 V to 3.6 V
TA = 60 °C to 125 °C and VDD = 2.5 V to 3.6 V
Typical Consumption
VDD = 3.6 V
VDD = 3.0 V
PTYP
PMIN_COLD PMIN_HOT PMIN_HOT
VDD = 2.5 V
VDD = 1.8 V
TA = -40 °C TA = 0 °C TA = 25 °C TA = 60 °C TA = 125°C
FXTH870xD
Sensors
124 Freescale Semiconductor, Inc.
13.12 RFM Control Register 3 - RFCR3
The RFCR3 register contains five control bits for the RFM as described in Figure 102 which sets the number of frames in each
RF datagram.
Field Description
Data State - The DATA bit determines the output state of the RF power amplifier when the RFM is in the MCU direct control mode
7 (CODE[1:0] = 11)
DATA 0 RF output state low.
1 RF output state high.
Interframe Power Down — The IFPD control bit selects whether the XCO and associated analog blocks are powered down
during interframe timing caused by the RFM. The IFPD control bit is cleared by the RFMRST signal.
6 0 The XCO remains powered up as long as the SEND bit is set.
IFPD 1 The XCO is powered down during RFM controlled interframe timing events.
The restart of these functions will start 1 ms before the end of the timing interval if another
frame is to be transmitted.
Initial Random Space— When the ISPC bit is set the initial time delay before the first frame will be enabled. This bit is cleared
5 by an RFM reset.
ISPC 0 No initial time interval.
1 Initial time interval enabled.
Interframe Interrupt Delay — The IFID control bit selects whether the RFIF bit is set and the MCU is interrupted at the end of
each frame sent or at the end of the last frame in a multiple frame message. The IFID control bit is cleared by the RFMRST signal.
4
0 The RFIF bit is set and the MCU interrupted if the RFIEN bit is set, after the last frame transmitted.
IFID
1 The RFIF bit is set and the MCU interrupted if the RFIEN bit is set, only after the last frame
plus an additional interframe message is transmitted.
3-0 FNUM[3:0] — The FNUM[3:0] bits set the number of frames transmitted in each RF datagram. The frames will be randomly
FNUM spaced apart as described it Section 13.3.These bits are cleared by an RFM reset. The number of frame transmitted is the binary
[3:0] number plus one.
FXTH870xD
Sensors
Freescale Semiconductor, Inc. 125
13.13 RFM Control Register 4 - RFCR4
The RFCR4 register contains eight control bits to set the initial and interframe timing base timing variable as described in
Figure 103. A RFMRST signal clears the RFBT[7:0] bits.
Field Description
7:0 Base Timer - The RFBT[7:0] control bits select the interframe timing between multiple frames of transmission. The base time
RFBT value is equal to a nominal one millisecond for each count of the RFBT[7:0] bits. The RFBT[7:0] control bits are cleared by the
[7:0] RFMRST signal and must be set to either 0 or between 5 and 255.
Field Description
BOOST - This bit controls the VCO power consumption in order to decrease the phase noise required by the Japanese
7 regulation. The BOOST control bit is cleared by the RFMRST signal.
BOOST 0 The VCO runs at its lower power consumption level (higher phase noise).
1 The VCO runs at its higher power consumption level (lower phase noise).
Pseudo-Random Timer- The LFSR[6:0] bits select the current seed value of the LFSR when enabling pseudo-random timing
intervals when any of the LFSR[6:0] bits are set. The value written to this register is loaded into the actual LFSR when the SEND
bit is set. The time value is equal to a nominal one millisecond for each count of the resulting LFSR[6:0] bits.
6:0 A value of $00 placed in the LFSR causes the LFSR to stay at the $00 state on each clocking of the LFSR. To cause the LFSR
LFSR[6:0] to cycle through its pseudo-random number sequence requires that any value other than $00 be written to the LFSR[6:0] bits.
Note: If RFBT[7:0] and RFFT[5:0] are both set to non-zero, and LFSR[6:0] is set to 0x00, the system will decrement both RFBT
and RFFT simultaneously rather than serially, such that the effective Interframe Interval will be equal to the larger of RFBT or
RFFT settings.
FXTH870xD
Sensors
126 Freescale Semiconductor, Inc.
13.15 RFM Control Register 6 - RFCR6
The RFCR6 register contains eight control bits to set the initial and interframe frame number timing variable as described in
Figure 105. A RFMRST signal clears the RFFT[5:0] bits.
Field Description
7:6
VCO Gain Selection - These bits control the VCO gain. The VCO_GAIN[1] bit is set and the VCO_GAIN[0] bit is cleared by the
VCO_GAIN
RFMRST signal. Not normally need to be adjusted by the end user.
[1:0]
Frame Number Timer - The RFFT[5:0] control bits select the interframe timing between multiple frames of transmission. The
5:0
time value is equal to a nominal one millisecond for each count of the RFFT[5:0] bits multiplied by the frame number of the last
RFFT[5:0]
transmitted frame. The RFFT[5:0] control bits are cleared by the RFMRST signal.
Field Description
RF Interrupt Flag— The read-only RFIF status bit indicates if the RF transmission has ended properly when using the data buffer
mode and the SEND bit has been cleared. Writes to this bit will be ignored. The RFIF status bit is cleared by writing a logical one
7
to the RFIAK bit or the RFMRST bit. RFMRST signal clears this bit.
RFIF
0 RF transmission in progress or not in the data buffer mode.
1 RF transmission completed in the data buffer mode.
RF Transmission Error Flag— The read-only RFEF status bit indicates if there was an error in the current or prior RF
transmission as described in Section 13.6.4. Writes to this bit will be ignored. The RFEF status bit is cleared by writing a logical
6
one to the RFIAK bit or the RFMRST bit. RFMRST signal clears this bit.
RFEF
0 No RF transmission error occurred.
1 RF transmission error occurred.
RF LVD Trigger Flag— When the RF LVD is enabled and the supply voltage falls below the threshold, the read-only RFVF flag
will be set if the RFLVDEN bit is set. Writes to this bit will be ignored. The RFVF status bit is cleared by writing a logical one to
5
the RFIAK bit or the RFMRST bit. RFMRST signal clears this bit
RFVF
0 Voltage is and has been above RF LVD rising threshold or the RF LVD is disabled.
1 Voltage has dropped below the RF LVD falling threshold since last reset of this bit.
Acknowledge RF Interrupt Flags— Writing a one to the RFIAK bit clears the RFIF, RFEF and RFVF flag bits. Writing a zero to
4 the RFIAK bit has no effect on the RFIF, RFEF and RFVF flag bits. The RFMRST signal has no effect on this bit.
RFIAK 0 No effect.
1 Clear the RFIF, RFEF, and RFVF bits.
FXTH870xD
Sensors
Freescale Semiconductor, Inc. 127
Table 81. RFCR7 Field Descriptions (continued)
Field Description
RF Interrupt Enable— The RFIEN bit enables the RFIF, the RFEF and the RFVF bits to generate an interrupt to the MCU. The
3 RFMRST signal clears this bit.
RFIEN 0 RF interrupts disabled.
1 RF interrupts enabled.
RF LVD Enable — When the RFLVDEN bit is set, the RF LVD circuit will be enabled, and the RF LVD events are routed to the
2 RF LVD Trigger Flag. This bit is cleared by the RFMRST signal.
RFLVDEN 0 RF LVD disabled.
1 RF LVD enabled.
RF Clear To Send Status— When the RCTS bit is set the RF XCO, VCO and PLL have started and locked and the RFM is ready
1 to send data. This bit is cleared by the RFMRST signal.
RCTS 0 RFM not ready to send.
1 RFM ready to send.
RFM Reset — Writing a one to the RFMRST bit will completely reset the RFM and its registers. This bit is not affected by a reset
0 of the MCU. This bit will always read as a zero.
RFMRST 0 No effect.
1 Reset RFM.
Field Description
PLL Divider Ratio A- The AFREQ[12:0] control bits select the PLL divider ratio for a data zero in the FSK mode of modulation
PLLCR0
as described by the following equation:
7:0
where:
12 + 4 CF + ---------------------
AFREQ AFREQ
f = f
12:5 DATA0 XTAL 8192
fDATA0 = RF Carrier frequency for a data zero in MHz
PLLCR1
fXTAL = External crystal frequency in MHz, 26 MHz
7:3
CF = State of the CF carrier select bit
AFREQ
AFREQ = Decimal value of the AFREQ[12:0] binary weighted bits
4:0
The AFREQ[12:0] control bits are cleared by the RFMRST signal. 1 LSB of AFREQ[12:0] = 3.17 kHz.
Data Polarity - The POL control bit selects the polarity of the data encoding selected by the CODE[1:0] bits. The POL control bit
is cleared by the RFMRST signal.
2 0 NRZ and MCU direct DATA bit data non-inverted and Manchester encoding polarity
POL as in Figure 95 and Bi-Phase encoding polarity as in Figure 97.
1 NRZ and MCU direct DATA bit data inverted and Manchester encoding polarity
as in Figure 94 and Bi-Phase encoding polarity as in Figure 96.
FXTH870xD
Sensors
128 Freescale Semiconductor, Inc.
Table 82. PLLCR[1:0] Field Descriptions (continued)
Field Description
Data Encoding and Source- The CODE[1:0] control bits select the type of data encoding and source of data for the RF output.
The CODE[1:0] control bits are cleared by the RFMRST signal.
1:0
00 Manchester encoded data from the RFM data buffer.
CODE
01 Bi-Phase encoded data from the RFM data buffer.
[1:0]
10 NRZ direct data from the RFM data buffer (can be mixed NRZ and Manchester at 2X the data rate).
11 MCU direct mode with RF output driven by the state of the DATA bit.
Field Description
PLL Divider Ratio B- The BFREQ[12:0] control bits select the PLL divider ratio for a data one in either the OOK or FSK modes
of modulation as described by the following equation:
PLLCR2
7:0
BFREQ
12 + 4 CF + --------------------
BFREQ
12:5 f = f
DATA1 XTAL 8192
PLLCR3 where:
7:3 fCARRIER = RF Carrier frequency in MHz
BFREQ fXTAL = External crystal frequency in MHz
4:0 CF = State of the CF carrier select bit
BFREQ = Decimal value of the BFREQ[12:0] binary weighted bits
The BFREQ[12:0] control bits are cleared by the RFMRST signal. 1 LSB of BFREQ[12:0] = 3.17 kHz.
Carrier Frequency - The CF control bit selects the optimal VCO setup and correct divider for the 500 kHz reference clock to the
MCU on DX based on the external crystals required for the desired carrier frequency. The CF control bit is cleared by the
2
RFMRST signal.
CF
0 Configured for 315 MHz, 12.1154 PLL divider using a 26.000 MHz external crystal.
1 Configured for 434 MHz, 16.6923 PLL divider using a 26.000 MHz external crystal.
RF Modulation Method - The MOD control bit selects the method of modulating the RF. The MOD control bit is cleared by the
1 RFMRST signal.
MOD 0 Configured for OOK.
1 Configured for FSK.
Generated Clock Reference - Generates the DX signal to the TPM1 module for determining the other
0 clock frequencies:
CKREF 0 DX signal not generated.
1 DX 500 kHz signal connected to the TPM1 module.
FXTH870xD
Sensors
Freescale Semiconductor, Inc. 129
13.19 EPR Register - EPR (RPAGE = 1)
The EPR register contains eight control bits for the RFM as described in Figure 109. The function of the upper 4 bits depends on
the state of the VCD_EN bit.
Field Description
7
Reserved bit — Not for user access if the VCD_EN bit is clear.
Reserved
6-4 Low Pass Filter Selection - These read/write bits select the PLL low pass filter. A reset sets these bits to $03. These bits
PLL_LPF_[2:0] are only accessible if the VCD_EN bit is clear.
VCO Calibration Count Difference - These read-only bits show the count difference from “ideal” when the VCO calibration
7-4
machine is finished (see Section 13.21). These bits are only accessible when the VCD_EN bit is set. Writing to these bits
VCD[3:0]
when the VCD_EN bit is set has no effect. The reset state is undefined.
3-2
Reserved bits — Not for user access.
Reserved
1 PA Output Slope Selection — This read/write bit controls the output slope of the RFM PA output. This bit is set by the
PA_SLOPE RFMRST signal.
VCD Enable bit — This bit allows access to the VCD[3:0] bits. This bit is cleared by the RFMRST signal.
0
0 PLL_LPF_[2:0] bits accessed.
VCD_EN
1 VCD[3:0] bits accessed.
FXTH870xD
Sensors
130 Freescale Semiconductor, Inc.
13.20 RF DATA Registers - RFD[31:0]
The RFD registers contain 256 read/write bits for the RFM to use when outputting data as described in Section 13.2. The 256-
bit buffer is divided into two pages of 128 bits as selected by the RPAGE bit in the RFCR2. These as described in Figure 111.
These bits are unaffected by any reset.
The data buffer is unloaded to the RF output starting with the least significant bit (RFD0) in the least significant byte (RFB0) up
through the most significant bit (RFD255) in the most significant byte (RFB31). This is often referred to as “little-endian” data
ordering. The output of this data by the RFM in all 256 bits locations is not dependent on the state of the RPAGE bit.
Bit 7 6 5 4 3 2 1 Bit 0
$003C RFD[7:0] for RPAGE = 0, RFD[135:128] for RPAGE = 1
$003D RFD[15:8] for RPAGE = 0, RFD[143:136] for RPAGE = 1
$003E RFD[23:16] for RPAGE = 0, RFD[151:144] for RPAGE = 1
$003F RFD[31:24] for RPAGE = 0, RFD[159:152] for RPAGE = 1
$0040 RFD[39:32] for RPAGE = 0, RFD[167:160] for RPAGE = 1
$0041 RFD[47:40] for RPAGE = 0, RFD[175:168] for RPAGE = 1
$0042 RFD[55:48] for RPAGE = 0, RFD[183:176] for RPAGE = 1
$0043 RFD[63:56] for RPAGE = 0, RFD[191:184] for RPAGE = 1
$0044 RFD[71:64] for RPAGE = 0, RFD[199:192] for RPAGE = 1
$0045 RFD[79:72] for RPAGE = 0, RFD[207:200] for RPAGE = 1
$0046 RFD[87:80] for RPAGE = 0, RFD[215:208] for RPAGE = 1
$0047 RFD[95:88] for RPAGE = 0, RFD[223:216] for RPAGE = 1
$0048 RFD[103:96] for RPAGE = 0, RFD[231:224] for RPAGE = 1
$0049 RFD[111:104] for RPAGE = 0, RFD[239:232] for RPAGE = 1
$004A RFD[119:112] for RPAGE = 0, RFD[247:240] for RPAGE = 1
$004B RFD[127:120] for RPAGE = 0, RFD[255:248] for RPAGE = 1
Field Description
RFD
15:0
RPAGE = 0 RF Data Registers Lower 128 bits - These are read/write bits that hold the lower 128 bits of possible data to be sent by the
RFM. Access to the lower 128 bits occurs when the RPAGE bit is clear. These bits are unaffected by any reset.
RFD
[127:0]
RFD
31:16
RPAGE = 1 RF Data Registers Upper 128 bits - These are read/write bits that hold the upper 128 bits of possible data to be sent by the
RFM. Access to the lower 128 bits occurs when the RPAGE bit is clear. These bits are unaffected by any reset.
RFD
[255:128]
FXTH870xD
Sensors
Freescale Semiconductor, Inc. 131
13.21 VCO Calibration Machine
The RFM incorporates a VCO calibration machine which works in conjunction with the VCO. The calibration machine selects the
optimal VCO sub-band with respect to a predefined reference voltage applied to the VCO.
• Calibration supports maxband VCO sub-bands. maxband corresponds to the band where the VCO frequency is maximum.
• A successive approximation algorithm is used to calculate the optimum sub-band.
• Fc, the Center Frequency (AFREQ+BFREQ)/2 is used as the reference frequency for the VCO calibration in FSK mode
(MOD = 1).
• BFREQ is used as the reference frequency for the VCO calibration in OOK mode (MOD = 0).
• Calibration occurs every time the VCO is enabled.
• The calibration takes approximately 5s.
The state machine of the calibration is shown in Figure 112.
Compare
VCOcount and Targetedcount
Difference=Difference/2
VCOcount<Targetedcount
VCOcount>Targetedcount
VCOcount=Targetedcount
NO
VCOband=VCOband-Difference VCOband=VCOband+Difference
Bestband=VCOband
VCOband=VCOband-Difference
Difference=1?
FXTH870xD
Sensors
132 Freescale Semiconductor, Inc.
14 Firmware
This section describes the software subroutines contained in the firmware section of the FLASH memory that the user can call
for various tasks and to reduce the software development time for the main internal operations.
Table 86. FXTH870x02 Single Z-axis Firmware Summary and Jump Table
FXTH870xD
Sensors
Freescale Semiconductor, Inc. 133
Table 86. FXTH870x02 Single Z-axis Firmware Summary and Jump Table (continued)
Table 87. FXTH870x11 Dual XZ-axis Firmware Summary and Jump Table
FXTH870xD
Sensors
134 Freescale Semiconductor, Inc.
Table 87. FXTH870x11 Dual XZ-axis Firmware Summary and Jump Table (continued)
FXTH870xD
Sensors
Freescale Semiconductor, Inc. 135
14.2.2 Device Identification
The bytes assigned to identify the device and its options are described below. This data can be read by use of the
TPMS_READ_ID routine.
Field Description
CODE0
7:0 Reserved for Freescale firmware description.
Reserved
CODE1 Revision number for the multiple-chip-module silicon.
7:5 000 - MCU version 0
ES 111 - MCU version 7
CODE1 Calibrated range for pressure. The range is a combination of this bit and the PRESS-L bit, below.
4 bit 0 = 0, bit 4 = 0 indicates a 100-450 kPa range
PRESS-H bit 0 = 0, bit 4 = 1 indicates a 100-900 kPa range
Type of accelerometer.
CODE1 00 - None
3:2 01 - One accelerometer with X-axis orientation
ACC 10 - One accelerometer with Z-axis orientation
11 - Two accelerometers with X- and Z-axis orientations
Special calibration for accelerometer.
CODE1
0 = standard -240 to +270 g Z-axis
1
1 = extended -270 to +400 g Z-axis
CODE1 Calibrated range for pressure. The range is a combination of this bit and the PRESS-H bit, above.
0 bit 0 = 0, bit 4 = 0 indicates a 100-450 kPa range
PRESS-L bit 0 = 0, bit 4 = 1 indicates a 100-900 kPa range
CODE2:4
7:0
28-bit serial number for each device. All numbers to be unique with numbering sequence being a sequential counter for each
CODE5
product type.
3:0
ID27:0
CODE5 4-bit number assigned to vendor type.
7:4 If these bits are unspecified as part of the complete FLASH programming by the customer, then these 4 bits are programmed
ID31:28 to binary 1 0 0 0.
FXTH870xD
Sensors
136 Freescale Semiconductor, Inc.
14.2.3 Definition of Signal Ranges
Each measured parameter (pressure, voltage, temperature, acceleration) results from an ADC10 conversion of an analog signal.
This ADC10 result may then be passed by the firmware to the application software as either the raw ADC10 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 113. In this definition the signal source would normally
output a signal between SINLO and SINHI. Due to process, temperature and voltage variations this signal may increase its range
to SINMIN to SINMAX. In all cases the signal will be between the supply rails, so that the ADC10 will convert it to a range of digital
numbers between 0 and 1023. These digital numbers will have corresponding DINMIN, DINLO, DINHI, DINMAX values. The ADC10
digital value is taken by the firmware and compensated and scaled to give the required output code range.
FORCE
OUTPUT
TO 511
SINMAX DINMAX
SINHI DINHI
NORMAL CASE
SINLO DINLO
SINMIN DINMIN
1
VDD 0 UNDERFLOW 0
CASE
FORCE
OUTPUT
TO ZERO
FXTH870xD
Sensors
Freescale Semiconductor, Inc. 137
Digital values between DINLO and DINHI 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.
FXTH870xD
Sensors
138 Freescale Semiconductor, Inc.
15 Development Support
15.1 Introduction
This chapter describes the single-wire BACKGROUND DEBUG mode (BDM), which uses the on-chip BACKGROUND DEBUG
controller (BDC) module.
15.1.1 Features
Features of the BDC module include:
• Single pin for mode selection and background communications
• BDC registers are not located in the memory map
• SYNC command to determine target communications rate
• Non-intrusive commands for memory access
• ACTIVE BACKGROUND mode commands for CPU register access
• GO and TRACE1 commands
• BACKGROUND command can wake CPU from STOP or WAIT modes
• One hardware address breakpoint built into BDC
• Oscillator runs in STOP mode, if BDC enabled
• COP watchdog disabled while in ACTIVE BACKGROUND mode
BKGD 1 2 GND
NO CONNECT 3 4 RESET
NO CONNECT 5 6 VDD
FXTH870xD
Sensors
Freescale Semiconductor, Inc. 139
15.2.1 BKGD/PTA4 Pin Description
BKGD/PTA4 is the single-wire BACKGROUND DEBUG interface pin. The primary function of this pin is for bidirectional serial
communication of ACTIVE BACKGROUND mode commands and data. During reset, this pin is used to select between starting
in ACTIVE BACKGROUND mode or starting the user’s application program. This pin is also used to request a timed sync
response pulse to allow a host development tool to determine the correct clock frequency for BACKGROUND DEBUG serial
communications.
BDC serial communications use a custom serial protocol first introduced on the M68HC12 Family of microcontrollers. This
protocol assumes the host knows the communication clock rate that is determined by the target BDC clock rate. All
communication is initiated and controlled by the host that drives a high-to-low edge to signal the beginning of each bit time.
Commands and data are sent most significant bit first (MSB first). For a detailed description of the communications protocol, refer
to Section 15.2.2.
If a host is attempting to communicate with a target MCU that has an unknown BDC clock rate, a SYNC command may be sent
to the target MCU to request a timed sync response signal from which the host can determine the correct communication speed.
BKGD/PTA4 is a pseudo-open-drain pin and there is an on-chip pullup so no external pullup resistor is required. Unlike typical
open-drain pins, the external RC time constant on this pin, which is influenced by external capacitance, plays almost no role in
signal rise time. The custom protocol provides for brief, actively driven speedup pulses to force rapid rise times on this pin without
risking harmful drive level conflicts. Refer to Section 15.2.2, for more detail.
When no debugger pod is connected to the 6-pin BDM interface connector, the internal pullup on BKGD/PTA4 chooses normal
operating mode. When a debug pod is connected to BKGD/PTA4 it is possible to force the MCU into ACTIVE BACKGROUND
mode after reset. The specific conditions for forcing ACTIVE BACKGROUND depend upon the HCS08 derivative (refer to the
introduction to this Development Support section). It is not necessary to reset the target MCU to communicate with it through the
BACKGROUND DEBUG interface.
FXTH870xD
Sensors
140 Freescale Semiconductor, Inc.
BDC CLOCK
(TARGET MCU)
HOST
TRANSMIT 1
HOST
TRANSMIT 0
10 CYCLES
EARLIEST START
OF NEXT BIT
SYNCHRONIZATION TARGET SENSES BIT LEVEL
UNCERTAINTY
PERCEIVED START
OF BIT TIME
BDC CLOCK
(TARGET MCU)
HOST DRIVE
TO BKGD/PTA4 PIN HIGH-IMPEDANCE
TARGET MCU
SPEEDUP PULSE
HIGH-IMPEDANCE HIGH-IMPEDANCE
PERCEIVED START
OF BIT TIME
R-C RISE
BKGD/PTA4 PIN
10 CYCLES
EARLIEST START
OF NEXT BIT
10 CYCLES
FXTH870xD
Sensors
Freescale Semiconductor, Inc. 141
BDC CLOCK
(TARGET MCU)
HOST DRIVE
TO BKGD/PTA4 PIN HIGH-IMPEDANCE
SPEEDUP
TARGET MCU PULSE
DRIVE AND
SPEED-UP PULSE
PERCEIVED START
OF BIT TIME
BKGD/PTA4 PIN
10 CYCLES
EARLIEST START
10 CYCLES OF NEXT BIT
FXTH870xD
Sensors
142 Freescale Semiconductor, Inc.
Table 90. BDC Command Summary
The SYNC command is unlike other BDC commands because the host does not necessarily know the correct communications
speed to use for BDC communications until after it has analyzed the response to the SYNC command.
To issue a SYNC command, the host:
• Drives the BKGD/PTA4 pin low for at least 128 cycles of the slowest possible BDC clock (The slowest clock is normally the
reference oscillator/64 or the self-clocked rate/64.)
FXTH870xD
Sensors
Freescale Semiconductor, Inc. 143
• Drives BKGD/PTA4 high for a brief speedup pulse to get a fast rise time (This speedup pulse is typically one cycle of the
fastest clock in the system.)
• Removes all drive to the BKGD/PTA4 pin so it reverts to high impedance
• Monitors the BKGD/PTA4 pin for the sync response pulse
The target, upon detecting the SYNC request from the host (which is a much longer low time than would ever occur during normal
BDC communications):
• Waits for BKGD/PTA4 to return to a logic high
• Delays 16 cycles to allow the host to STOP driving the high speedup pulse
• Drives BKGD/PTA4 low for 128 BDC clock cycles
• Drives a 1-cycle high speedup pulse to force a fast rise time on BKGD/PTA4
• Removes all drive to the BKGD/PTA4 pin so it reverts to high impedance
The host measures the low time of this 128-cycle sync response pulse and determines the correct speed for subsequent BDC
communications. Typically, the host can determine the correct communication speed within a few percent of the actual target
speed and the communication protocol can easily tolerate speed errors of several percent.
FXTH870xD
Sensors
144 Freescale Semiconductor, Inc.
15.3.2 BDC Status and Control Register (BDCSCR)
This register can be read or written by serial BDC commands (READ_STATUS and WRITE_CONTROL) but is not accessible to
user programs because it is not located in the normal memory map of the MCU.
7 6 5 4 3 2 1 0
R BDMACT WS WSF DVF
ENBDM BKPTEN FTS CLKSW
W
Normal Reset 0 0 0 0 0 0 0 0
Reset in
1 1 0 0 1 0 0 0
Active BDM:
= Reserved
Field Description
Enable BDM (Permit ACTIVE BACKGROUND Mode) — Typically, this bit is written to 1 by the debug host shortly after the
7 beginning of a debug session or whenever the debug host resets the target and remains 1 until a normal reset clears it.
ENBDM 0 BDM cannot be made active (non-intrusive commands still allowed)
1 BDM can be made active to allow ACTIVE BACKGROUND mode commands
BACKGROUND Mode Active Status — This is a read-only status bit.
6
0 BDM not active (user application program running)
BDMACT
1 BDM active and waiting for serial commands
BDC Breakpoint Enable — If this bit is clear, the BDC breakpoint is disabled and the FTS (force tag select) control bit and
5 BDCBKPT match register are ignored.
BKPTEN 0 BDC breakpoint disabled
1 BDC breakpoint enabled
Force/Tag Select — When FTS = 1, a breakpoint is requested whenever the CPU address bus matches the BDCBKPT match
register. When FTS = 0, a match between the CPU address bus and the BDCBKPT register causes the fetched opcode to be
4 tagged. If this tagged opcode ever reaches the end of the instruction queue, the CPU enters ACTIVE BACKGROUND mode
FTS rather than executing the tagged opcode.
0 Tag opcode at breakpoint address and enter ACTIVE BACKGROUND mode if CPU attempts to execute that instruction
1 Breakpoint match forces ACTIVE BACKGROUND mode at next instruction boundary (address need not be an opcode)
Select Source for BDC Communications Clock — CLKSW defaults to 0, which selects the alternate BDC clock source.
3
0 Alternate BDC clock source
CLKSW
1 MCU bus clock
WAIT or STOP Status — When the target CPU is in WAIT or STOP mode, most BDC commands cannot function. However,
the BACKGROUND command can be used to force the target CPU out of WAIT or STOP and into ACTIVE BACKGROUND
mode where all BDC commands work. Whenever the host forces the target MCU into ACTIVE BACKGROUND mode, the host
2 should issue a READ_STATUS command to check that BDMACT = 1 before attempting other BDC commands.
WS 0 Target CPU is running user application code or in ACTIVE BACKGROUND mode (was not in WAIT or STOP mode when
BACKGROUND became active)
1 Target CPU is in WAIT or STOP mode, or a BACKGROUND command was used to change from WAIT or STOP to ACTIVE
BACKGROUND mode
WAIT or STOP Failure Status — This status bit is set if a memory access command failed due to the target CPU executing a
WAIT or STOP instruction at or about the same time. The usual recovery strategy is to issue a BACKGROUND command to
1 get out of WAIT or STOP mode into ACTIVE BACKGROUND mode, repeat the command that failed, then return to the user
WSF program. (Typically, the host would restore CPU registers and stack values and re-execute the WAIT or STOP instruction.)
0 Memory access did not conflict with a WAIT or STOP instruction
1 Memory access command failed because the CPU entered WAIT or STOP mode
Data Valid Failure Status — This status bit is not used in the MC9S08RA16 because it does not have any slow access
0 memory.
DVF 0 Memory access did not conflict with a slow memory access
1 Memory access command failed because CPU was not finished with a slow memory access
FXTH870xD
Sensors
Freescale Semiconductor, Inc. 145
15.3.3 BDC Breakpoint Match Register (BDCBKPT)
This 16-bit register holds the address for the hardware breakpoint in the BDC. The BKPTEN and FTS control bits in BDCSCR
are used to enable and configure the breakpoint logic. Dedicated serial BDC commands (READ_BKPT and WRITE_BKPT) are
used to read and write the BDCBKPT register but is not accessible to user programs because it is not located in the normal
memory map of the MCU. Breakpoints are normally set while the target MCU is in ACTIVE BACKGROUND mode before running
the user application program. For additional information about setup and use of the hardware breakpoint logic in the BDC, refer
to Section 15.2.4.
7 6 5 4 3 2 1 0
R 0 0 0 0 0 0 0 0
W BDFR(1)
Reset 0 0 0 0 0 0 0 0
= Reserved
1. BDFR is writable only through serial BACKGROUND mode debug commands, not from user programs.
Field Description
Background Debug Force Reset — A serial ACTIVE BACKGROUND mode command such as WRITE_BYTE allows an
0
external debug host to force a target system reset. Writing 1 to this bit forces an MCU reset. This bit cannot be written from a
BDFR
user program.
FXTH870xD
Sensors
146 Freescale Semiconductor, Inc.
16 Battery Charge Consumption Modeling
The supply current consumed by the FXTH870xD can be estimated using the following basic model.
FXTH870xD
Sensors
Freescale Semiconductor, Inc. 147
17 Electrical Specifications
17.1 Maximum Ratings
Maximum ratings are the extreme limits to which the device can be exposed without permanently damaging it. The device
contains circuitry to protect the inputs against damage from high static voltages; however, do not apply voltages higher than those
shown in the table below. Keep VIN and VOUT within the range VSS (VIN or VOUT) VDD.
Input Voltage
101 X1 VIN -0.3 to VDD+0.3 V (3)
102 PTA0, PTA1, PTA2, PTA3, PTB0, PTB1 VIN -0.3 to VDD+0.3 V (3)
103 BKGD/PTA4, RESET VIN -0.3 to VDD+0.3 V (3)
104 LFA, LFB VIN -0.3 to VDD+0.3 V (3)
Input Current
105 X1 IIN ±10 mA (3)
106 PTA0, PTA1, PTA2, PTA3, PTB0, PTB1 IIN ±10 mA (3)
107 BKGD/PTA4, RESET IIN ±10 mA (3)
108 LFA, LFB IIN ±10 mA (3)
Latchup Current
111 Current to/from any pin to supply rails + 0.3 VDC ILATCH ±100 mA (3)
Electrostatic Discharge
112 Human Body Model (HBM), all pins other than RF VESD ±2000 V (3)
113 Human Body Model (HBM), RF pin VESD ±3000 V (3)
114 Charged Device Model (CDM) VESD ±500 V (3)
FXTH870xD
Sensors
148 Freescale Semiconductor, Inc.
17.3 Electrical Characteristics
1.8 VDD 3.6, TL TA TH, unless otherwise specified.
Pin Capacitance (3 V)
312 BKGD/PTA4, PTA0, PTA1, PTA2, PTA3, PTB0, PTB1 C 0 — 15 pF (3)
FXTH870xD
Sensors
Freescale Semiconductor, Inc. 149
17.4 Power Consumption (MCU)
1.8 VDD 3.6, TA 0 to 125 °C unless otherwise specified.
FXTH870xD
Sensors
150 Freescale Semiconductor, Inc.
17.5 Control Timing
1.8 VDD 3.6, TL TA TH, unless otherwise specified.
507 LFR clock (derived from LFRO) fLFRO 122 129 135 kHz (1)
HFO Clock
tOSCSU
STOP1 Wakeup
tMCUWAKE
execute instructions
VDD
6.32 k
TEST POINT
50 pF 10.91 k
FXTH870xD
Sensors
Freescale Semiconductor, Inc. 151
17.6 Voltage Measurement Characteristics
1.8 VDD 3.6, TL TA TH, unless otherwise specified.
FXTH870xD
Sensors
152 Freescale Semiconductor, Inc.
17.7 Temperature Measurement Characteristics
2.3 VDD 3.6, TL TA TH, unless otherwise specified.
710 Temperature measurement stability range (note 10) TSTAB — — 2 count (3)
Temperature Measurement
715 Sensor measurement time (note 7) tTM — 0.6 0.7 ms (3)
716 Peak current (note 8) IT — 3.0 3.9 mA (3)
Power consumption (note 22)
717 Raw measurement, 12-bit QT — 0.19 0.3 µA-sec (3)
718 Compensation, 8-bit QT — 0.43 0.6 µA-sec (3)
719 Basic compensated reading, 8-bit QT — 0.62 0.82 µA-sec (3)
720 Full compensated reading, 8-bit QT — 0.62 0.82 µA-sec (3)
FXTH870xD
Sensors
Freescale Semiconductor, Inc. 153
17.8 Pressure Measurement Characteristic (100 to 450 kPa ranges)
2.3 VDD 3.6, TL TA TH, unless otherwise specified.
Pressure accuracy specified for pressure drops slower than 1 kPa/sec.
FXTH870xD
Sensors
154 Freescale Semiconductor, Inc.
17.9 Pressure Measurement Characteristic (100 to 900 kPa Ranges)
2.3 VDD 3.6, TL TA TH, unless otherwise specified.
Pressure accuracy specified for pressure drops slower than 1 kPa/sec.
Pressure Measurement
925 Sensor measurement time (note 7) tPM — 4.0 4.4 ms (3)
926 Peak current (note 8) IP — 3.0 3.4 mA (3)
Power consumption (note 22)
927 Raw measurement, 10-bit QP — 2.1 3.35 µA-sec (3)
928 Compensation, 9-bit QP — 1.9 2.3 µA-sec (3)
929 Basic compensated reading, 9-bit QP — 4.0 5.4 µA-sec (3)
930 Full compensated reading QP — 4.4 6.0 µA-sec (3)
FXTH870xD
Sensors
Freescale Semiconductor, Inc. 155
17.10 Optional Acceleration Sensor Characteristics
17.10.1 Example Z-Axis Acceleration Sensor Calculations (similar for X-Axis)
As an example, consider that the dynamic firmware routine has returned STEP = 6 indicating offset step 6, and AZCODE = 256.
First, refer to lines 1000 and 1008 to retrieve the step number 6 values for AZCODE = 510 and for AZCODE = 1. Then apply the
following to calculate the sensitivity for offset step 6:
A = A @A 510 – A @A 1 510
Z-6 Z-6 ZCODE Z-6 ZCODE
= 42.1 – – 42.9 510
Once the sensitivity AZ-6 has been calculated, the acceleration AZ can be calculated with the following transfer function:
A = A A + A @A 1 – A
Z Z-6 ZCODE Z-6 ZCODE Z-6
= – 0.3g Eqn. 17
Another example where STEP has been returned as 15 and AZCODE has been returned as 256:
A = A @A 510 + – A @A 1 510
Z-15 Z-15 ZCODE Z-15 ZCODE
Then:
A = A A + A @A 1 – A
Z Z-15 ZCODE Z-15 ZCODE Z-15
= 359g Eqn. 19
FXTH870xD
Sensors
156 Freescale Semiconductor, Inc.
17.10.2 Acceleration Measurement Characteristics (Z and X ranges)
2.3 VDD 3.6, TL TA TH, unless otherwise specified.
Acceleration accuracy specified for pressure drops slower than 1 kPa/sec.
FXTH870xD
Sensors
Freescale Semiconductor, Inc. 157
FXTH870x02 FXTH870x11 FXTH870x11
Symbol
# Characteristic family (Z-axis) family (Z-axis) family (X-axis) Units
Min Typ Max Min Typ Max Min Typ Max
1044 Offset STEP =9 g (3)
1045 ACODE =1 61 75 88 — 60 — — 10 —
A9
1046 = 256 — 118 — — 90 — — 20 —
1047 = 510 138 160 183 — 120 — — 30 —
1048 Offset STEP = 10 g (3)
1049 ACODE =1 97 115 133 — 90 — — 20 —
A10
1050 = 256 — 158 — — 120 — — 30 —
1051 = 510 173 201 229 — 150 — — 40 —
1052 Offset STEP = 11 g (3)
1053 ACODE =1 134 155 176 — 120 — — 30 —
A11
1054 = 256 — 198 — — 150 — — 40 —
1055 = 510 210 241 273 — 180 — — 50 —
1056 Offset STEP = 12 g (3)
1057 ACODE =1 170 195 221 — 150 — — 40 —
A12
1058 = 256 — 238 — — 180 — — 50 —
1059 = 510 246 281 317 — 210 — — 60 —
1060 Offset STEP = 13 g (3)
1061 ACODE =1 204 235 267 — 180 — — 50 —
A13
1062 = 256 — 279 — — 210 — — 60 —
1063 = 51 280 322 364 — 240 — — 70 —
1064 Offset STEP = 14 g (3)
1065 ACODE =1 240 275 310 — 210 — — 60 —
A14
1066 = 256 — 319 — — 240 — — 70 —
1067 = 510 317 362 408 — 270 — — 80 —
1068 Offset STEP = 15 g (3)
1069 ACODE =1 274 315 356 — 240 — — 70 —
A15
1070 = 256 — 359 — — 270 — — 80 —
1071 = 510 350 402 455 — 300 — — 90 —
2.3 VDD 3.6, -20 °C TA 85 °C, unless otherwise specified.
All families
# Characteristic Symbol Units
Min Typ Max
1072 Acceleration cross-axis sensitivity ACROSS -5 — 5 % (4)
1073 Acceleration Sensitivity Variation AZ -15 0 15 % (4)
Z-axis Acceleration Measurement
1074 Sensor measurement time (note 7) tAM — 4.0 4.8 ms (3)
1075 Peak current (note 7) IA — 3.0 3.4 mA (3)
Power consumption
1076 Raw measurement, 10-bit QC — 2.1 3.6 A-sec (3)
1077 Compensation, 9-bit QC — 1.9 2.3 A-sec (3)
1078 Basic compensated reading, 9-bit QC — 4.0 6.0 A-sec (3)
1079 Full compensated reading, 9-bit QC — 4.4 6.2 A-sec (3)
Note: Refer to page 167 for description of notes.
FXTH870xD
Sensors
158 Freescale Semiconductor, Inc.
17.11 LFR Sensitivity
2.3 VDD 3.6, -20 °C TA 85 °C, unless otherwise specified. Detection and no detection criteria defined by notes 19 and 20.
# Characteristic Symbol Min Typ Max Units
FXTH870xD
Sensors
Freescale Semiconductor, Inc. 159
17.12 LFR Characteristics
2.3 VDD 3.6, -20 °C TA 85 °C, unless otherwise specified.
# Characteristic Symbol Min Typ Max Units
1210 LFR Detector Power Up Settling Time (2 LFO cycles) tPU 1.4 2.0 2.6 ms (4)
LFR Preamble Decoder Settling Time
Data Mode Only, LFCDTM plus tDEC
1211 LPSM = 0 tDEC — — 200 sec (4)
1212 LPSM = 1 tDEC — — 400 sec (4)
FXTH870xD
Sensors
160 Freescale Semiconductor, Inc.
SIMPLIFIED
INPUT PIN EQUIVALENT
CIRCUIT
SIMPLIFIED
Pad
ZS leakage CHANNEL SELECT
RS, CS due to CIRCUIT
input
RADIN
protection
+ LFA
VLFIN
RS –
VAS
R1
L
C R CS
RLFDF
L S Input
CLFDF Amplifier
SIMPLIFIED
Pad
leakage CHANNEL SELECT
due to CIRCUIT R2
input
RADIN
LFB protection
FXTH870xD
Sensors
Freescale Semiconductor, Inc. 161
17.14 RF Output Stage
1.8 VDD 3.6, TL TA TH, unless otherwise specified.
Power output based on using Dynamic RF Power Correction firmware routine.
Output load of 50 resistance as shown in Figure 125 unless otherwise specified.
MCU in STOP1 mode during all RF tests.
RF output will shutdown when the total RF IDD causes VDD to fall below 1.8 V (VDD = VBATT - IBATT x RBATT). See Figure 126.
1407 External Crystal Frequency (note 14) fXTAL — 26.000 — MHz (3)
1408 Fixed portion of RF start process tS-RCTS — — 300 sec (3)
Total RF transmit start time from write of SEND bit to start of tRF2
1410 — — 1.8 msec (3)
RF @ 2,000 bps, tRF = tS-RCTS + (Bits * bps-1)
1411 Total RF transmit start time from write of SEND bit to start of tRF9.6 — — 613 sec (3)
RF @ 9,600 bps, tRF = tS-RCTS + (Bits * bps-1)
Total RF transmit start time from write of SEND bit to start of tRF20 — — 450 sec (3)
1412
RF @ 20,000 bps, tRF = tS-RCTS + (Bits * bps-1)
1416 XTAL Oscillator Margin (over 26 MHz) (note 17) ML 600 — — (4)
Harmonic 4 Level and above (315 and 434 MHz bands, with
matching reference network)
1419 VDD = 3 V, TA = 25 °C, PWR[4:0] = 01110 H4 — — -30 dBc (3)
1420 1.8 VDD 3.6, TL TA TH, power step adjusted to H4 — — -30 dBc (3)
reach the targeted power in each domain
FXTH870xD
Sensors
162 Freescale Semiconductor, Inc.
# Characteristic Symbol Min Typ Max Units
FXTH870xD
Sensors
Freescale Semiconductor, Inc. 163
17.15 Power Consumption RF Transmissions
1.8 VDD 3.6, TA 25 °C unless otherwise specified.
Using the TPMS_RF_DYNAMIC_POWER firmware routine (see Section 14) allows adjusting power step in order to compensate
variations of output power versus temperature and voltage. This routine will be associated to a part to part trimming that initially
adjusts the power step to compensate for process variations.
Both these trim and look-up table allow to guarantee by characterization the typical values of power consumption as presented
below (average values among 100 parts plus improvements prediction from design).
3.6V
5.3mA
5.0mA 5.5mA
5.3mA 6mA
6.2mA 6.2mA
6.4mA 5.8mA
5.8mA
3V
.6mA
6.2mA
5dBm
5dBm 3dBm
3dBm
3dBm
3dBm 6.4mA 6.5mA 5.8mA
6.3mA 6.6mA 5.7mA
2.5V
5.2mA
5.3mA 5.4mA
5.5mA
1.8V
FXTH870xD
Sensors
164 Freescale Semiconductor, Inc.
3.6V
5.5mA
5.6mA 5.7mA
5.8mA 6.7mA
6.9mA 6.8mA
7.1mA 6.4mA
6.6mA
3V . 6.6mA
6.9mA
5dBm
5dBm 3dBm
3dBm
3dBm
3dBm
7.0mA
7.1mA 7.5mA
7.8mA 7.0mA
6.8mA
2.5V
5.8mA
6.3mA 6.2mA
6.5mA
1.8V
100 pF 100 nF
VDD
L1
RF L2
FXTH870xxx 1 nF
50
RVSS
IBATT
FXTH870xxx
AVDD
RBATT
VBATT
2.7V
1 F
AVSS
FXTH870xD
Sensors
Freescale Semiconductor, Inc. 165
18 Mechanical Specifications
18.1 Maximum Ratings
Maximum ratings are the extreme limits to which the device can be exposed without permanently damaging it. The device
contains circuitry to protect the inputs against damage from high static voltages; however, do not apply voltages higher than those
shown in the table below. Keep VIN and VOUT within the range VSS (VIN or VOUT) VDD.
1803 Powered Shock (peak, 0.1 ms, half-sine, 6-axis) gshock 6000 g (3)
FXTH870xD
Sensors
166 Freescale Semiconductor, Inc.
Notes:
1. Parameters tested 100% at final test.
2. Parameters tested 100% at unit probe.
3. Verified by characterization, not tested in production.
4. For information only, may be determined by simulation.
5. Total of three hours over the life of the device.
6. Fully compensated pressure reading using TPMS_READ_PRESSURE followed by TPMS_COMP_PRESSURE
routine with single reading and 500 Hz low-pass filter ON.
7. Measurement times for one complete compensated reading; and times dependent on clock tolerances.
8. Peak currents measured as the current over 10 MCU bus cycles immediately after the ADC wakes up the MCU
using the external network shown in Figure 126 with RBATT equal to zero-ohm resistance.
9. Fully compensated acceleration reading using TPMS_READ_ACCELERATION followed by
TPMS_COMP_ACCELERATION routine with single reading and 500 Hz low-pass filter ON.
10. Total range of variation over 30 consecutive measurements, using compensated output format.
11. Temperature error for MCU or RFM powered up at less the 10% duty-cycle
12. Package mounted with pressure port facing radially outward from axis of rotation.
13. Temperature shutdown points trimmed at final test. Limits when TRH ($180F bits 6:4) overwritten by customer
application to 0x06.
14. Suggested crystal is NDK NX3225SA, 26.000 MHz.
15. Low voltage detection and warning thresholds defined for voltage change rates less than 20 mV/s. Hysteresis
thresholds may decrease above 85 °C.
16. Response time to VDD of more than 100 mV below the minimum VDD falling threshold.
17. Crystal oscillator margin is the value of the total series resistance including the XTAL ESR, that can be applied
before the XCO does not start up. This definition does not define any specific start up time.
18. Accuracy of the RF data rate when using the data buffer is dependent on the overall oscillator function (i.e.
including external crystal and internal circuit tolerances).
19. LFR detection is tested to assure > 90% message success rate. LFR no detection is tested to assure < 10%
message success rate. In carrier detect mode the applied input pulse is at least 2x the LFCDTM selected. In all
cases the envelop of the input waveform must have a RC time constant less than 15.3 sec. LF sensitivity limits
are measured while the device is in the STOP1 mode, which is characterized as a worst-case condition; sensi-
tivity in the other modes are improved versus the STOP1 modes.
20. Using firmware release $28 or higher.
21. Actual final test value degraded by losses in the tester. Correlation study done as characterization to infer actual
value.
22. Power consumption values refer to the firmware data flow in Figure 57. The BASIC Compensated value includes
just the raw measurement and compensation routine for that parameter. Other raw readings needed for full com-
pensation will be pulled from the UUMA. The FULL Compensated value includes taking all required raw read-
ings and using the compensation routine for that parameter.
FXTH870xD
Sensors
Freescale Semiconductor, Inc. 167
19 Package Outline
FXTH870xD
Sensors
168 Freescale Semiconductor, Inc.
Figure 128. QFN Case Outline
FXTH870xD
Sensors
Freescale Semiconductor, Inc. 169
Figure 129. QFN Case Outline
FXTH870xD
Sensors
170 Freescale Semiconductor, Inc.
FXTH870xD
Sensors
Freescale Semiconductor, Inc. 171
20 Revision History
Rev. 0, 05/2014
• Initial data sheet.
Rev. 1, 05/2014
• Corrected Ordering Information table.
• Figure 5: Updated paragraph in figure to include PCB traces for the LFA/LFB.
• Section 5.4: Updated register figure to include TRO bit on Bit 0. Added Description to Table 19 and update reserved bit fields.
• Section 6.1: Updated last paragraph in section.
• Section 10.1: Added NOTE.
• Section 10.4: Added NOTE.
• Section 14.2.2: Added definitions for ID codes.
• Section 17.5: Added rows 510 and 511, renumbering 510 to 512.
• Section 17.10.2: Changed column content reference from See lines 1042-1045 to See Offset STEP = 7. Change column
content reference See lines1001-1009 to See lines 1001-1004 in this ‘D’ version.
• Section 17.12: Updated Characteristic and Min Value for line 1200. Updated Characteristic and note reference for line 1210.
• Section 17.4: Updated Symbols for lines 400 through 412 and lines 417 and 418. Updated Max value for line 403
• Section 17.6: Updated Max value for line 612 and updated note reference and Symbol for line 613.
• Section 17.7: Updated note references for lines 711-714.
• Section 17.9: Updated Typ and Max values for line 924. Updated Typ values for lines 927 through 930.
• Section 17.10.2: Deleted line 1073 and updated Typ values for lines 1078 through 1081.
• Section 17.11: Deleted lines 1108-1113, duplicated information. Updated Typ value for line 1106.
• Section 17.12: Updated Symbols for lines 1208 through 1210 and updated Characteristics for lines 1208 and 1209.
• Section 17.13: Updated Max value for line 1301.
• Section 18.1: Updated Max value for line 1800.
Rev. 1.2, 09/2014
• First page: Updated bullet “Six multipurpose GPIO pins” to “Seven multipurpose GPIO pins” and sub-bullets.
• Section 2.3.8: Updated paragraph with additional content.
• Section 2.3.9: Updated title and paragraphs with corrected pin numbers and added text to paragraph.
• Section 2.3.12: Updated content in paragraph.
• Section 3.5.4: Updated header title for I/O Pins, deleted (Optional PTA[3:0]).
• Section 4.3: Table 3, updated Bit contents for Address columns $0000 and $0003.
• Section 5.11.2: Table 26, updated Description for BKGDPE Field
• Section 6: Updated content in first two paragraphs. Updated Figure 29, added boxes and note for emphasis on PTA[3:0]
usage. Updated title and column heads in Table 32 and added rows for PTBPE and PTBDD. Figure 31 and Table 34, updated
Bit 4 to Reserved and updated Field name. Figure 32 and Table 35, updated Bit 4 to Reserved and updated Field name.
Updated first paragraph in Section 6.5.
• Section 7: Section 7.1: Updated 1st bullet. Section 7.2.1: Updated content in first paragraph. Section 7.5: Updated bulleted
text. Sections 7.5.2 and 7.5.3: Updated tables and figures to show bits reserved for firmware or factory test. Section 7.6:
Updated content in second paragraph. Section 7.6.3: Updated content in paragraph. Section 7.6.4: Updated list number 3
and 4.
• Section 12.17.1: Updated LF Enable description in Table 59.
• Section 12.17.4: Table 62, removed “Use Software polling” from LFCDIE and LFIDIE Descriptions.
• Section 12.17.8: Added Note after Table 67 regarding setting the CHK125 bits and updated Description for Field 1-0,
CHK125[1:0].
• Section 14.2.1.1: Table 86, changed Routine and Description columns for E084 to Reserved. Table 87, changed Routine and
Description columns for E090 to Reserved.
• Section 17.1: Added Value to line 108.
• Section 17.3: Updated Characteristic for line 311.
• Section 17.12: Updated Min and Max values for line 1206 and updated Characteristic.
• Section 17.4: Updated Characteristic for line 412.
FXTH870xD
Sensors
172 Freescale Semiconductor, Inc.
Rev. 1.2, 09/2014 (continued)
• Section 17.6 Updated Value for line 631.
• Section 17.8: Added asterisk notes to lines 821 and 822.
• Section 17.9: Added asterisk notes to lines 921 and 922.
• Section 17.13: Updated introduction paragraph.
• Section 17.14: Added asterisk note to line 1402. Redefined lines 1408 through 1411 and added line 1412.
• Section 17.15: Updated Characteristic for line 1500. Updated Typ value for line 1505.
• Section 18.1: Updated Value for line 1802.
• Notes page: Updated Notes 2, 18,19, 20 and added note 25.
Rev. 1.3, 01/2015
• Section 17.3: Updated Characteristic column for lines 303, 305, 307, 308, 310, and 311. Changed note reference for lines
306 and 309. Updated Min and Max values for lines 308 and 311.
• Section 17.6: Changed note reference for lines 603, 606, and 609.
• Section 17.6: Updated Max value for line 711. Updated Min Value for line 712.
• Section 17.10.2: Deleted line 1002.
• Section 17.15: Changed note reference for lines 1503 and 1505. Replaced Figures 123 and 124.
• Notes page: Updated note 13.
• Replaced case outline with current version.
Rev. 1.4, 02/2015
• Section 14.2.2: Table 88, added two columns, “Initial Address” and “Updated Address”.
FXTH870xD
Sensors
Freescale Semiconductor, Inc. 173
How to Reach Us: Information in this document is provided solely to enable system and software
implementers to use Freescale products. There are no express or implied copyright
Home Page:
freescale.com licenses granted hereunder to design or fabricate any integrated circuits based on the