0% found this document useful (0 votes)
18 views68 pages

PS0285

Uploaded by

tastymakaroni
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views68 pages

PS0285

Uploaded by

tastymakaroni
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 68

Z8FS040

ZMOTION® Detection and


Control Family Featuring
PIR Technology
Product Specification
PS028514-0917

Copyright ©2017 Zilog, Inc. All rights reserved.


www.zilog.com
ZMOTION Detection and Control Family
Product Specification

ii

Warning: DO NOT USE THIS PRODUCT IN LIFE SUPPORT SYSTEMS.

LIFE SUPPORT POLICY


ZILOG’S PRODUCTS ARE NOT AUTHORIZED FOR USE AS CRITICAL COMPONENTS IN LIFE
SUPPORT DEVICES OR SYSTEMS WITHOUT THE EXPRESS PRIOR WRITTEN APPROVAL OF
THE PRESIDENT AND GENERAL COUNSEL OF ZILOG CORPORATION.

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

PS028514-0917 Revision History


ZMOTION Detection and Control Family
Product Specification

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

PS028514-0917 Table of Contents


ZMOTION Detection and Control Family
Product Specification

Customer Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60

PS028514-0917 Table of Contents


ZMOTION Detection and Control Family
Product Specification

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

PS028514-0917 List of Figures


ZMOTION Detection and Control Family
Product Specification

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

PS028514-0917 List of Tables


ZMOTION Detection and Control Family
Product Specification

viii

Table 34. PIR Sensor Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42


Table 35. ZMOTION Lens and Pyroelectric Sensor Selection Guide . . . . . . . . . . . . . . 57

PS028514-0917 List of Tables


ZMOTION Detection and Control Family
Product Specification

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

• High performance eZ8® CPU core


• 4 KB in-circuit programmable Flash available for application code
• Single-pin debug with unlimited breakpoints
• Flexible clocking scheme
• Internal precision oscillator running at 5.53 MHz
• External oscillator operating up to 20 MHz
• Sigma Delta ADC
• Up to 6 channels single-ended or 3 channels differential available
• On-chip analog comparator with independent programmable reference voltage
• Full-duplex UART with dedicated BRG
• Two 16-bit timers with input capture, output compare, and PWM capability (11 modes
total)
• Watchdog timer (WDT) with dedicated internal oscillator
• Up to 20 vectored interrupts
• 6 to 25 I/O pins depending upon package
• 2.7 V to 3.6 V operating voltage with extended operating temperature range –40°C to
+105°C
• Zilog’s PIR technology controlled and monitored through software API registers
• Select from an assortment of lenses and pyroelectric sensors to best fit your application
• API settings provided for each lens and pyroelectric sensor combination
• Directly supports 1 or 2 pyroelectric sensors
• Sensitivity control, range control and directional detection
• Extended detection modes for occupancy sensing
• Low power modes

PS028514-0917 Features
ZMOTION Detection and Control Family
Product Specification

Z8FS040 MCU Block Diagram


Figure 1 displays a block diagram of the Z8FS040 MCU.

POR
Interrupt & VBO WDT +
PIR Controller Low Power External
Engine Oscillator XTAL/RC
Oscillator
Register
File RAM 4KB eZ8
TM

Flash On-Chip Oscillator


(256B)
Controller
Flash
Debug CPU Control 5.53 MHz
+ Memory Internal
API Oscillator

Program Memory Bus

Register File Bus

UART Comp ADC On-Chip


& BRG VREF VREF Peripheral
Timer 0 Timer 1 Power
Control

Comparator Sigma/Delta
IrDA ADC

GPIO

Figure 1. Z8FS040 MCU Block Diagram

PS028514-0917 Z8FS040 MCU Block Diagram


ZMOTION Detection and Control Family
Product Specification

MCU Part Selection Guide and Reference


The ZMOTION MCU is packaged in three forms to suit differing application require-
ments, as follows:
The ZMOTION Dedicated Silicon and Optimized Software Solution. A general-pur-
pose MCU with motion detection software and API stack.

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.

Table 1. Z8FS040 MCU Package Availability

ZMOTION MCU Z8 Encore XP Flash ADC


Part Number Base Part Number Memory GPIO Channels Package
Z8FS040xSB20EG Z8F082ASB020EG 4 KB 5 3 8-pin SOIC
Z8FS040xHH20EG Z8F082AHH020EG 4 KB 16 4 20-pin SSOP
Z8FS040xHJ20EG Z8F082AHJ020EG 4 KB 22 6 28-pin SSOP
Note: x = PIR Technology Revision Identifier (see Table 2).

Table 2. PIR Technology Revision Identifiers

Part Number Engine


Version Revision Identifier Description

PS028514-0917 MCU Part Selection Guide and Reference


ZMOTION Detection and Control Family
Product Specification

Table 2. PIR Technology Revision Identifiers


1.00 A Initial release for ZEPIR0AAS01SBCG, 8-pin version only.

2.00 B ZMOTION MCU Series release features improved detection/stability,


added range; low power, extended detection, dual pyro capability;
advanced API features. Revised Z8FS040x part numbering schema.

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.

PS028514-0917 MCU Part Selection Guide and Reference


ZMOTION Detection and Control Family
Product Specification

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

Figure 2. 8-Pin SOIC Package Diagram – Z8FS040xSB20EG

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

Figure 3. 20-Pin SSOP Package Diagram – Z8FS040xHH20EG

PS028514-0917 Pin Configurations


ZMOTION Detection and Control Family
Product Specification

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

Figure 4. 28-Pin SSOP Package Diagram – Z8FS040xHJ20EG

PS028514-0917 Pin Configurations


ZMOTION Detection and Control Family
Product Specification

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.

Table 3. Z8FS040 MCU Signal Descriptions

Signal Mnemonic I/O Description


General-Purpose I/O Ports A–D
PA[7:0] I/O Port A. These pins are used for general-purpose I/O.
PB[5:0] I/O Port B. These pins are used for general-purpose I/O.
PC[7:0] I/O Port C. These pins are used for general-purpose I/O.
PD[0] O Port D. This pin is used for general-purpose output only.
UART Controllers
TXD0 O Transmit Data. This signal is the transmit output from the UART and
IrDA.
RXD0 I Receive Data. This signal is the receive input for the UART and IrDA.
CTS0 I Clear To Send. This signal is the flow control input for the UART.
DE O Driver Enable. This signal allows automatic control of external RS-485
drivers. It is approximately the inverse of the Transmit Empty (TXE) bit in
the UART Status 0 Register. The DE signal can be used to ensure that
the external RS-485 driver is enabled when data is transmitted by the
UART.
Timers
T0OUT/T1OUT O Timer Output 0–1. These signals are outputs from the timers.
T0OUT/T1OUT O Timer Complement Output 0–1. These signals are output from the timers
in PWM DUAL OUTPUT Mode.
T0IN/T1IN I Timer Input 0–1. These signals are used as the capture, gating and
counter inputs.
Comparator
CINP/CINN I Comparator Inputs. These signals are the positive and negative inputs to
the comparator.
COUT O Comparator Output.

