PS0285
PS0285
ii
As used herein
Life support devices or systems are devices which (a) are intended for surgical implant into the body, or (b)
support or sustain life and whose failure to perform when properly used in accordance with instructions for
use provided in the labeling can be reasonably expected to result in a significant injury to the user. A criti-
cal component is any component in a life support device or system whose failure to perform can be reason-
ably expected to cause the failure of the life support device or system or to affect its safety or effectiveness.
Document Disclaimer
©9/12/17 Zilog, Inc. All rights reserved. Information in this publication concerning the devices, applica-
tions, or technology described is intended to suggest possible uses and may be superseded. Zilog, INC.
DOES NOT ASSUME LIABILITY FOR OR PROVIDE A REPRESENTATION OF ACCURACY OF
THE INFORMATION, DEVICES, OR TECHNOLOGY DESCRIBED IN THIS DOCUMENT. Zilog
ALSO DOES NOT ASSUME LIABILITY FOR INTELLECTUAL PROPERTY INFRINGEMENT
RELATED IN ANY MANNER TO USE OF INFORMATION, DEVICES, OR TECHNOLOGY
DESCRIBED HEREIN OR OTHERWISE. The information contained within this document has been ver-
ified according to the general principles of electrical and mechanical engineering.
ZMOTION and Z8 Encore! XP are registered trademarks of Zilog, Inc. All other product or service names
are the property of their respective owners.
PS028514-0917 Disclaimer
ZMOTION Detection and Control Family
Product Specification
iii
Revision History
Each instance in the revision history table reflects a change to this document from its pre-
vious revision. For more details, refer to the corresponding pages or appropriate links pro-
vided in the table below.
Revision
Date Level Description Page
Sep 14 Corrected ZMOTION Engine revision. 31
2017
Mar 13 Added note indicating that the device is not preprogrammed and user is 1, 4, 10,
2015 required to download generic detection code (RD0026-SC01). 20, 41
Dec 12 Updated to include two new Nicera lenses in the Lens and PIR Sensor 41
2011 Selector.
Jan 11 Modifications to some lens/sensor descriptions in Lens Selection Guide. 57
2011
Jan 10 Updated to include two new Nicera lenses in the Lens and PIR Sensor 41
2011 Selector.
Jan 09 Updated to correct part number on title page. i
2011
Nov 08 Updated to comply with accepted Zilog style. All
2010
Nov 07 Updated to new Zilog/IXYS logo. All
2010
Oct 06 Replaced all instances of ePIR with advanced passive infrared. All
2010
Sep 05 Fixed formatting and pagination issues. All
2010
Sep 03 Replaced Zilog logos, ePIR with ZMOTION, and Zdots with Module. All
2010
Oct 02 Updated the Related Documents section (changed 88-pin SOIC to 28-pin 44, all
2008 SOIC for Z8FS040AHJ20SG). Removed references to GP and General
Purpose.
Oct 01 Original issue. All
2008
iv
Table of Contents
Revision History . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .iii
Table of Contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . iv
List of Figures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . vi
List of Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . vii
Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Z8FS040 MCU Block Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
MCU Part Selection Guide and Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
Pin Configurations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
Signal Descriptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
Memory Map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
RAM Memory Map (Register Files) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
Peripherals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
Peripheral Availability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
Pin Availability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
Hardware Connection Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
Zilog’s PIR Technology and API . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
Standard API Register Set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
Advanced API Register Set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
Packaging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
Ordering Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
Ordering Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
Related Documents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
Appendix A. Application Schematics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
8-Pin Z8FS040xSB20EG MCU . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
20-Pin Z8FS040xHH20EG . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
Single Pyroelectric Sensors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
Dual Pyroelectric Sensors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
28-Pin Z8FS040xHJ20EG . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
Single Pyroelectric Sensor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
Dual Pyroelectric Sensors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
Appendix B. PIR Engine Initialization and Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
Appendix C. Software Support Files and Project Configuration . . . . . . . . . . . . . . . . . . 55
ZDS II Project Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
Appendix D. Lens Selection Guide . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
Customer Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
vi
List of Figures
Figure 1. Z8FS040 MCU Block Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
Figure 2. 8-Pin SOIC Package Diagram – Z8FS040xSB20EG . . . . . . . . . . . . . . . . . . 6
Figure 3. 20-Pin SSOP Package Diagram – Z8FS040xHH20EG . . . . . . . . . . . . . . . . . 6
Figure 4. 28-Pin SSOP Package Diagram – Z8FS040xHJ20EG . . . . . . . . . . . . . . . . . 7
Figure 5. Z8FS040 MCU Program Memory Map . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
Figure 6. Z8FS040 MCU RAM Memory Map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
Figure 7. Required Circuit Connections for the Z8FS040xSB20EG(8-Pin) Motion
Detection MCU 46
Figure 8. Required Circuit Connections for the Z8FS040xHH20EG
(20-Pin) Motion Detection MCU in Single Pyro Mode 47
Figure 9. Required Circuit Connections for the Z8FS040xHH20EG
(20-Pin) Motion Detection MCU in Dual Pyro Mode 48
Figure 10. Required Circuit Connections for the Z8FS040xHJ20EG
(28-Pin) Motion Detection MCU in Single Pyro Mode 49
Figure 11. Required Circuit Connections for the Z8FS040xHJ20EG
(28-Pin) Motion Detection MCU in Dual Pyro Mode 50
Figure 12. Application Flow Diagram: Normal Scan Rate . . . . . . . . . . . . . . . . . . . . . . 53
Figure 13. Application Flow Diagram: Low Scan Rate . . . . . . . . . . . . . . . . . . . . . . . . 54
vii
List of Tables
Table 1. Z8FS040 MCU Package Availability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
Table 2. PIR Technology Revision Identifiers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
Table 3. Z8FS040 MCU Signal Descriptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
Table 4. Peripheral Availability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
Table 5. PIR Engine Standard API Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
Table 6. PIR Engine Enable Register (ePIR_Enable). . . . . . . . . . . . . . . . . . . . . . . . . . 22
Table 7. PIR Software Enable Patterns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
Table 8. PIR Sensitivity Register (ePIR_Sensitivity) . . . . . . . . . . . . . . . . . . . . . . . . . . 23
Table 9. PIR Status/Control Register 0 (ePIR_SC0) . . . . . . . . . . . . . . . . . . . . . . . . . . 24
Table 10. PIR Status/Control Register 1 (ePIR_SC1) . . . . . . . . . . . . . . . . . . . . . . . . . . 26
Table 11. PIR Status/Control Register 2 (ePIR_SC2) . . . . . . . . . . . . . . . . . . . . . . . . . . 28
Table 12. PIR Status/Control Register 3 (ePIR_SC3), 28-Pin SSOP . . . . . . . . . . . . . . . 28
Table 13. PIR Status/Control Register 3 (ePIR_SC3), 20-Pin SSOP . . . . . . . . . . . . . . . 29
Table 14. PIR Status/Control Register 3 (ePIR_SC3), 8-Pin SOIC . . . . . . . . . . . . . . . . 29
Table 15. PIR ADC Result Value (ePIR_ADC_Result). . . . . . . . . . . . . . . . . . . . . . . . . 31
Table 16. PIR Version (ePIR_Version) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
Table 17. PIR Engine Advanced Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
Table 18. PIR Advanced Status/Control Register 0 (ePIR_ASC0) . . . . . . . . . . . . . . . . 33
Table 19. PIR Advanced Status/Control Register 2 (ePIR_ASC2) . . . . . . . . . . . . . . . . 34
Table 20. PIR Process Rate (ePIR_Process_Rate) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
Table 21. PIR Sample Size Register (ePIR_Sample_Size). . . . . . . . . . . . . . . . . . . . . . . 36
Table 22. PIR Debounce Time Register (ePIR_Debounce) . . . . . . . . . . . . . . . . . . . . . . 36
Table 23. PIR Debounce Batch Size Register (ePIR_Debounce_Batch) . . . . . . . . . . . . 37
Table 24. PIR Transient Sensitivity Level (ePIR_Transient_Sense) . . . . . . . . . . . . . . . 37
Table 25. Noise Sensitivity as determined by Window Size . . . . . . . . . . . . . . . . . . . . . 38
Table 26. PIR Noise Sensitivity Level (ePIR_Noise_Sense) . . . . . . . . . . . . . . . . . . . . . 38
Table 27. PIR Signal (ePIR_Signal) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
Table 28. PIR DC Signal Level (ePIR_Signal_DC) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
Table 29. Part Number Designations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
Table 30. Positions 1–4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
Table 31. Positions 5–8: MCU and MCU Package Selector* . . . . . . . . . . . . . . . . . . . . 41
Table 32. Positions 9–12: Lens and PIR Sensor Selector . . . . . . . . . . . . . . . . . . . . . . . . 41
Table 33. Position 13 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
viii
Overview
Zilog’s ZMOTION Detection and Control Family of products provides an integrated and
flexible solution for motion detection applications based on Passive Infrared (PIR) tech-
nology, including a high-performance ZMOTION microcontroller with integrated motion
detection algorithms and a selection of lenses and PIR sensors to fit a wide range of appli-
cation requirements. Optimized configuration parameters for the MCU are provided for
each lens/sensor combination to ensure the best possible performance while significantly
reducing development risk and minimizing time to market.
Depending upon your application requirements, the ZMOTION Detection and Control
Family offers a broad range of solutions, from a simple combination of the Z8FS040
MCU and an API to a full set of pyros and lenses that are bundled with the Z8FS040
MCU. The ZMOTION MCU is also packaged as a complete motion detection solution,
the ZMOTION Module.
Zilog’s Z8FS040 MCU combines the programmability and rich peripheral set of Zilog’s
Z8 Encore! XP® Flash MCUs with built-in motion detection software algorithms to pro-
vide the functions necessary for PIR motion detection applications. These motion detec-
tion algorithms comprise Zilog’s PIR technology and run in the background while control
and status of the PIR Engine is accessed through a software API. As a result, the designer
can create application-specific software while taking advantage of Zilog’s ZMOTION
Motion Detection Technology.
Note: The Z8FS040 MCU is not preprogammed with application code. A generic version of the
ZMOTION Detection source code (RD0026-SC01) can be downloaded from zilog.com
and programmed into the MCU.
API settings are provided to match the Engine operation to each of the lens and pyroelec-
tric sensor combinations provided.
The Flash in-circuit programming capability of the Z8FS040 allows for faster develop-
ment time, more flexible manufacturing and firmware changes in the field.
Zilog’s PIR motion detection technology provides a dramatic improvement in both sensi-
tivity and stability over traditional designs and is scalable to many market segments
including Lighting Control, HVAC, Access Control, Vending, Display, Proximity, Power
Management, Occupancy Sensing and many others.
Features
Key features of the Z8FS040 MCU include:
PS028514-0917 Overview
ZMOTION Detection and Control Family
Product Specification
PS028514-0917 Features
ZMOTION Detection and Control Family
Product Specification
POR
Interrupt & VBO WDT +
PIR Controller Low Power External
Engine Oscillator XTAL/RC
Oscillator
Register
File RAM 4KB eZ8
TM
Comparator Sigma/Delta
IrDA ADC
GPIO
Note: The Z8FS040 MCU is not preprogammed with application code. A generic version of the
ZMOTION Detection source code (RD0026-SC01) can be downloaded from zilog.com
and programmed into the MCU.
The ZMOTION Module. A complete modular system with a lens and pyroelectric sensor
for out-of-the-box development.
The ZMOTION Detection and Control Bundled Solution. A package that combines the
ZMOTION MCU with an assortment of lenses and pyros.
Table 1 lists these three packages by part number, while Table 2 indicates changes since
the initial release of the MCU. To determine the appropriate ZMOTION product for your
application by part number, see the Ordering Information section on page 40 of this docu-
ment.
Please refer to the base part number in the Z8 Encore! XP F082A Series Product Specifi-
cation (PS0228) for all MCU functions, features and specifications not covered in this
document.
Pin Configurations
Zilog’s Z8FS040 products are available in 8-pin SOIC and 20- and 28-pin SSOP package
configurations, as shown in Figures 2 through 4. This chapter describes the signals and
available pin configurations for each of these package types. For a description of the sig-
nals, see Tables 6 through 8 starting on page 22. For physical package specification infor-
mation, see the Packaging section on page 40.
VDD 1 8 VSS
PA0/T0IN/T0OUT/XIN/DBG 2 7 PA5/TXD0/T1OUT/ANA0/CINP
PA1/T0OUT/XOUT/ANA3/VREF/CLKIN 3 6 PA4/RXD0/ANA1/CINN
PA2/RESET/DE0/T1OUT 4 5 ANA2
PB1/ANA1 1 20 PB0/ANA0
ANA2 2 19 PC3/COUT
ANA3 3 18 PC2/ANA6/LED/VREF
VDD 4 17 PC1/ANA5/CINN
PA0/T0IN/T0OUT/XIN 5 16 PC0/ANA4/CINP
PA1/T0OUT/XOUT 6 15 DBG
VSS 7 14 RESET/PD0
PA2/DE0 8 13 PA7/T1OUT
PA3/CTS0 9 12 PA6/T1IN/T1OUT
PA4/RXD0 10 11 PA5/TXD0
ANA2 1 28 PB1/ANA1
PB4/ANA7 2 27 PB0/ANA0
PB5/VREF 3 26 PC3/COUT
ANA3 4 25 PC2/ANA6
AVDD 5 24 PC1/ANA5/CINN
VDD 6 23 PC0/ANA4/CINP
PA0/T0IN/T0OUT/XIN 7 22 DBG
PA1/T0OUT/XOUT 8 21 RESET/PD0
VSS 9 20 PC7
AVSS 10 19 PC6
PA2/DE0 11 18 PA7/T1OUT
PA3/CTS0 12 17 PC5
PA4/RXD0 13 16 PC4
PA5/TXD0 14 15 PA6/T1IN/T1OUT
Signal Descriptions
At reset, all port pins are set to the GPIO input state on the 8-pin SOIC package except for
RESET/DE0/T1OUT, which is configured to RESET, and PA0/T0IN/T0OUT/XIN/DBG,
which is configured to DBG. On the 20- and 28-pin SSOP packages, RESET/PD0 is con-
figured to RESET.
Table 3 describes the Z8FS040 Series signals.
Reset
RESET I/O RESET. Generates a Reset when asserted (driven Low). Also serves as
a reset indicator; the Z8 Encore! XP forces this pin low when in reset.
This pin is open-drain and features an enabled internal pull-up resistor.
Power Supply
VDD I Digital Power Supply.
AVDD I Analog Power Supply.
VSS I Digital Ground.
AVSS I Analog Ground.
10
Memory Map
The Z8FS040 MCU is based on Zilog’s Z8F082A device, which contains a total of 8 KB
of Flash memory. Zilog’s PIR technology is located in the 4 KB address range 1000h to
1FFFh, a code space that is locked and cannot be erased by the user, by the Zilog Debug
Interface (ZDI) mass or page erase commands. The remaining 4 KB of this Flash memory
space, in the address range 0000h to 0FFFh, is available for user application code.
Note: The Z8FS040 MCU is not preprogammed with application code. A generic version of the
ZMOTION Detection source code (RD0026-SC01) can be downloaded from zilog.com
and programmed into the MCU.
1FFFh
Reserved for
PIR Engine
1000h
0FFFh
User Application
Code Space
(4033 bytes)
003Eh
003Dh
Interrupt Vectors
and Option Bits
0000h
11
FFFh
MCU
Control Registers
F00h
EFFh
400h
3FFh
190h
18Fh
User Application RAM
(128 bytes)
110h
10Fh
100h Standard PIR API
Advanced PIR API 0FFh
0F0h
0EFh
Reserved for PIR Engine
080h
07Fh
User Application RAM
(128 bytes)
000h
The PIR Motion Detection API is a series of registers located in RAM memory space,
from 0F0h to 10Fh. It is through these memory locations that configuration and status are
passed between the PIR technology and the user application. Advanced API registers are
12
located in the address range 0F0h to 0FFh. See the Zilog’s PIR Technology and API chap-
ter on page 20 for details about the API registers and setting up the project memory envi-
ronment.
Peripherals
The following sections describe the differences, changes, or limitations placed on any of
the Z8FS040 peripherals or other functions from the base Z8F082A device. To learn more
about the operation of each peripheral please refer to the appropriate section of the Z8
Encore! XP F082A Series Product Specification (PS0228).
Peripheral Availability
Table 4 shows how the Z8FS040 MCU peripherals are used by Zilog’s PIR technology
and how these peripherals differ from their counterparts on the base Z8F082A device. The
peripherals used by the PIR technology should not be used by the application unless the
engine is disabled through the PIR Engine Enable Register.
Device
Z8FS040xSB20EG Z8FS040xHH20EG Z8FS040xHJ20EG
Base MCU Device Z8F082ASB020EG Z8F082AHH020EG Z8F082AHJ020EG
PS028514-0917 Peripherals
ZMOTION Detection and Control Family
Product Specification
13
The remainder of this section further describes the differences in application availability
between the 8-pin, 20-pin and 28-pin peripheral sets.
20-Pin Device. PB2 (ANA2) is reserved as the analog ADC input from the pyroelectric
sensor. Therefore ANA2 is not available for user applications. Also, ANA3 and ANA6 are
PS028514-0917 Peripherals
ZMOTION Detection and Control Family
Product Specification
14
not available since PB3 (ANA3) must be tied directly to PC2 (ANA6/VREF). PC2 is con-
figured as VREF output by the PIR engine. In DUAL PYRO Mode, ANA3 is used for sec-
ond sensor input rather than being tied to VREF, and therefore ANA6/VREF becomes
available. All other channels are available to the user application.
28-Pin Device. PB2 (ANA2) is reserved as the analog ADC input from the pyroelectric
sensor. Therefore ANA2 is not available for user applications. Also, ANA3 is not avail-
able since it is tied directly to PB5/VREF. PB5 will be configured as VREF output by the
PIR engine. In DUAL PYRO Mode, ANA3 is used for a second sensor input rather than
being tied to VREF, and PB5 therefore becomes available. All other channels are available
to the user application.
PS028514-0917 Peripherals
ZMOTION Detection and Control Family
Product Specification
15
Timers
There are two independent and identical 16-bit multifunction timers available; both Timer
0 and Timer 1 are available to the user application.
Timer 0
8-Pin Device T0OUT not available in DUAL PYRO Mode;
configured as ANA3 to support a second
sensor input. All other external Timer 0
functions are available for the user
application.
20-Pin Device All external Timer 0 functions are available
for the user application.
28-Pin Device All external Timer 0 functions are available
for the user application.
Timer 1
8-Pin Device T1IN is configured as ANA2 to support the
signal input from the pyroelectric sensor
and is not available to the user application.
All other Timer 1 functions are available.
20-Pin Device All external Timer 1 functions are available
for the user application.
28-Pin Device All external Timer 1 functions are available
for the user application.
Watchdog Timer
No changes or limitations are placed on WDT functions by Zilog’s PIR technology; the
WDT is available to the user application.
PS028514-0917 Peripherals
ZMOTION Detection and Control Family
Product Specification
16
Comparator
UART
Oscillator Control
All devices can be operated with the internal 5.54 MHz IPO. For applications that require
more processing power or a more accurate time base, an external crystal oscillator or
ceramic resonator can be used.
When using the 8-pin device, external oscillator support is limited to SINGLE PYRO
Mode only, since ANA3 (the ADC input for a second pyro sensor) is multiplexed with
XOUT. The 20- and 28-pin devices can be operated with an external oscillator in both SIN-
GLE and DUAL PYRO modes.
Caution: Do not operate at frequencies lower than the IPO frequency while the PIR
engine is enabled or motion detection performance will be degraded.
No other changes or limitations are placed on oscillator control functions by the PIR
engine.
PS028514-0917 Peripherals
ZMOTION Detection and Control Family
Product Specification
17
Flash Memory
The control registers associated with Flash memory are all available to the application.
Zilog’s PIR technology uses the value programmed into the Flash Frequency registers
(FFREQ) to determine its required sample timing. The Flash Frequency High (FFREQH)
and Flash Frequency Low Byte (FFREQL) registers must be programmed prior to initial-
izing the PIR engine. These two registers combine to form a 16-bit value, FFREQ. This
value is also used by the PIR engine to calculate the required sample rate of the ADC and
other functions. The 16-bit value for FFREQ is the System Clock Frequency in KHz and is
calculated using the following equation.
Interrupt Controller
No changes or limitations are placed on the interrupt controller functions by Zilog’s PIR
technology.
Temperature Sensor
The temperature sensor is not tested or calibrated (trim bits are not available). Therefore
this peripheral is not available on any of the Z8FS040 devices.
Pin Availability
Although most pins on the ZMOTION MCU Series are available to the application, some
pins are dedicated to supporting the PIR functions. The following section describes which
pins are reserved and which are available to the application. The pins used by Zilog’s PIR
technology are automatically configured when the engine is initialized.
General-Purpose Input/Output
All of the General Purpose I/Os are available except for those used for the PIR circuit. To
learn more, see the example application schematics in Appendix A. Application Schemat-
ics on page 45.
18
8-Pin Device Pin 5 (ANA2) is reserved as the analog ADC input from the pyroelectric sensor. Any other
functions multiplexed with Pin 5 (PA3/CTS0, COUT and T1IN) are not available for user
applications.
In DUAL PYRO Mode (the application uses 2 pyroelectric sensors), Pin 3 (ANA3) is used
as an analog ADC input for second sensor and is therefore not available for other
functions (T0OUT/VREF/CLKIN).
20-Pin Device Pin 2 (ANA2) is reserved as the analog ADC input from the pyroelectric sensor. In
SINGLE PYRO Mode, Pin 3 (ANA3) must be externally tied to VREF on Pin 18 (PC2/
ANA6/LED/VREF). PC2 will be configured as the VREF output by the PIR engine when it is
enabled.
In DUAL PYRO Mode (which supports 2 pyroelectric sensors), Pin 3 (ANA3) is used for
the second sensor. In this mode, the Pin 18 VREF signal is not connected externally to
any other ADC inputs and is therefore available to the application (PC2/ANA6/LED/
VREF).
28-Pin Device Pin 1 (ANA2) is reserved as the analog ADC input from the pyroelectric sensor. In
SINGLE PYRO Mode, Pin 4 (ANA3) must be externally tied to VREF on Pin 3 (PB5/VREF).
PB5 will be configured as VREF output by the PIR engine when it is enabled.
In DUAL PYRO Mode (which supports 2 pyroelectric sensors), Pin 4 (ANA3) is used for
second sensor. In this mode, the Pin 3 VREF signal is not connected externally to any
other ADC inputs and is therefore available to the application (PB5/VREF).
19
20
Note: The Z8FS040 MCU is not preprogammed with application code. A generic version of the
ZMOTION Detection source code (RD0026-SC01) can be downloaded from zilog.com
and programmed into the MCU.
There are two sections to the API: Standard API Registers and Advanced API Registers.
Each is described below.
Standard API registers. These registers include all of the status and control functions
required by most applications. These include sensitivity control, motion detection/direc-
tion status and operational modes.
Advanced API registers. These registers provide additional control over the PIR engine
operation and allows it to be configured to support the pyroelectric sensor and lens being
used in the application.
21
PIR Enable Pattern to the PIR Engine Enable register, and then execute this Macro. ADC
conversions are started by this macro.
EPIR_INIT Macro:
PUSHX RP
LDX RP, #%E0
CALL %1FFD
POPX RP
EPIR_ADC_ISR Macro. This macro is executed for each ADC conversion. The applica-
tion handles the ADC interrupt and executes this macro. All motion detection processing
is performed by this macro.
EPIR_ADC_ISR Macro:
PUSHX RP
LDX RP, #%E0
CALL %1000
POPX RP
The CPU cycles used by the EPIR_ADC_ISR macro vary depending on Engine state and
configuration.
22
Bit 7 6 5 4 3 2 1 0
Field PIR Enable/Disable Pattern
Control Read/Write
Address 100H
23
Bit 7 6 5 4 3 2 1 0
Field Sensitivity
Default U U U U U U U U
Control Read/Write
Address 101H
24
Bit 7 6 5 4 3 2 1 0
Field Extended Detection Engine MD Motion Motion Motion PIR Stable
Disabled Suspend Direction Direction Detected
Control
Control R/W R R/W R/W R R/W R
Address 102H
25
MD Suspend (Bit 4)
Motion Detection Suspend; controlled by the application.
• Temporarily suspends the PIR engine from running. This puts it in a very low processing overhead
state and can be used when the application requires significant CPU processing power. While
suspended, motion detection is disabled, however to ensure fast recovery from this mode, ADC
interrupts still occur and samples continue to be buffered. When the application clears this bit,
SUSPEND Mode is exited upon the next ADC interrupt.
0 = Normal Motion Detection.
1 = Suspended Motion Detection.
Motion Direction Control (Bit 3)
Motion Direction Control Enable; controlled by the application.
• This bit enables directional motion detection. The relative direction of the detected motion is indicated
in bit 2 (Motion Direction) of this same register. When configured as a directional detector (bit 3 set
to 1), direction is indicated in bit 2 as positive or negative relative to the PIR sensor.
0 = Standard Motion Detection Mode. Motion detected in any direction. Motion Direction status bit
(Bit 2) is not valid.
1 = Directional Motion Detection Mode. Motion is detected in any direction; relative direction is
indicated via Motion Direction status bit (Bit 2).
• The directional polarity of PIR sensors is arbitrary at the time of manufacturing. Therefore it is
necessary for the user application to calibrate to each individual PIR sensor using a controlled target
(i.e. moving in a known direction) and internally record the polarity to identify which polarity represents
that direction.
Motion Direction (Bit 2)
Relative Direction of Last Motion Detected; controlled by the PIR engine.
When directional motion detection is enabled, this bit indicates the relative direction of the last motion
detected. When the PIR engine sets the Motion Detected bit in PIR Status Register 0, this bit is set or
cleared to indicate the direction of the motion. The status is latched until the user application clears the
Motion Detected bit.
0 = Last detected motion was negative.
1 = Last detected motion was positive.
This status bit is undefined when Motion Direction Control is disabled.
Motion Detected (Bit 1)
Motion Detected on PIR Sensor
Set by the PIR engine; cleared by the application.
This bit indicates that the Engine has detected a motion event. The user application should routinely
check this bit to determine if motion has been detected. This bit is set by the Engine and must be
cleared by the user application.
0 = No motion detected by the Engine.
1 = Motion has been detected by the Engine.
26
Bit 7 6 5 4 3 2 1 0
Field Engine Frequency Response PIR Scan Reserved Dual Pyro
Timer Tick Rate Enable
Control R/W Read/Write R/W 0 R/W
Address 103H
27
Note: Lower programmed values also have the effect of reducing the relative range of detection.
PIR Scan Rate (Bit 2)
PIR ADC conversion rate for the Pyroelectric Sensor; controlled by the application.
• The PIR engine performs the necessary ADC conversions on the PIR sensor input. Each conversion
generates an interrupt that is processed by the PIR engine from the EPIR_ADC_ISR macro. The PIR
Scan Rate bit determines the rate at which the ADC conversions are generated.
• In NORMAL SCAN RATE Mode (PIR Scan Rate set to 0), the Z8FS040 ADC peripheral is set to
CONTINUOUS CONVERSION Mode, which causes a conversion to be carried out automatically
every 256 system clocks. In this mode, the application is only required to execute the EPIR_ADC_ISR
macro for each ADC interrupt. The ADC continually runs and continuously generates interrupts.
• When LOW SCAN RATE Mode is selected by setting this bit to a 1, CONTINUOUS CONVERSION
Mode is disabled and the ADC is operated in SINGLE-SHOT Mode such that each conversion takes
5129 system clocks to complete. In this mode, the application software must initiate the ADC
conversion request (set bit 7 of ADCCTL0) and execute the EPIR_ADC_ISR macro once every 5mS.
• In LOW SCAN RATE Mode, the ADC is disabled between conversions to reduce power consumption.
Power consumption can be reduced further if the application software uses this mode in conjunction
with the CPU’s Halt or Stop modes. Alternately, this mode can be used to provide the application
software with additional CPU processing time.
• Although the LOW SCAN RATE Mode provides the application with more processing power and the
opportunity for the system to reduce power consumption, the normal scan rate will provide better
sensitivity and range. While operating in LOW SCAN RATE Mode, sensitivity is reduced by
approximately 20%. The performance of Direction Detection may also be reduced in this mode. EMC
immunity is disabled while in LOW SCAN RATE Mode.
• If the PIR Scan Rate bit is changed during engine operation, the engine will stop detecting motion for
up to 200mS to avoid potential false motion detection. When changing the PIR SCAN RATE Mode,
the Advanced API registers must first be updated with the appropriate values.
0 = NORMAL SCAN RATE Mode
1 = LOW SCAN RATE Mode
28
Reserved (Bit 1)
DUAL PYRO Mode (Bit 0)
Dual Pyroelectric Sensor Signaling Mode; controlled by the application.
• This bit determines if the PIR engine should accept signals from one or two pyroelectric sensors.
• When configured for single pyro operation, only one sensor is used (connected to ANA2). When
configured for dual pyro operation, the engine will scan two sensors simultaneously. DUAL PYRO
Mode is typically used to provide a larger area of coverage. The second pyroelectric sensor is
connected to input ANA3. In DUAL PYRO Mode, motion on either sensor will generate a motion
detected event.
0 = SINGLE PYROELECTRIC SENSOR Mode.
1 = DUAL PYROELECTRIC SENSOR Mode.
Bit 7 6 5 4 3 2 1 0
Field Reserved Range Control
Control 0 Read/Write
Address 104H
Bit 7 6 5 4 3 2 1 0
Field ANA7 ANA6 ANA5 ANA4 Reserved Reserved ANA1 ANA0
Scan Scan Scan Scan Scan Scan
Request Request Request Request Request Request
Control R/W R/W R/W R/W 0 0 R/W R/W
Address 105H
29
Bit 7 6 5 4 3 2 1 0
Field Reserved ANA6 ANA5 ANA4 Reserved Reserved ANA1 ANA0
Scan Scan Scan Scan Scan
Request Request Request Request Request
Control 0 R/W R/W R/W 0 0 R/W R/W
Reserved
in SINGLE
PYRO
Mode
Address 105H
Bit 7 6 5 4 3 2 1 0
Field Reserved Reserved Reserved Reserved ANA3 Reserved ANA1 ANA0
Scan Scan Scan
Request Request Request
Control 0 0 0 0 R/W 0 R/W R/W
Reserved
in
DUAL
PYRO
Mode
Address 105H
30
31
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Field ADC Result Value
Control Read
Bit 7 6 5 4 3 2 1 0
Field Version
Control Read
Address 10CH
32
33
Bit 7 6 5 4 3 2 1 0
Reserved Reserved Reserved Buffer New MD Origin EM Noise EM
Refresh Sample Detected Transient
Field Detected
Control 0 0 0 R/W R/W R R/W R/W
Address F0H
34
MD Origin (Bit 2)
Origin of last motion detection event; controlled by the PIR engine.
This bit indicates how the PIR engine detected the last Motion Detected Event. When the engine sets
the Motion Detected bit in PIRStatus0, it also sets this bit according to which detection engine
registered the event.
0 = Normal Motion Detector.
1 = Extended Motion Detector.
EM Noise Detected (Bit 1)
EM Noise Detected on PIR Signal
Set by the PIR engine; cleared by the application.
• This bit indicates if the engine has detected noise on the PIR signal. This event is provided to the user
application to indicate that an EM noise event has occurred and associated motion event(s) may have
been suppressed by the engine. This bit does not have to be read for normal operation and is
provided as status only. The application must clear this bit after it has been read.
EM Transient Detected (Bit 0)
EM Transient Detected on PIR Signal
Set by the PIR engine; cleared by the application.
• This bit indicates if the Engine has detected a transient on the PIR signal. This event is provided to
the user application to indicate that an EM transient event has occurred and associated motion
event(s) may have been suppressed by the engine. This bit does not have to be read for normal
operation and is provided as status only. The application must clear this bit after it has been read.
Bit 7 6 5 4 3 2 1 0
Field Lock level Window Size Window Update Rate
Address F2H
35
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Field PIR Process Rate
Control Read
Address F3H F4H
36
Bit 7 6 5 4 3 2 1 0
Field PIR Sample Size
Control Read/Write
Address F5H
Bit 7 6 5 4 3 2 1 0
Field PIR Debounce Time
Control Read/Write
Address F6H
37
Bit 7 6 5 4 3 2 1 0
Field PIR Debounce Batch Size
Control Read/Write
Address F7H
Bit 7 6 5 4 3 2 1 0
Field Reserved PIR Transient Sensitivity
Control 0 Read/Write
Address F8H
Reserved (Bit 7)
Transient Sensitivity (Bits 6–0)
Controlled by the application.
This register determines how sensitive the transient detection part of the engine is to sudden changes
in the PIR signal. A lower number makes the engine more sensitive, at the cost of potential rejection of
large signal motion (ex. warm target very close to detector).
The valid range is 0 (disabled) to 64h.
38
Bit 7 6 5 4 3 2 1 0
Field Reserved PIR Noise Sensitivity
Control 0 Read/Write
Address F9H
Reserved (Bit 7)
Noise Sensitivity (Bits 6–0)
Controlled by the application.
This register determines how sensitive the noise detection part of the engine is to random noise in the
PIR signal. A lower number makes the noise detector more sensitive, at the cost of potential rejection
of small-signal motion (for example, a small delta between ambient and target temperature or distant
target). The valid range is 0 (disabled) to a maximum value determined by the Window Size selected in
the PIR Advanced Status/Control Register 2. See Table 26.
39
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Field PIR Signal
Control Read
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Field PIR Signal DC
Control Read
40
Packaging
Zilog’s ZMOTION Detection and Control Family takes advantage of the Z8FS040 MCU,
which is available in the following packages:
• 8-pin Small Outline Integrated Circuit Package (SOIC)
• 20-pin Small Shrink Outline Package (SSOP)
• 28-pin Small Shrink Outline Package (SSOP)
Current diagrams for each of these packages are published in Zilog’s Packaging Product
Specification (PS0072), which is available free for download from the Zilog website.
Ordering Information
The ZMOTION Detection and Control Series comprises a number of product combina-
tions that include the ZMOTION MCU plus a number of selectable lens and pyroelectric
sensor options. Construct your part number based on the specific combination of MCU,
lenses and PIR sensors you wish to order.
Each character in the Zilog part numbering schema corresponds to a designated part attri-
bute. To aid in determining the appropriate part(s) to order, Table 29 breaks down a typical
ZMOTION product number (as differentiated from an MCU part number) by character
position to include the specific ZMOTION product, its package, and any lens and pyro
options you choose. Each of these character positions is further described in Tables 30
through 34.
Position 1 2 3 4 5 6 7 8 9 10 11 12 13
MCU
Field Z M O T MCU Lens PIR G
Package
Selectable Options
PS028514-0917 Packaging
ZMOTION Detection and Control Family
Product Specification
41
Note: The Z8FS040 MCU is not preprogammed with application code. A generic version of the
ZMOTION Detection source code (RD0026-SC01) can be downloaded from zilog.com
and programmed into the MCU.
42
Refer to the ZMOTION Lens and Pyroelectric Sensor Product Specification (PS0286) for
detailed descriptions about the lens and pyroelectric sensors used in the above ZMOTION
products.
43
Ordering Example
The figure helps determine the part for an example 8-pin SOIC ZMOTION product bundled
with an 88° Fresnel Technologies Animal Alley Array Lens and a Nicera Premium Dual
Element PIR Sensor; the resulting ZMOTION product number is ZMOT0BSB0A0BG.
Pos #: 1 2 3 4 5 6 7 8 9 10 11 12 13
IC
Fi el d Z M O T IC Lens PIR G
P KG
Example Z M O T 0 B S B 0 A 0 B G
RoH S
PIR Se nso r (SDA0 2-54 -P)
Len s (AA 0.9 GI T1 )
IC Pa ckage (8 Pi n, SOIC)
IC (Occup ancy, S/W Versi on 2.00 )
ZMo ti on Prod uct Fami ly
To learn more about ordering the ZMOTION that’s right for your application require-
ments, please consult your local Zilog Sales office. The Zilog Worldwide Sales Locations
page on zilog.com lists all regional offices and can connect you to additional product
information.
44
Related Documents
Additional information can be found in the following documents, available from the Zilog
website at www.zilog.com.
Document
Number Description
AN0301 Power Management and Customer Sensing with Zilog’s ZMOTION Detection Module
Application Note
AN0307 ZMOTION Detection Module Application Walkthrough Application Note
AN0309 High Brightness LED Reference Design Application Note
PB0223 ZMOTION Detection Module Product Brief
PB0225 ZMOTION Detection and Control Product Brief
PS0228 Z8 Encore! XPF082A Series Product Specification
PS0284 ZMOTION Detection Module Product Specification
PS0286 ZMOTION Lens and Pyroelectric Sensor Product Specification
QS0073 ZMOTION Detection Module Evaluation Kit Quick Start Guide
QS0076 ZMOTION Detection and Control Development Kit Quick Start Guide
UM0223 ZMOTION Detection Module Evaluation Kit User Manual
UM0230 ZMOTION Detection and Control Development Kit User Manual
WP0017 A New PIR Motion Detection Architecture White Paper
WP0018 ZMOTION Detection Lens and Pyro Sensor Configuration Guide
45
46
VDD (3 .3V)
1uF
10K 10 K
1 8
VDD VSS
Debug Header
2 7
PA 0/T0 IN/T0OUT/XIN //DBG PA5/TXD0/T1OUT/ANA0 /CINP
1 3 PA1/T0OU T/XOUT/ANA3/VR EF/CLKIN PA4/RXD 0/ ANA1/ CINN 6
VCC
2 4 5
RESET PA2 /RESET/D E0/T1OU T ANA2
3
GND Z8FS040xSB20EG
4
DBG
VD D (3 .3V)
470
5
GND
6
NC To Second Pyro Electric
Sensor in Dual Pyro Mode Pyro Electric
VD D Sensor Status LED
SIG
1uF
GN D 47K
Figure 7. Required Circuit Connections for the Z8FS040xSB20EG(8-Pin) Motion Detection MCU
20-Pin Z8FS040xHH20EG
The 20-pin Z8FS040xHH20EG part offers both dual and quad pyroelectric sensors; each
of these modes is described in this appendix.
47
and Reset signals as required for the Debug interface. All other signals may be used as
required. The power supply design is left to the application requirements.
VDD (3. 3V )
VDD (3.3V )
V DD (3.3V )
VDD (3 .3V )
Status LED
Pyro Electric
10K 10 K
Sensor
V DD
1 20
PB 1/ ANA 1 PB 0/ ANA 0
2 19
Debug Header
SI G ANA 2 PC 3/CO UT
1uF
3 18 1
ANA 3 PC 2/A NA6 /LED /V R EF VCC
47 K
GND 4 17 2
V DD P C 1/ ANA 5/CI NN RES ET
5 16 3
PA 0/ T0I N/T 0OU T/X IN P C0/ ANA 4/ CI NP GND
1 uF
6 15 4
PA 1/T 0OUT /XO UT DB G DBG
7 14 5
VSS RES ET / PD0 GND
8 13 6
P A 2/DE0 PA7 /T 1O UT NC
9 12
PA 3/CT S0 PA 6/ T1I N/T 1O UT
10 11
PA 4/ RXD0 PA 5/ T XD0
Z8FS040xHH020EG
48
V DD (3. 3V)
V DD (3.3V )
V DD (3. 3V )
VDD (3. 3V)
Status LED
Pyro Electr ic
Sensor 1
VDD
1 PB 0/ANA 0 20
P B 1/ ANA 1
10K
Debug H eader
2 19 10K
SIG A NA 2 PC3/ COUT
1uF
3 18 1
A NA 3 P C2/A NA 6/ LE D/ VR EF VCC
47 K
GND 4 VDD PC1/A NA 5/ CI NN 17 2 RESE T
5 16 3
P A 0/ T 0I N/T0 OUT/ XIN P C0/A NA4/ CINP GND
1 uF
6 15 4
PA 1/ T0OUT/ XOUT DB G DBG
7 14 5
VS S RESE T /PD0 GND
8 13 6
PA 2/DE 0 P A7/ T1OUT NC
9 12
V DD (3. 3V ) PA 3/CT S0 PA 6 /T1IN/ T1OUT
10 11
P A4/ RXD0 P A5/ TXD0
SIG
1uF
47K
GND
28-Pin Z8FS040xHJ20EG
The 20-pin Z8FS040xHH20EG part offers both dual and quad pyroelectric sensors; each
of these modes is described in this appendix.
49
and Reset signals as required for the Debug interface. All other signals may be used as
required. The power supply design is left to the application requirements.
VDD (3 .3V)
VDD (3.3V )
VDD (3.3V)
Pyro Electric
Sensor Status LED
VD D
1 28
SIG AN A2 PB1/ANA1
1uF
2 PB4/ANA7 PB0/ANA0 27
GN D
Debug Header
47K VDD (3 .3V) 3 PB5/V PC 3/C OUT 26 10K 10K
R EF
4 AN A3 PC2/ANA6 25 1 VCC
5 24 2
AVDD PC1/ANA 5/CIN N RESET
6 23 3
VDD PC0/ANA4/CIN P GND
1uF 7 22 4
PA0/T0IN/T0OU T/XIN DBG DBG
8 PA 1/T0 OUT/XOUT RESET/PD 0 21 5 GND
9 20 6
VSS PC 7 NC
10 19
AVSS PC 6
11 PA 2/ DE0 18
PA7/T1 OUT
12 PC 5 17
PA3/CTS0
13 PA 4/RXD0 PC 4 16
14 PA5/TXD0 PA6/T1IN /T1 OUT 15
Z8FS040xHH020EG
50
V DD (3 .3V )
V DD (3.3 V)
Senso r 1
VDD St atus LE D
1 28
S IG ANA 2 PB 1/A NA 1
1uF
2 27
PB 4/A NA 7 PB0 /A NA 0
GND 47K 10 K 10K D ebug H eader
3 26
PB 5/V R EF P C3/ COUT
V DD (3. 3V) 4 25 1
ANA 3 PC2/ ANA 6 V CC
5 24 2
A VDD PC1 /A NA5 /CIN N R ESE T
6 23 3
VD D PC0/ A NA4 /CIN P G ND
1 uF 7 22 4
PA 0/ T0I N/T0OUT / XI N DB G D BG
8 21 5
P A1 /T0OUT / XOUT RES ET / PD0 G ND
9 20 6
VS S PC 7 NC
Pyro Electric 10 19
AV SS PC 6
Sensor 2 11 18
V DD P A 2/DE 0 PA7 /T 1OU T
12 17
P A 3/ CTS 0 PC 5
SIG
13 16
P A 4/ RXD0 PC 4
14 15
GN D P A 5/ TX D0 PA 6 /T 1I N/T 1OUT
47 K
51
Observe the following procedure to initialize the PIR engine – a process that is common to
both the Normal Scan Rate and Low Scan Rate modes:
1. Set up the API control registers (standard and advanced).
2. Initialize the FFREQH and FFREQL registers with the MCU clock frequency.
3. Write the PIR Enable Pattern to the PIR Enable Register.
4. Call PIR Init.
52
The flow diagram in Figure 15 shows the general software operation for NORMAL
SCAN RATE Mode.
53
RESET
Application
Initialization
1 Second
Timer Interrupt
HALT
(Optional)
Main O ne
Set bit 7 of ePIR_SC1
Ap plication (Engine Timer Tick)
Se cond
Loop Monitor ePIR Timer Tick
API for Events
Return
User
Application
Code
54
The flow diagram in Figure 16 shows the general software operation for LOW SCAN
RATE Mode.
RESET
Enter ADC
Initializ e Flash Frequency Register Interrupt
Enable ADC in PWRCTL0
5 Millis econd
Set up Timer for 5 Millisecond Interrupt Timer Interrupt
Enable Global Interrupts
Start next ADC 5 Millisecond
Sample ADC Scan
Application Execute
Initialization EPIR_ADC_ISR
Macro
HALT
(Optional) Yes
Main
Application One Second
Loop Monitor ePIR Set bit 7 of ePIR_SC1 Timer Tick
API for Events (Engine Timer Tic k)
User
Application
Code Return
55
56
– Address range 10h to 1Fh is the working register group reserved for first level
interrupt
– If more than 1 level of interrupt nesting is required by the application, the 20h
must be increased by 10h for every additional nesting level.
– Address range F0h to FFh contains the Advanced API Registers
• SP = 80h
– Defined in startupePIR.asm
– First stack location is 7Fh and it grows down
• RP = 00h
– Defined in startupePIR.asm
– The application code uses working register group 0
• __intrp = 10h
– Defined in startupePIR.asm
– First level interrupt uses working register group 1
• Engine RP = E0h
– This is the working register group used by the PIR engine
– Defined by the Engine Entry macro's EPIR_INIT and EPIR_ADC_ISR
57
Configuration Pyroelectric
Part Number Description Typical Applications Header File Sensor
AA 0.9 GI T1 Animal Alley Array (88o) Corner wall mount or very ePIR_INIT_01.h RE200B-P
Lens • 35.6mm x 49.9mm Flat high ceiling with
Specification Fresnel rectangular floor pattern
• 22.9mm Focal Length • Warehouse Lighting
SDA02-54-P
• 25 Meter Range (Bay Light)
• 22 equal segments • Combined Intrusion
and Lighting Control
• HVAC
CM 0.77 GI V3 Ceiling Mount Array Ceiling Mount for ePIR_INIT_02.h RE200B-P
Lens (360o) standard commercial
Specification • 37mm diameter circular heights
lens • Lighting Control
SBDI46-504AA
• 19.6mm focal length • HVAC Control
• 3.7m radius at 2.4m • Meeting rooms
height
• 3:1 floor coverage
diameter to height ratio
CM 0.77 GI V5 Ceiling Mount Array High ceiling mount for ePIR_INIT_03.h RE200B-P
Lens (360o) commercial and industrial
Specification • 37mm diameter circular applications
lens • Commercial Lighting SBDI46-504AA
• 19.6mm focal length Control
• 12.2m radius at 12.2m • Commercial HVAC
height Control
• 2:1 floor coverage
diameter to height ratio
58
Table 35. ZMOTION Lens and Pyroelectric Sensor Selection Guide (Continued)
Configuration Pyroelectric
Part Number Description Typical Applications Header File Sensor
CWM 0.5 GI Ceiling/Wall Mount Array Wall or ceiling mount for ePIR_INIT_04.h RE200B-P
V1 Lens (180o) office or meeting room
Specification • Circular lens with • Room Lighting and
24mm x 24mm square HVAC Control SBDI46-504AA
base
• 14.2mm focal length
• Board mount clip-in
NCL-9(26) Clip-on 15mm Array Room Occupancy and ePIR_INIT_05.h RE200B-P
Lens (360o) Proximity Sensing
Specification • Clips on to pyroelectric • Lighting Control
sensor • HVAC Control SBDI46-504AA
• 2.25m radius at 2m • Appliance
height • Kiosk/Display Control
• 2.1:1 Floor coverage • Vending Power
diameter to height ratio Management
Appliance
• Power Management
NCL-3B Lens 10mm wall mount array Proximity or Entrance ePIR_INIT_06.h RE200B-P
Specification (60° x 60°) Detection
• Clips on to pyroelectric • Kiosk
sensor • Vending
• 4 beams (X); 2 beams • HVAC
(Y) • Display counters
• 10m range
59
Table 35. ZMOTION Lens and Pyroelectric Sensor Selection Guide (Continued)
Configuration Pyroelectric
Part Number Description Typical Applications Header File Sensor
NCL-3R Lens 10mm ceiling/wall mount Room occupancy and ePIR_INIT_08.h RE200B-P
Specification array (360°) proximity sensing
• Clips on to pyroelectric • Lighting control
sensor • HVAC control SBDI46-504AA
• 2:1 diameter-to-height • Appliances
coverage • Kiosk/display control
• 14 zones • Vending power
• 5 meter range management
NCL-10S Lens 10mm wall mount array Entrance detection with ePIR_INIT_09.h RE200B-P
Specification (18°) directional detection
• Clips on to pyroelectric • Kiosk/display counters
sensor • Vending
• 2 beams X (27°) • HVAC
• 1 beam Y (18°) • Entrance/access
• 10 meter range control
60
Customer Support
To share comments, get your technical questions answered, or report issues you may be
experiencing with our products, please visit Zilog’s Technical Support page at
http://support.zilog.com.
To learn more about this product, find additional documentation, or to discover other fac-
ets about Zilog product offerings, please visit the Zilog Knowledge Base or consider par-
ticipating in the Zilog Forum.
This publication is subject to replacement by a later edition. To determine whether a later
edition exists, please visit the Zilog website at http://www.zilog.com.