PS028514-0917 Signal Descriptions


ZMOTION Detection and Control Family
Product Specification

Table 3. Z8FS040 MCU Signal Descriptions (Continued)

Signal Mnemonic I/O Description


Analog
ANA[7:0] I Analog Port. These signals are used as inputs to the analog-to-digital
converter (ADC).
VREF I/O Analog-to-digital converter reference voltage input, or buffered output for
internal reference.
Oscillators
XIN I External Crystal Input. This is the input pin to the crystal oscillator. A
crystal can be connected between it and the XOUT pin to form the
oscillator. In addition, this pin is used with external RC networks or
external clock drivers to provide the system clock.
XOUT O External Crystal Output. This pin is the output of the crystal oscillator. A
crystal can be connected between it and the XIN pin to form the
oscillator.
Clock Input
CLKIN I Clock Input Signal. This pin may be used to input a TTL-level signal to be
used as the system clock.
LED Drivers
LED O Direct LED drive capability. All port C pins have the capability to drive an
LED without any other external components. These pins have
programmable drive strengths set by the GPIO block.
On-Chip Debugger
DBG I/O Debug. This signal is the control and data input and output to and from
the On-Chip Debugger.
The DBG pin is open-drain and requires a pull-up resistor to ensure
Caution: proper operation.

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.

PS028514-0917 Signal Descriptions


ZMOTION Detection and Control Family
Product Specification

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.

A memory map of the Z8SF040 MCU is illustrated in Figure 5.

1FFFh

Reserved for
PIR Engine

1000h
0FFFh

User Application
Code Space
(4033 bytes)

003Eh
003Dh
Interrupt Vectors
and Option Bits
0000h

Figure 5. Z8FS040 MCU Program Memory Map

PS028514-0917 Memory Map


ZMOTION Detection and Control Family
Product Specification

11

RAM Memory Map (Register Files)


There is a total of 1 KB of RAM available on the base Z8F082A device. Some of this
RAM (from 080h to 0EFh and from 190h to 3FFh) is used by Zilog’s PIR technology.
The remainder of the RAM, from 000h to 07Fh and from 110h to 18Fh (256 bytes) is
available to the application. The MCU Control Registers are located at the top of memory,
from F00h to FFFh, and are also available to the application. The area from 400h to EFFh
contains no device memory. See Figure 6.

FFFh
MCU
Control Registers
F00h
EFFh

400h
3FFh

Reserved for PIR Engine

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

Figure 6. Z8FS040 MCU RAM Memory Map

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

PS028514-0917 Memory Map


ZMOTION Detection and Control Family
Product Specification

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.

Table 4. Peripheral Availability

Device
Z8FS040xSB20EG Z8FS040xHH20EG Z8FS040xHJ20EG
Base MCU Device Z8F082ASB020EG Z8F082AHH020EG Z8F082AHJ020EG

Pins/Package 8 pin SOIC 20-Pin SSOP 28-Pin SSOP


ADC ANA2 is used for PIR ANA2 is used for PIR ANA2 is used for PIR
sensor input. sensor input. sensor input.
ANA3 is used for a ANA3 is connected to ANA3 is connected to
second sensor input in ANA6/VREF. VREF.
DUAL PYRO Mode. ANA3 is used for a ANA3 is used for a
second sensor input and second sensor in DUAL
ANA6 becomes available PYRO Mode
in DUAL PYRO Mode.
VREF Internal VREF used by the Internal VREF used by the Internal VREF used by the
PIR engine and set to 1 V. PIR engine and set to 1 V. PIR engine and set to 1 V.
Timer 0 Available to application. Available to application. Available to application.
Timer 1 Available to application. Available to application. Available to application.

PS028514-0917 Peripherals
ZMOTION Detection and Control Family
Product Specification

13

Table 4. Peripheral Availability (Continued)


GP I/O PA3/PA1 are multiplexed PB2, PB3 & PC2 are used PB2, PB3 & PB5 are used
with ANA2/ANA3 and for PIR functions. for PIR functions.
used for PIR sensor input In DUAL PYRO Mode, In DUAL PYRO Mode,
(ANA2 for SINGLE PYRO PC2 becomes available. PB5 becomes available.
Mode and ANA2/ANA3 for
DUAL PYRO Mode).
Low Power Op Amp Not Available Not Available Not Available
Comparator Available to application. Available to application. Available to application.
UART Available to application – Available to application. Available to application.
No CTS.
Temperature Sensor Not available. Not Available. Not Available.
LED Drive — Available to application. Available to application.
WDT Available to application. Available to application. Available to application.

The remainder of this section further describes the differences in application availability
between the 8-pin, 20-pin and 28-pin peripheral sets.

Analog to Digital Signal Conversion


Zilog’s PIR technology requires exclusive access to the ADC peripheral to detect motion.
However, ADC conversions can be requested by the application via the API (PIR Status/
Control Register 3). If it is necessary for the user application to utilize the ADC peripheral
directly, the PIR engine must first be disabled via the PIR Engine Enable Register in the
API. Motion detection is not possible while the PIR engine is disabled. When the user
application is finished with the ADC peripheral, it must reenable the PIR engine.
8-Pin Device. PA3 (ANA2) is reserved as the analog ADC input from the pyroelectric
sensor. Therefore, ANA2 is not available for user applications. Additionally, ANA3 is
used for second-sensor input in DUAL PYRO Mode. All other channels are available to
the user application.

ADC Channel Available to Application


0 Yes
1 Yes
2 No
3 Only in Single Pyro Mode

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.

ADC Channel Available to Application


0 Yes
1 Yes
2 No
3 No
4 Yes
5 Yes
6 Only in
DUAL PYRO Mode

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.

ADC Channel Available to Application


0 Yes
1 Yes
2 No
3 No
4 Yes
5 Yes
6 Yes
7 Yes

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

8-Pin Device The external pin that carries COUT is configured as


ANA2 to support the signal input from the Pyroelectric
sensor. However, the Comparator is still able to
generate an interrupt internally without COUT.
20-Pin Device All external Comparator functions are available for
the user application.
28-Pin Device All external Comparator functions are available for
the user application.

UART

8-Pin Device CTS0 is configured as ANA2 to support the signal


input from the Pyroelectric sensor. It is therefore not
available to the user application. The UART is still
able to function correctly without /CTS when CTSE in
the U0CTL0 register set to 0.
20-Pin Device All external UART functions are available for the user
application.
28-Pin Device All external UART functions are available for the user
application.

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.

FFREQ[15:0] = {FFREQH[7:0],FFREQL[7:0]} = (System Clock


Frequency)/1000

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.

Low-Power Operational Amplifier


The AMPINP signal is multiplexed with ANA2 which is used for the pyro sensor input.
Therefore this peripheral is not available on any of the Z8FS040 devices.

Nonvolatile Data Storage


There is no dedicated nonvolatile data storage on 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.

PS028514-0917 Pin Availability


ZMOTION Detection and Control Family
Product Specification

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).

PS028514-0917 Pin Availability


ZMOTION Detection and Control Family
Product Specification

19

Hardware Connection Requirements


This section describes the required external hardware connection for the ZMOTION MCU
Series.
Pins are automatically configured to their required function when the PIR engine is initial-
ized via the EPIR_INIT macro.
See Appendix A. Application Schematics on page 45 for example schematic diagrams
showing the required connections.
The device can be operated in SINGLE PYRO Mode to support one pyroelectric sensor, or
DUAL PYRO Mode to support two pyroelectric sensors. Both of these modes can be
operated in NORMAL or LOW SCAN RATE modes.
Depending on the application, there can be up to 3 connection requirements supporting
these modes:
Pyroelectric Sensor (PIR Sensor). The signal from the PIR sensor is connected directly
to the ANA2 input of the ADC. The ADC is configured for differential, buffered mode by
Zilog’s PIR technology. The sensor signal should be connected directly to the ADC input
with no additional signal conditioning circuitry unless specified by the pyroelectric sensor
manufacturer.
ADC VREF. The on-chip VREF is configured for 1 V nominal. The PIR Sensor signal is
connected to the “+” differential input of the ADC (ANA2), and the VREF signal is con-
nected to the “–” differential input (ANA3). The 8 pin device has an internal connection
from VREF to ANA3 to support this configuration therefore no external hardware connec-
tion is required. The 20 and 28 pin devices require an external connection from the VREF
out signal to the ADC– (ANA3) input.
Pyroelectric Passive Infrared Sensor #2. In DUAL PYRO Mode, the ADC is still used
in differential, buffered mode (the same as SINGLE PYRO Mode). The signal from the
second PIR sensor is connected to ANA3. The VREF signal is no longer connected to
ANA3 (“–” ADC input). The fist PIR sensor is connected to the “+” ADC input (ANA2)
as it is in SINGLE PYRO Mode. The VREF signal is still used internally for the ADC, but
the external pin is unused in DUAL PYRO Mode.

PS028514-0917 Hardware Connection Requirements


ZMOTION Detection and Control Family
Product Specification

20

Zilog’s PIR Technology and API


The ZMOTION MCU Series is based on the Z8F082A MCU, a member of Zilog’s Z8
Encore! XP product line, and includes the added functionality of a motion detection (PIR)
engine. The PIR engine is located in the upper 4 KB area of the 8 KB device, leaving 4 KB
of code space to the user application. The PIR engine operates in the background and is
controlled and monitored via an Application Programmer Interface (API). The API is a
series of reserved registers in memory.

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.

PIR Engine Timer Tick


Bit 7 of PIR Status/Control Register 1 provides a 1 second time base for the PIR engine to
perform house keeping operations. This bit must be set to 1, once per second by the user
application. The bit is checked and cleared during the EPIR_ADC_ISR routine.

PIR Engine Entry Points


There are two entry points to the PIR engine that are accessed through two predefined
Macros. One is an initialization macro that is used to start the engine and the other is exe-
cuted upon every ADC interrupt. Both macros save and initialize the Register Pointer, per-
form a call to the PIR engine entry point and then restore the Register Pointer before
returning control to the application. It is the responsibility of the application software to
execute these macros at the appropriate time.
EPIR_INIT Macro. This macro is executed to initialize the PIR engine after reset. It is nor-
mally only executed once and is used in conjunction with the PIR Engine Enable register
in the standard API section. The application should initialize all API registers, write the

PS028514-0917 Zilog’s PIR Technology and API


ZMOTION Detection and Control Family
Product Specification

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

CPU Cycles: 261


Peripherals Initialized:
ADC and GPIO depending on API selected options. ADC IRQ set for
medium priority.

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.

PIR Engine CPU Stack Usage


The PIR engine shares the processor stack with the user application. There are no special
requirements on the placement of the stack in memory, but it is essential that the user pro-
vide enough stack space for both the user application and the PIR engine.
The PIR engine requires a maximum 6 bytes of stack.

Standard API Register Set


The Standard API Register Set is a series of registers implemented in the Z8FS040 RAM
that allows the user code to configure and communicate with the PIR engine. The default
values are loaded only when the PIR engine is enabled via the PIR Enable Register.

PS028514-0917 Standard API Register Set


ZMOTION Detection and Control Family
Product Specification

22

Table 5. PIR Engine Standard API Registers

API Register Name Address Mnemonic Description


PIR Engine Enable Register (ePIR_Enable) 100h ePIR_Enable Enable PIR Engine
PIR Sensitivity Register (ePIR_Sensitivity) 101h ePIR_Sensitivity Motion Sensitivity
PIR Status/Control Register 0 (ePIR_SC0) 102h ePIR_SC0 Motion Status and Engine
Mode Control
PIR Status/Control Register 1 (ePIR_SC1) 103h ePIR_SC1 Engine Status and Control
PIR Status/Control Register 2 (ePIR_SC2) 104h ePIR_SC2 Range Control
PIR Status/Control Register 3 (ePIR_SC3) - 105h ePIR_SC3 ADC Scan Request
28-Pin SSOP
PIR ADC Result Value (ePIR_ADC_Result) 10Ah/10Bh ePIR_ADC_Result ADC Scan Result
PIR Version (ePIR_Version) 10Ch ePIR_Version PIR Engine Software
Version

Table 6. PIR Engine Enable Register (ePIR_Enable)

Bit 7 6 5 4 3 2 1 0
Field PIR Enable/Disable Pattern
Control Read/Write

Address 100H

PIR Enable/Disable Pattern (Bits 7–0)


PIR Enable/Disable Register; controlled by the application.
• The PIR Enable Register controls the overall operation of the PIR engine. As an added level of
protection, there are specific 8-bit enable and disable values; all other values are reserved. Reading this
register returns the last value written. Once enabled, the PIR engine reads the application controlled
Status/Control Register values and sets the engine controlled values to their default states.
• To enable the PIR engine, first write the ePIR_ENABLE_PATTERN to the PIR Enable Register, then
execute the EPIR_INIT macro. See Table 7.

Table 7. PIR Software Enable Patterns

Pattern Name Description

PS028514-0917 Standard API Register Set


ZMOTION Detection and Control Family
Product Specification

23

Table 7. PIR Software Enable Patterns


00h ePIR_DISABLE_PATTERN Disables all Engine functions, including motion detection.
Used to temporarily or permanently shut down the engine.
11h ePIR_ENABLE_PATTERN Enables the PIR engine. All primary engine functions as
configured in Engine Status/Control Registers are enabled.
Confirmation of enabled status is provided through Engine
Disabled bit in Status/Control Register 0.

Table 8. PIR Sensitivity Register (ePIR_Sensitivity)

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

Sensitivity (Bits 7–0)


PIR Sensitivity Setting; controlled by the application.
• The PIR Sensitivity Register is used to adjust the sensitivity of the PIR engine to target motion. Lower
values produce higher sensitivity to motion with 00h being the most sensitive and FFh being the least
sensitive. The user application should load this register with the appropriate value to provide the
appropriate sensitivity.
Notes:
1. The setting of this register also affects the range of detection. Lower values increase range and higher values
decrease range.
2. Depending on the lens and pyroelectric sensor used, values above 3Fh may result in very limited detection.

PS028514-0917 Standard API Register Set


ZMOTION Detection and Control Family
Product Specification

24

Table 9. PIR Status/Control Register 0 (ePIR_SC0)

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

Extended Detection Level (Bits 7–6)


Sets the sensitivity level of the extended detector; controlled by the application.
• These 2 bits enhance the motion detection algorithms to detect slower, faster and/or more subtle
motion. The Extended Detection level is selected to provide a balance between additional sensitivity
while maintaining stability (no false detections). In certain applications such as lighting control the
Extended Detection level can be increased after normal motion has been detected. Extended
detection is dependent on the lens pattern used. Smaller lens beams tend to provide more subtle
motion detection.
• The Extended Detection level effects user control over the range provided in ePIR_SC2. As the
Extended Detection level is increased, the Range setting becomes less effective.
00 = Extended Detection Level 0 – Minimum (least sensitive).
01 = Extended Detection Level 1.
10 = Extended Detection Level 2.
11 = Extended Detection Level 3 – High (most sensitive).
Engine Disabled (Bit 5)
PIR Engine Disable/Suspend Acknowledged; controlled by the PIR engine.
• This bit indicates the operational status of and is controlled by the PIR engine. When the engine is
initialized and enabled by loading the PIR Enable Register with the ePIR_ENABLE_PATTERN value,
this bit is cleared to indicate that the Engine is ready. When the Engine is disabled by loading the PIR
Enable Register with the ePIR_DISABLE_PATTERN, it will respond by setting this bit to 1 and
perform no further operations until reenabled. In order for the Engine to detect that it has been
disabled, the user must allow the Engine ADC interrupt to run at least once after loading the PIR
Enable Register with the ePIR_DISABLE_PATTERN.
0 = Engine is enabled and operational.
1 = Engine is disabled and not operational.

PS028514-0917 Standard API Register Set


ZMOTION Detection and Control Family
Product Specification

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.

PS028514-0917 Standard API Register Set


ZMOTION Detection and Control Family
Product Specification

26

PIR Stable (Bit 0)


Passive Infrared (PIR) sensor signal stabilized bit; controlled by the PIR engine.
After periods of nonuse, the PIR sensor will take some time to stabilize before it can be used reliably.
The amount of time is dependant on the PIR Sensor being used and environmental conditions and can
range from a few seconds up to a minute. To relieve the application software from having to assume
the worst case stabilization time, the PIR engine automatically monitors the DC offset of the PIR sensor
and sets this bit when it determines that it has become stable. This bit indicates that the PIR sensor has
stabilized after one of the following conditions:
• After initial power on (cold start).
• After reenabling the Engine via PIR Enable Register.
• After returning from SLEEP Mode.
0 = PIR sensor signal is not stable, motion detected events are not valid.
1 = PIR sensor signal is stable, motion detected events are valid.

Table 10. PIR Status/Control Register 1 (ePIR_SC1)

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

Engine Timer Tick (Bit 7)


PIR One Second Timer Tick
Set by the application; cleared by the PIR engine.
• This bit must be set to 1 one time per second by the user application to provide the engine with a one-
second tick to perform housekeeping operations relating to motion detection. The engine will routinely
poll this bit to obtain a one-second tick. This bit is cleared by the engine.
0 = Cleared by the PIR engine.
1 = A one-second interval has occurred.

PS028514-0917 Standard API Register Set


ZMOTION Detection and Control Family
Product Specification

27

Frequency Response (Bits 6–3)


Frequency Response of PIR engine; controlled by Application
Range: 0h–Ch
• This value determines the frequency response of the motion detection system. Higher values allow
lower frequencies to be accepted by the PIR engine. Lower values cause the Engine to ignore targets
that generate lower frequencies. These targets typically include horizontally oriented objects such as
pets.
• The frequency of the signal that is presented to the PIR engine is largely dependent on the structure
of the PIR lens being used (number and dispersion of beams). A lens with several evenly distributed
beams provides better frequency response performance than a lens with an uneven beam
distribution.

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

PS028514-0917 Standard API Register Set


ZMOTION Detection and Control Family
Product Specification

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.

Table 11. PIR Status/Control Register 2 (ePIR_SC2)

Bit 7 6 5 4 3 2 1 0
Field Reserved Range Control
Control 0 Read/Write
Address 104H

Range Control (Bits 2–0)


Motion Detection Range Control; controlled by the application.
• These bits determine the relative range of motion detection. Larger values decrease the range of
detection.
• Typical values used for Range are dependant on the lens and pyroelectric sensor being used. Range is
also dependent on target size, speed, and relative temperature. For example, a range control setting
that rejects one target of a particular size at a given distance does not guarantee that a larger target will
be rejected at the same distance.

Table 12. PIR Status/Control Register 3 (ePIR_SC3), 28-Pin SSOP

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

PS028514-0917 Standard API Register Set


ZMOTION Detection and Control Family
Product Specification

29

Table 13. PIR Status/Control Register 3 (ePIR_SC3), 20-Pin SSOP

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

Table 14. PIR Status/Control Register 3 (ePIR_SC3), 8-Pin SOIC

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

PS028514-0917 Standard API Register Set


ZMOTION Detection and Control Family
Product Specification

30

ANAx Scan Request


Analog Channel 0, 1, 3–7 Scan Requested Bits
Set by the application; cleared by the PIR engine.
These bits allow the user application to request the Engine to perform an A/D conversion on the
unreserved analog inputs. When requested, the Engine will reconfigure the appropriate I/O pin to a single-
ended, unbuffered input using a 2-volt reference. It will then take the next sample and store it in the PIR
ADC Result Value Registers and clear all ANAx Scan Request bits. The I/O configuration for the ANAx
pin is not returned to its previous configuration by the Engine. If required, the user application must
perform this task.
If multiple request bits are set simultaneously, the Engine will only scan the lowest numbered ADC
channel requested and ignore any other requests. The user application should set one request bit then
poll it to determine when the conversion is complete and the data is ready.
When ADC Scan requests are being serviced by the PIR engine, ADC conversions on the PIR sensor are
suspended. Therefore the user application should be careful not to continuously request ADC Scans. The
Process Rate Register in the Advanced PIR Engine section can be monitored to ensure the Engine is
receiving enough time to perform its required PIR Sensor ADC scans.
0 = No conversion requested/last conversion completed.
1 = Perform a conversion on this channel.

PS028514-0917 Standard API Register Set


ZMOTION Detection and Control Family
Product Specification

31

Table 15. PIR ADC Result Value (ePIR_ADC_Result)

Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Field ADC Result Value

Control Read

Address 10AH 10BH

PIR ADC Result Value (Bits 15–0)


ADC Scan Request Result Value
Controlled by PIR engine
The PIR ADC Result Value contains the result of the last application requested ADC conversion.
The data format is identical to that discussed in the Z8 Encore XP Product Specification (PS0228) for
registers ADCD_H and ADCD_L.
Example for requesting an ANA0 Conversion:
• Set bit 0 (ANA0 Scan Request) in PIR Status/Control Register 3 (ePIR_SC3).
• Wait until the ANA0 Scan Request bit is cleared by the Engine.
• Read the ADC conversion result from the PIR ADC Result Value register
Note: Even though the ADC Result Value is a 16 bit register, atomic operations are not required since the value is only
updated at the request of the application.

Table 16. PIR Version (ePIR_Version)

Bit 7 6 5 4 3 2 1 0
Field Version
Control Read
Address 10CH

Version (Bits 7–0)


PIR engine software version; controlled by the PIR engine.
• The value stored in this register indicates the software version of the PIR engine.
Value PIR Engine Software Version
04h 2.00

PS028514-0917 Standard API Register Set


ZMOTION Detection and Control Family
Product Specification

32

Advanced API Register Set


The registers listed in Table 17 are available for advanced configuration of the PIR engine.
They include customizations for lens and pyroelectric sensor configurations. These regis-
ters, each described in this section, are not initialized by the PIR engine.

Table 17. PIR Engine Advanced Registers

API Advanced Register Name Address Mnemonic Description


PIR Advanced Status/Control Register 0 F0h ePIR_ASC0 EM noise and MD
(ePIR_ASC0) origin status
PIR Advanced Status/Control Register 2 F2h ePIR_ASC2 Window Size, Lock
(ePIR_ASC2) Level, and Window
Update Rate
PIR Process Rate (ePIR_Process_Rate) F3h/F4h ePIR_Process_Rate Relative Processing
available to PIR engine
PIR Sample Size Register F5h ePIR_Sample_Size Controls amount of
(ePIR_Sample_Size) sensor signal
averaging
PIR Debounce Time Register F6h ePIR_Debounce_Time Controls time to
(ePIR_Debounce) Debounce motion
signal
PIR Debounce Batch Size Register F7h ePIR_Debounce_Batch Controls out of window
(ePIR_Debounce_Batch) samples required for
Debounce
PIR Transient Sensitivity Level F8h ePIR_Transient_Sense Sets PIR engine
sensitivity to transient
detection
PIR Noise Sensitivity Level F9h ePIR_Noise_Sense Sets PIR engine
sensitivity to noise
detection
PIR Signal FAh/FBh ePIR_Signal Current Pyro Sensor
signal sample
PIR Pyro DC Signal Level FCh/FDh ePIR_Signal_DC Current calculated Pyro
Sensor DC offset

PS028514-0917 Advanced API Register Set


ZMOTION Detection and Control Family
Product Specification

33

Table 18. PIR Advanced Status/Control Register 0 (ePIR_ASC0)

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

Reserved (Bits 7–5)


Buffer Refresh (Bit 4)
Uses a fast-fill algorithm to quickly refill the motion detection buffers; controlled by the application.
This bit is used to restart motion detection by quickly reinitializing and refilling the motion detection
constructed sample buffers. This method can be used to restore motion detection after waking up from
SLEEP Mode, or it can be used to help ignore external events that may cause false detections.
Waking up from SLEEP Mode:
If this bit is set when the EPIR_INIT macro is executed the Engine refills the constructed sample
buffers with a fast fill algorithm that allows it to quickly restore motion detection. Typically, a simple
external wake-up circuit would be implemented that provides an unqualified motion detection signal to
wake up the MCU from SLEEP Mode (SMR). Upon SMR, the application would set the Buffer Refresh
bit, execute EPIR_INIT, and then continue with normal motion detection functions for some period of
time before returning to SLEEP Mode. By setting this bit prior to EPIR_INIT, the Engine buffers are
filled much faster enabling it to analyze the original signal seen by the external wake-up circuit and
determine if it is actual motion.
Ignoring False Detection Events:
If the MCU is used to control external components (LED’s, relays, lights, triacs, etc.), a fluctuation on
the power supply can be created as the external device is turned on or off. The Buffer Refresh bit can
be used to ignore any false detection that could be created by these fluctuations. When the external
device is turned on or off, the application can set the Buffer Refresh bit to effectively reset the motion
detection history and therefore ignore any effect from the external device.
New Sample (Bit 3)
New sample available from PIR Signal High/Low Register.
Set by the PIR engine, cleared by the application.
• This bit indicates that the PIR engine has a new sensor signal input sample available that may be
read by the application. This status is available as an advanced feature as the application is not
normally required to read the sampled PIR sensor signal. The application must clear this bit when the
sample has been read.

PS028514-0917 Advanced API Register Set


ZMOTION Detection and Control Family
Product Specification

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.

Table 19. PIR Advanced Status/Control Register 2 (ePIR_ASC2)

Bit 7 6 5 4 3 2 1 0
Field Lock level Window Size Window Update Rate

Control R/W R/W R/W

Address F2H

Lock Level (Bits 7–5)


Controlled by the application.
This parameter sets the minimum slope change in the signal that can be considered valid motion. This
prevents small signal changes caused by environmental or VCC shifts from causing a false detection.
Use this value in combination with PIR Sensitivity and Range Control settings to balance sensitivity and
stability to the particular lens and pyroelectric sensor being used.
• Smaller values allow subtle signals with lower slopes to be considered motion events at the expense
of potential false motion events.
• Larger values allow the system to ignore smaller signal slope changes at the expense of potentially
missing smaller motion events.

PS028514-0917 Advanced API Register Set


ZMOTION Detection and Control Family
Product Specification

35

Window Size (Bits 4–3)


Controlled by the application.
This register determines the size of the control limit window. A larger window size produces more
stable control limits at the cost of additional CPU usage. If a smaller window size is used, the more
frequently the window can be calculated which allows it to track the signal better.
00 = Reserved
01 = Small window
02 = Medium window
03 = Large window
Window Update Rate (Bits 2–0)
Controlled by the application.
This register determines how frequently the control limits are calculated. It is measured in PIR samples.
A smaller number produces more frequent calculations which allow the control limits to track the signal
better, at the cost of increased CPU usage. The valid range is 0 to 7.
• The window is updated every 4 + (Window Update Rate * 2) PIR samples.

Table 20. PIR Process Rate (ePIR_Process_Rate)

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

PIR Process Rate (Bits 7–0)


Controlled by PIR engine
The PIR Process Rate Indicator is provided by the Engine to determine if the user application process
and interrupts overhead is impacting the performance of the Engine. If the Engine process rate drops
significantly, its ability to detect motion can be significantly reduced. This value is typically used at the
application development stage. This number gives an indication of how much CPU time the Engine is
receiving. Higher numbers are better. Generally, if the process rate drops below 0080h, the ability to
detect motion could be compromised.
Note: The 16-bit value provided by these two 8-bit registers must be read as an atomic operation by the application.
This can be ensured by either using the CPU’s ATM instruction or by disabling interrupts while reading the two
8 bit registers.

PS028514-0917 Advanced API Register Set


ZMOTION Detection and Control Family
Product Specification

36

Table 21. PIR Sample Size Register (ePIR_Sample_Size)

Bit 7 6 5 4 3 2 1 0
Field PIR Sample Size

Control Read/Write

Address F5H

PIR Sample Size (Bits 7–0)


Controlled by the application.
This register controls the amount of averaging that the engine performs on the incoming PIR signal
ADC samples. More averaging improves signal noise immunity at the cost of a slower sample rate.

Table 22. PIR Debounce Time Register (ePIR_Debounce)

Bit 7 6 5 4 3 2 1 0
Field PIR Debounce Time

Control Read/Write

Address F6H

PIR Debounce Time (Bits 7–0)


Controlled by the application.
• This register controls the amount of time that the engine will wait to fully debounce a motion signal.
Longer times result in detection of subtle motion at the cost of more potential false motion detections.
Valid range is from 01h to FFh.
• Using a value less than the value in the PIR Sensitivity Register will result in no motion detection.

PS028514-0917 Advanced API Register Set


ZMOTION Detection and Control Family
Product Specification

37

Table 23. PIR Debounce Batch Size Register (ePIR_Debounce_Batch)

Bit 7 6 5 4 3 2 1 0
Field PIR Debounce Batch Size

Control Read/Write

Address F7H

Debounce Batch Size (Bits 7–0)


Controlled by the application.
This register determines the number of consecutive out-of-window samples required to consider the
sequence a valid debounce count. The field works as a mask. Increasing the mask size (i.e. more bits
set to 1) will increase the noise immunity of the engine but result in lower sensitivity to subtle motion
signals.
Valid values are 01h, 03h, 07h, 0Fh, 1Fh, 3Fh, 7Fh, and FFh.

Table 24. PIR Transient Sensitivity Level (ePIR_Transient_Sense)

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.

PS028514-0917 Advanced API Register Set


ZMOTION Detection and Control Family
Product Specification

38

Table 25. PIR Noise Sensitivity Level (ePIR_Noise_Sense)

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.

Table 26. Noise Sensitivity as determined by Window Size

Window Size Max PIR Noise Sensitivity Value Typical Value


Small 0Ch 08h
Medium 1Dh 12h
Large 46h 2D

PS028514-0917 Advanced API Register Set


ZMOTION Detection and Control Family
Product Specification

39

Table 27. PIR Signal (ePIR_Signal)

Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Field PIR Signal

Control Read

Address FAH FBH

PIR Signal (Bits 15–0)


Controlled by PIR engine
These registers contain the last PIR signal obtained by the engine. Each time the engine generates a
new PIR signal sample it will place it in these registers and set the New Sample bit in the PIR
Advanced Status/Control 0 Register. This gives the application direct visibility to the PIR generated
signal for debugging purposes.
Note: The 16 bit value provided by these two 8 bit registers must be read as an atomic operation by the application.
This can be ensured by either using the CPU’s ATM instruction or by disabling interrupts while reading the two
8 bit registers.

Table 28. PIR DC Signal Level (ePIR_Signal_DC)

Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Field PIR Signal DC
Control Read

Address FCH FDH

PIR Signal DC Level (Bits 15–0)


Controlled by PIR engine
These registers contain the last PIR signal DC Level calculated by the engine. Each time the engine
generates new control limits it will place the DC component level in these registers.
Note: The 16 bit value provided by these two 8 bit registers must be read as an atomic operation by the application.
This can be ensured by either using the CPU’s ATM instruction or by disabling interrupts while reading the two
8 bit registers.

PS028514-0917 Advanced API Register Set


ZMOTION Detection and Control Family
Product Specification

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.

Table 29. Part Number Designations

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

Table 30. Positions 1–4


ZMOT The ZMOTION Product Family.

PS028514-0917 Packaging
ZMOTION Detection and Control Family
Product Specification

41

Table 31. Positions 5–8: MCU and MCU Package Selector*

PIR Software MCU Field** MCU Package


MCU Part Number Description Revision (Pos 5, 6) Field (Pos 7, 8)
Z8FS040xSB20EG Occupancy, 8 pin SOIC 2.00 0B SB
Z8FS040xHH20EG Occupancy, 20 pin SSOP 2.00 0B HH
Z8FS040xHJ20EG Occupancy, 28 pin SSOP 2.00 0B HJ
Note: *To purchase the ZMOTION MCU alone, select the appropriate ZMOTION MCU part number from the first
column of this table.
**The second character in the MCU field refers to the PIR software engine revision.

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.

Table 32. Positions 9–12: Lens and PIR Sensor Selector

Lens Field PIR Field


Manufacturer Part Number Description (Pos 9, 10) PIR Sensor* (Pos 11, 12)
Fresnel AA 0.9 GI T1 Animal Alley Array 0A RE200B-P 0A
Technologies (88°) SDA02-54-P 0B
Fresnel CM 0.77 GI V3 Ceiling Mount Array 0B RE200B-P 0A
Technologies (360°) SBDI46-504AA 0C
Fresnel CM 0.77 GI V5 Ceiling Mount Array 0C RE200B-P 0A
Technologies (360°) SBDI46-504AA 0C
Fresnel CWM 0.5 GI V1 Ceiling/Wall Mount 0D RE200B-P 0A
Technologies Array (360°) SBDI46-504AA 0C
Note: See Table 34 for an additional description of these PIR sensors.

PS028514-0917 Ordering Information


ZMOTION Detection and Control Family
Product Specification

42

Table 32. Positions 9–12: Lens and PIR Sensor Selector


Nicera NCL-9(26) Clip-on 15mm Array 1A RE200B-P 0A
(360°) SBDI46-504AA 0C
NCL-10IL 10mm wall mount array 1B RE200B-P 0A
(70°)
NCL-3B 10mm wall mount array 1C RE200B-P 0A
(40°)
NCL-3R 10mm ceiling/wall array 1D RE200B-P 0A
(360°) SBDI46-504AA 0C
NCL-10S 10mm ceiling/wall array 1E RE200B-P 0A
(18°)
Note: See Table 34 for an additional description of these PIR sensors.

Table 33. Position 13


G RoHS-compliant.

Table 34. PIR Sensor Information

Manufacturer Part Number Description


Nicera RE200B-P Basic Dual Element
Nicera SDA02-54-P Premium Dual Element
Nicera SBDI46-504AA Quad Element

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.

PS028514-0917 Ordering Information


ZMOTION Detection and Control Family
Product Specification

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.

PS028514-0917 Ordering Information


ZMOTION Detection and Control Family
Product Specification

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

PS028514-0917 Related Documents


ZMOTION Detection and Control Family
Product Specification

45

Appendix A. Application Schematics


The ZMOTION Detection and Control MCU is available in 8-pin, 20-pin and 28-pin parts
and configurable with dual and quad pyro sensor and lens combinations.

8-Pin Z8FS040xSB20EG MCU


Figure 10 shows an example circuit for part number Z8FS040xSB20EG, an 8-pin ZMO-
TION Detection and Control MCU. The interface to the pyroelectric sensor is via the ded-
icated input ANA2 (pin 5). The status LED is driven by pin 6 which is normally
configured as a GPIO by the application to control the state of the LED. Pin 2 is used as
the debug input to the chip, but can be used for other functions as required. Pin 4 is set up
for the Reset function, but may also be used for other functions as the application requires.
Pull-up resistors (10K) are provided on the Debug and Reset signals as required for the
Debug interface. The signals on pins 3 and 7 can be used as required. The power supply
design is left to the application requirements.
In DUAL PYRO Mode, the second Pyroelectric sensor is connected to Pin 3 (ANA3). All
other connections remain the same.

PS028514-0917 8-Pin Z8FS040xSB20EG MCU


ZMOTION Detection and Control Family
Product Specification

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.

Single Pyroelectric Sensors


Figure 11 shows an example circuit for the 20 pin device of the ZMOTION Detection and
Control MCU Family with a single Pyro Electric sensor. The interface to the pyroelectric
sensor is via the dedicated input ANA2 (pin 2). VREF (pin 18) must be externally tied to
ANA3 (pin 3). The status LED is driven by pin 19 (PC3/COUT) which is normally config-
ured as a GPIO by the application to control the state of the LED. This pin provides a pro-
grammable constant current sink specifically for LED drive without using an external
resistor. Pin 15 is dedicated as the Debug pin and is connected to pin 4 of the Debug
Header. Pin 14 is set up for the Reset function, but may also be used as PD0 (general pur-
pose I/O) as the application requires. Pull-up resistors (10K) are provided on the Debug

PS028514-0917 20-Pin Z8FS040xHH20EG


ZMOTION Detection and Control Family
Product Specification

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

Figure 8. Required Circuit Connections for the Z8FS040xHH20EG


(20-Pin) Motion Detection MCU in SINGLE PYRO Mode

Dual Pyroelectric Sensors


In DUAL PYRO Mode, the second pyroelectric sensor is connected to ANA3. The signal
from VREF to ANA3 is not required. All other connections remain the same as SINGLE
PYRO Mode. See Figure 12.

PS028514-0917 20-Pin Z8FS040xHH20EG


ZMOTION Detection and Control Family
Product Specification

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

Pyro Electr ic Z 8F S040xH H020EG


Sensor 2
VDD

SIG
1uF

47K
GND

Figure 9. Required Circuit Connections for the Z8FS040xHH20EG


(20-Pin) Motion Detection MCU in DUAL PYRO Mode

28-Pin Z8FS040xHJ20EG
The 20-pin Z8FS040xHH20EG part offers both dual and quad pyroelectric sensors; each
of these modes is described in this appendix.

Single Pyroelectric Sensor


Figure 13 shows an example circuit for the 28-pin device of the ZMOTION Detection and
Control MCU Family with a single Pyroelectric sensor. The interface to the pyroelectric
sensor is via the dedicated input ANA2 (pin 1). VREF (pin 3) must be externally tied to
ANA3 (pin 4). The status LED is driven by pin 26 (PC3/COUT) which is normally config-
ured as a GPIO by the application to control the state of the LED. This pin provides a pro-
grammable constant current sink specifically for LED drive without using an external
resistor. Pin 22 is dedicated as the Debug pin and is connected to pin 4 of the Debug
Header. Pin 21 is set up for the Reset function, but may also be used as PD0 (general pur-
pose I/O) as the application requires. Pull-up resistors (10K) are provided on the Debug

PS028514-0917 28-Pin Z8FS040xHJ20EG


ZMOTION Detection and Control Family
Product Specification

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

Figure 10. Required Circuit Connections for the Z8FS040xHJ20EG


(28-Pin) Motion Detection MCU in SINGLE PYRO Mode

PS028514-0917 28-Pin Z8FS040xHJ20EG


ZMOTION Detection and Control Family
Product Specification

50

Dual Pyroelectric Sensors


In DUAL PYRO Mode, the second pyroelectric sensor is connected to ANA3. The signal
from VREF to ANA3 is not required. All other connections remain the same as SINGLE
PYRO Mode. See Figure 14.

V DD (3 .3V )

V DD (3.3 V)

Pyro Electric V DD (3. 3V)

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

Z8F S040xHH 020EG

Figure 11. Required Circuit Connections for the Z8FS040xHJ20EG


(28-Pin) Motion Detection MCU in DUAL PYRO Mode

PS028514-0917 28-Pin Z8FS040xHJ20EG


ZMOTION Detection and Control Family
Product Specification

51

Appendix B. PIR Engine Initialization and


Control
The application software must execute an initialization procedure to enable the PIR
engine. Once the PIR engine is enabled, it runs in the background from the ADC interrupt.
Every ADC conversion generates an interrupt and the PIR engine performs its functions
during this time. The user application code runs in the foreground and monitors the status
through the API and performs any other functions required for the application.
The PIR engine also requires a one-second tick to perform several housekeeping opera-
tions and to keep track of its sampling rate. This tick must be provided by the user applica-
tion through the Status/Control Register 1 (Engine Timer Tick). Once per second, this bit
should be set to a 1 by the application software to provide the engine with a 1-second time
base. The accuracy of this time is not critical, but should be within +/– 10%.
There are two basic modes in which the PIR engine operates: NORMAL SCAN RATE
Mode and LOW SCAN RATE Mode. See the description of the PIR Scan Rate bit in the
PIR Status/Control Register 1 for more details.
The PIR engine runs in the background from the ADC interrupt (initiated by the applica-
tion). Engine processing is done during the ADC interrupt. Therefore CPU loading is
based on the sample rate of the ADC. To ensure a consistent sample rate, the Engine must
know the MCU operating frequency (System Clock Frequency). It uses the Flash Fre-
quency Control Registers to determine the operating frequency which must be initialized
prior to starting the Engine.
The Flash Frequency High (FFREQH) and Flash Frequency Low Byte (FFREQL) regis-
ters combine to form a 16-bit value FFREQ primarily to control timing for Flash program
and erase functions. This value is also used by the PIR software 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.

FFREQ[15:0] = {FFREQH[7:0],FFREQL[7:0]} = (System Clock


Frequency)/1000

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.

PS028514-0917 28-Pin Z8FS040xHJ20EG


ZMOTION Detection and Control Family
Product Specification

52

5. Initialize any application-specific I/O and peripherals.


6. Enable interrupts.
7. Ensure that the PIR Sensor Stable bit (ePIR_SC0:0) is set.
8. Continue with the application.

The flow diagram in Figure 15 shows the general software operation for NORMAL
SCAN RATE Mode.

PS028514-0917 28-Pin Z8FS040xHJ20EG


ZMOTION Detection and Control Family
Product Specification

53

RESET

Initialize Oscillator & WDT


Set up GPIO’s for application

Initialize Flash Frequency Register


Enable ADC in PWRCTL0

Initialize API Registers


Recommended settings supplied in
lens/pyro configuration file
PIR Sc an R a te = 0 Enter ADC
Interrupt

Set ePIR_Enable Register to


ePIR_ENABLE_PATTERN Execute A DC
e PIR ePIR_ADC_ISR Inter rupt
Initiali za tio n Macro

Execute ePIR_INIT Macro Exit ADC


Interrupt

Set up Timer for 1 Second Interrupt


Enable Global Interrupts

Application
Initialization

Wait for PIR Sensor Stable


ePIR_SC0:0=1

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

Figure 12. Application Flow Diagram: Normal Scan Rate

PS028514-0917 28-Pin Z8FS040xHJ20EG


ZMOTION Detection and Control Family
Product Specification

54

The flow diagram in Figure 16 shows the general software operation for LOW SCAN
RATE Mode.

RESET

Initialize Oscillator & WDT


Set up GPIO’s for application

Enter ADC
Initializ e Flash Frequency Register Interrupt
Enable ADC in PWRCTL0

Turn off ADC to ADC


Initialize API Registers Cons erve Power Interrupt
Recommended settings supplied in
lens/py ro configuration file
PIR Sca n R ate = 1 Exit ADC
Interrupt

Set ePIR_Enable Register to


ePIR ePIR_ENABLE_PATTERN
Initialization

Execute EPIR_INIT Macro

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

Wait for PIR Sensor Stable


ePIR_SC0:0=1
No
1 Sec ond?

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

Figure 13. Application Flow Diagram: Low Scan Rate

PS028514-0917 28-Pin Z8FS040xHJ20EG


ZMOTION Detection and Control Family
Product Specification

55

Appendix C. Software Support Files and


Project Configuration
The following four files are provided to support the PIR engine:
ePIR_API.c. Contains the API register definitions and locates them at their appropriate
places in memory.
ePIR_API.h. Provides the bit definitions for the API registers and also contains the macro
definitions for EPIR_INIT and EPIR_ADC_ISR.
API_INIT_xx.h. This header file contains the default API settings specific to the lens and
pyroelectric sensor being used. The application code loads the API registers with these
values prior to executing the EPIR_INIT macro. Several versions of this file are available
from the Zilog website with tested configurations supporting the available lenses and
pyroelectric sensors. Refer to Appendix D. Lens Selection Guide on page 57 to select the
appropriate API_INIT_xx file for the selected lens.
startupePIR.asm. This is the C startup file that replaces startups.asm or startupl.asm in
ZDS II. It contains the environment initialization, stack and register pointer configurations
required specifically for a PIR project.

ZDS II Project Settings


Zilog Developer Studio (ZDS II) is used for software development. Since the compiled
application code has no vision into the operation of the PIR engine, it is important to
ensure that the application working RAM area is not effected by engine operations. To
facilitate this, the PIR engine uses working register group E (addresses E0h to EFh) as its
working RAM area and the application code uses working register group 0 (as defined in
startupePIR.asm). These operations are automatically handled by the compiler and exam-
ples are provided with the available sample projects.
The Small Memory Model must be used for the application software.
To support the defined memory map, ZDS II project settings must be configured as follows
(sample projects are available that have these settings already configured).

Application Project Settings (Small Model)


• RData: 20h–6Fh, F0h–FFh
– Defined in ZDS II Project Settings under Linker Address Spaces
– This allows for 16 bytes of stack space starting at 7Fh. If additional space is
required, reduce the 6Fh value.
– The compiler uses address 00h to 0Fh for working registers

PS028514-0917 ZDS II Project Settings


ZMOTION Detection and Control Family
Product Specification

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

• EData: 100h–10Fh, 110h–18Fh


– Defined in ZDS II Project Settings under Linker Address Spaces
– Address range 100h to 10Fh contains the Standard 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

PS028514-0917 ZDS II Project Settings


ZMOTION Detection and Control Family
Product Specification

57

Appendix D. Lens Selection Guide


Use the data in Table 35 to help select the lens most appropriate to your application. The
configuration file listed contains the optimal API settings for that particular lens and
should be included with your ZMOTION project.
Refer to the ZMOTION Lens and Pyroelectric Sensor Product Specification (PS0286) for
lens usage and details.

Table 35. ZMOTION Lens and Pyroelectric Sensor Selection Guide

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

PS028514-0917 ZDS II Project Settings


ZMOTION Detection and Control Family
Product Specification

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

NCL-10IL Lens 10mm Wall/Ceiling Mount Proximity or Entrance ePIR_INIT_07.h RE200B-P


Specification Array (80° x 30°) Detection
• Clips on to pyroelectric • Kiosk
sensor • Vending
• 6 beams (X); 2 beams • HVAC
(Y) • Display counters
• 10m range

PS028514-0917 ZDS II Project Settings


ZMOTION Detection and Control Family
Product Specification

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

PS028514-0917 ZDS II Project Settings


ZMOTION Detection and Control Family
Product Specification

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.

PS028514-0917 Customer Support

You might also like