ZMOTIONL100ZCOG
ZMOTION® Detection and
Control Development Kit
User Manual
UM023003-1013
Copyright ©2013 Zilog®, Inc. All rights reserved.
www.zilog.com
ZMOTION® Detection and Control Development Kit
User Manual
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
critical component is any component in a life support device or system whose failure to perform can be
reasonably expected to cause the failure of the life support device or system or to affect its safety or
effectiveness.
Document Disclaimer
©2013 Zilog Inc. All rights reserved. Information in this publication concerning the devices, applications,
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 verified 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.
UM023003-1013
ii
ZMOTION® Detection and Control Development Kit
User Manual
Revision History
Each instance in the table below reflects a change to this document from its previous edition. To learn more, refer to the corresponding pages and appropriate links in the table
below.
Date
Revision
Level
Description
Oct
2013
03
Deleted references to CD-ROM. All software and documentation is available
free from the Zilog Store.
Dec
2011
02
Updated to include lens attachment instructions, ZDS II installation, a
discussion about the sample project, plus modified schematic diagrams.
Nov
2010
01
Original issue
UM023003-1013
Page
n/a
8, 15,
22
All
iii
ZMOTION® Detection and Control Development Kit
User Manual
Table of Contents
Revision History. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .iii
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Kit Contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Hardware . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Supported Operating Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Safeguards . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Download and Install the ZDSII Software and Documentation . . . . . . . . . . . . . . . . .
Download and Install the Code and Documentation . . . . . . . . . . . . . . . . . . . . . . . . .
1
1
1
2
3
3
3
ZMOTION Detection and Control Development Board . . . . . . . . . . . . . . . . . . . . . . . . . . 5
Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
MCU Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
ZMOTION Detection and Control Development Kit Lenses and Pyroelectric
Sensors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
Pyroelectric Sensor Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
Lens Mounting Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
Attaching the PIR Sensor Lens . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
Attaching the Circuit Board Lens . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
Assembling the Circular Lens Holder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
Assembling the Flat Lens Holder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
Connecting the USB SmartCable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
Running the Sample Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
ZMOTION Detection and Control Development Kit Application Software . . . 18
Making Changes to the ZMOTION_Serial_Config Project . . . . . . . . . . . . . . . . 20
Appendix A. Installing the USB SmartCable Driver . . . . . . . . . . . . . . . . . . . . . . . . . . .
Windows 7 32/64 Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Windows Vista 32/64 Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Windows XP Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
22
22
23
23
Appendix B. Installing the FTDI USB-to-UART Driver . . . . . . . . . . . . . . . . . . . . . . . . 25
Appendix C. Schematic Diagrams . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
Customer Support. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
UM023003-0813
iv
ZMOTION® Detection and Control Development Kit
User Manual
Introduction
Zilog’s ZMOTION® Detection and Control Development Kit provides a general-purpose
platform for evaluating the capabilities and operation of the ZMOTION Detection and
Control Family of microcontrollers featuring Zilog’s passive infrared (PIR) technology.
The family includes a series of high-performance microcontrollers with integrated motion
detection algorithms. A variety of included lenses and pyroelectric sensors demonstrate
the flexibility of the integrated motion detection algorithms to provide the best possible
performance for a range of lighting, detection and control applications.
Note: This user manual acquaints users with Zilog’s ZMOTION Detection and Control Development Kit Revision E or later.
The Z8FS040 MCU, a prominent member of the ZMOTION Detection and Control Family, combines the programmability and rich peripheral set of Zilog’s Z8 Encore! XP®
Family of Flash MCUs with built-in motion detection software algorithms to provide the
functions necessary for PIR motion detection applications. These motion detection algorithms comprise Zilog’s PIR technology and run in the background while control and status of the motion detection engine is accessed through a software Application Programmer
Interface (API). As a result, the designer can create his or her own application-specific
software while taking advantage of Zilog’s ZMOTION Motion Detection Technology.
Within this kit, API settings are provided to match the Engine operation to each of the lens
and pyroelectric sensor combinations provided.
To learn more about the ZMOTION MCU, refer to the ZMOTION Detection and Control
Product Specification (PS0285), available free for download from the Zilog website.
Kit Contents
The ZMOTION Detection and Control Development Kit contains the following hardware,
software and documentation:
Hardware
•
•
•
•
•
•
•
UM023003-0813
ZMOTION Development Board
USB SmartCable Debugger
0.9" Focal Flat Lens Holder
0.77" Focal Circular Lens Holder
Selection of lenses
Selection of pyroelectric sensors, including a RE200B-P sensor installed on the Board
Mini-USB serial cable
1
ZMOTION® Detection and Control Development Kit
User Manual
•
•
Wall-mount mini-USB 5 V DC power supply1
An assortment of mounting hardware
The contents of the kit are shown in Figure 1.
Wall-Mount Power Supply
Lenses
ZEMS Development Board
1 of 2 Additional
Pyro Sensors
Mini-USB Serial Cable
USB Smart Cable Debugger
Lens Holders
Figure 1. ZMOTION Detection and Control Development Kit Contents
Supported Operating Systems
The software and documentation for this kit supports Microsoft Windows 7 (32-bit/64bit), Windows Vista (32-bit/64-bit) and Windows XP.
1. Zilog recommends using only the power supply provided in the ZMOTION Detection and Control Development Kit.
UM023003-0813
2
ZMOTION® Detection and Control Development Kit
User Manual
Safeguards
The following precaution must be observed when working with the devices described in
this document.
Caution: Always use a grounding strap to prevent damage resulting from electrostatic discharge (ESD).
Download and Install the ZDSII Software and
Documentation
Prior to connecting the ZMOTION Development Board to your PC, observe the following
procedure.
1. Download ZDS II for Z8 Encore! v5.0.0 (or later) from the Downloadable Software
category in the Zilog Store.
2. Run the software installation file and follow the on-screen instructions to install
ZDS II.
Download and Install the Code and Documentation
ZMOTION software and documentation is available as a downloadable file from the Zilog
Store. Observe the following brief procedure to download and install your ZMOTION
software.
1. In the Zilog Store, under Categories, click Downloadable Software to present a list
of the available software in the Zilog Store. In this list, click ZMOTIONL100ZCOG
Software and Documentation; the Product ID for this software is SD00025. On the
Product Details page that appears next, click the blue Add to Cart button and complete the checkout process to download the ZMOTION software and documentation
files to your hard drive.
Note: If you’re a first-time visitor to the Zilog Store, you will first be required to register as a
Zilog Store user before downloading your software. Returning visitors must log in to purchase or download.
2. When the download is complete, unzip the file to your hard drive, double-click to
launch the ZMOTIONL100ZCOG_.exe installation file, and follow the onscreen instructions.
UM023003-0813
3
ZMOTION® Detection and Control Development Kit
User Manual
Note: represents the release version of the ZMOTIONL100ZCOG installation.
3. When the installation is complete, the ZMOTION documentation will be located in
the following path, by default:
C:\\Program Files\Zilog\ZMOTIONL100ZCOG_\ZMOTION
Lighting Documentation
Documentation
The following documentation supports the ZMOTION Detection and Control Development Kit.
•
•
•
•
ZMOTION Detection and Control Product Brief (PB0225)
ZMOTION Detection and Control Development Kit Quick Start Guide (QS0076)
ZMOTION Detection and Control Product Specification (PS0285)
This ZMOTION Detection and Control Development Kit User Manual (UM0230)
The following documentation supports the ZMOTION Product Family.
•
ZMOTION Detection Module:
– ZMOTION Detection Module Product Brief (PB0223)
– ZMOTION Detection Module Product Specification (PS0284)
•
ZMOTION Intrusion Detection:
– ZMOTION Intrusion Detection Product Brief (PB0230)
– ZMOTION Intrusion Detection Product Specification (PS0288)
•
Supporting Documentation:
– ZMOTION Lens and Pyroelectric Sensor Product Specification (PS0286)
– ZMOTION – A New PIR Motion Detection Architecture White Paper (WP0017)
– ZMOTION Detection Lens and Pyro Sensor Configuration Guide (WP0018)
– Power Management and Customer Sensing with Zilog’s ZMOTION Detection
Module (AN0301)
– ZMOTION Detection Module Application Walkthrough (AN0307)
– High Brightness LED Reference Design (AN0309)
– Controlling Power with the ZMOTION Detection Module and Clare Solid State
Relays Application Note (AN0319)
– ZMOTION Intrusion Reference Design (RD0001)
– Motion Sensing & LED Control with a ZMOTION/ IXYS Display (RD0003)
– ZMOTION Detection Module II Reference Design (RD0026)
UM023003-0813
4
ZMOTION® Detection and Control Development Kit
User Manual
ZMOTION Detection and Control
Development Board
Zilog’s ZMOTION Detection and Control Development Board is a development and prototyping platform for the ZMOTION silicon and software, as well as for its lens/pyroelectric sensor/silicon and software bundled solutions. The Board provides the user with a tool
to evaluate the many features of ZMOTION PIR technology as well as the actual performance of each lens and pyro combination.
Features
The ZMOTION Detection and Control Development Board features the following elements:
•
•
•
•
•
•
•
Z8FS040 ZMOTION Detection and Control MCU (8-pin SOIC)
Mini-USB power connector and serial interface
Power-On and Detection LED
On-chip debugger interface
Board openings for an assortment of lens holders and clip-on lens attachments
Prototyping area
2.7 V–3.6 V operating voltage with 5 V-tolerant inputs
MCU Features
The Z8FS040 ZMOTION Detection and Control MCU combines the programmability and
rich peripheral set of Zilog’s Z8 Encore! XP Family of Flash MCUs with built-in motion
detection software algorithms to provide the functions necessary for PIR motion detection
applications.
The Z8FS040 MCU includes the following features:
•
•
•
•
•
•
•
•
•
UM023003-0813
High-performance eZ8® MCU core
4 KB in-circuit programmable Flash memory 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 single-ended channels or 3 differential channels available
On-chip analog comparator with independent programmable reference voltage
5
ZMOTION® Detection and Control Development Kit
User Manual
•
•
Full-duplex UART with dedicated BRG
•
•
•
•
Watchdog timer (WDT) with dedicated internal oscillator
•
•
Zilog PIR technology controlled and monitored via software API registers
•
•
•
•
•
Two 16-bit timers with input capture, output compare and PWM capability (11 modes
total)
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
Selection capability 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 directionality detection
Extended detection modes for occupancy sensing
Low power modes
ZMOTION Detection and Control Development Kit Lenses
and Pyroelectric Sensors
The ZMOTION Detection and Control Development Kit includes five different types of
lenses and pyroelectric sensors and three different types of pyroelectric sensors to fill a
wide variety of lighting control, occupancy sensing, HVAC, display, proximity and power
management applications. These applications also demonstrate the flexibility, and superior
performance of Zilog’s PIR motion detection technology.
Please refer to the ZMOTION Lens and Pyroelectric Sensor Product Specification
(PS0286) for part-specific details about the individual lenses and pyroelectric sensors.
Refer to the ZMOTION Detection and Control Development Kit Quick Start Guide
(QS0076) for specific installation instructions for the lenses and pyroelectric sensors.
Pyroelectric Sensor Options
The ZMOTION Detection and Control Development Kit includes the following three
pyroelectric sensors:
•
•
•
UM023003-0813
RE200B-P: a basic dual element sensor installed on the board
SDA02-54-P, a premium dual-element sensor
SBDI46-504AA, a quad-element sensor
6
ZMOTION® Detection and Control Development Kit
User Manual
Figure 2. Two Additional Pyroelectric Sensors (L–R): SDA02-54-P and SBDI46-504AA
Note: The type of sensor you use depends on your application requirements; however, not all sensors are suitable for all lenses.
Lens Mounting Options
The ZMOTION Detection and Control Development Board supports four lens-mounting
options, as indicated in Table 1. For lens installation instructions, please refer to the sections that follow.
Table 1. Four Supported Lens-Mounting Options
Lens Mounting
Supported Lens
PIR Sensor Clip-On
NCL-9(26)
NCL-3B
NCL-3R
NCL-10S
NCL-10IL
Circuit Board Clip-In
CWM 0.5 GI V1
Circular Lens Holder 0.77 Focal
CM 0.77 GI V3
CM 0.77 GI V5
Flat Lens Holder 0.9 Focal
UM023003-0813
AA 0.9 GI T1
7
ZMOTION® Detection and Control Development Kit
User Manual
Attaching the PIR Sensor Lens
Each of the clip-on lenses slide atop the PIR sensor, and the notch on the PIR sensor aligns
with the notch in the base of the lens, as shown in Figure 3.
Figure 3. NCL-9(26) Lens and PIR Sensor Installed on the
ZMOTION Development Board
Attaching the Circuit Board Lens
This clip-in lens style clips directly into the circuit board over the top of the PIR sensor.
There are 4 mounting clips on the lens that are aligned with the slots in the circuit board.
Note the locating tab on the side of the lens is to be aligned with the silkscreened tab, as
indicated in Figure 4.
UM023003-0813
8
ZMOTION® Detection and Control Development Kit
User Manual
Figure 4. Assembled Clip-In Lens Installed on the ZMOTION Development Board
Assembling the Circular Lens Holder
The circular lens holder, shown in Figure 5, is a 2-piece assembly that provides a 0.77"
focal length mounting.
UM023003-0813
9
ZMOTION® Detection and Control Development Kit
User Manual
Figure 5. Circular 0.77" Lens Holder (Cap and Base)
To assemble the lens and lens holder, observe the following brief procedure.
1. Place the circular lens into the base of the lens holder, aligning the notch on the lens
with the inside notch on the base.
2. Place the circular cap over the lens and the base ensuring the outside tab on the cap
aligns with the outside tab on the base. Use the provided ¾" machine screws (2) with a
nut to secure the cap in place.
3. Place the lens and lens holder assembly on the to ZMOTION Development Board
aligning the primary placement arrow on the lens holder with the primary placement
arrow on the circuit board, as shown in Figure 6. The 4 screw holes in the circuit board
should line up with the four center-mounting holes in the lens holder.
UM023003-0813
10
ZMOTION® Detection and Control Development Kit
User Manual
Figure 6. Top of Lens Holder on the ZMOTION Development Board
4. Use the provided ⅜" machine screws (4) with a nut to secure the lens holder in place.
See Figure 7.
UM023003-0813
11
ZMOTION® Detection and Control Development Kit
User Manual
Figure 7. Assembled Circular 0.77" Lens Holder and Circular Lens Installed on the
ZMOTION Development Board
Assembling the Flat Lens Holder
The flat lens holder, shown in Figures 8 and 9, is a two-piece assembly that provides a 0.9"
focal length mounting.
UM023003-0813
12
ZMOTION® Detection and Control Development Kit
User Manual
Figure 8. Flat 0.9" Lens Holder (Cap and Base)
Figure 9. Flat Lens: AA 0.9 GI T1
To assemble this flat lens and holder, observe the following brief procedure.
1. Place the lens into the inside of the cap, ensuring that the grooves of the lens are facing
inward.
2. Place the cap over the base, ensuring that the top of the lens is toward the arrow on the
base. Use the provided ½" machine screws (2) with a nut to secure the cap in place.
3. Place the lens and lens holder assembly onto the ZMOTION Development Board with
the arrow on the lens holder aligned with the primary placement arrow on the circuit
board, as shown in Figure 10. The four screw holes in the circuit board should line up
with the four center-mounting holes in the lens holder.
UM023003-0813
13
ZMOTION® Detection and Control Development Kit
User Manual
4. Use the provided ⅜" machine screws (4) with a nut to secure the lens holder in place.
See Figure 10.
Figure 10. Assembled Flat 0.9" Lens Holder and Flat Lens
Connecting the USB SmartCable
Observe the following steps to connect the USB SmartCable to the ZMOTION Development Board.
Caution: The power to the Development Board must be disconnected or turned OFF before connecting or disconnecting the USB SmartCable.
1. Attach one end of the six-conductor ribbon cable (included) to the USB SmartCable
six-pin DBG connector, as shown in Figure 11.
UM023003-0813
14
ZMOTION® Detection and Control Development Kit
User Manual
Figure 11. Connecting the Six-Conductor Ribbon Cable to the USB SmartCable
2. Attach the free end of the ribbon cable to the DBG connector (ZDI Interface) on the
Development Board. Ensure that pin 1 on the ribbon cable (indicated by the dark stripe)
is aligned with pin 1 on the target connector (indicated by a 1 on P2 of the board).
3. Install the FTDI USB-to-serial driver. For assistance, see Appendix B. Installing the
FTDI USB-to-UART Driver on page 25.
Running the Sample Project
In this example, we reference the ZMOTION_Serial_Config project, which is the project that the kit is initially programmed with. The steps that follow show you how to build
the project and run it on the ZMOTION Module in a debug session; these steps also apply
to any of the other projects provided in the kit.
Note: At this point, you should have installed the FTDI-to-USB Serial Driver and loaded ZDS II
and the USB SmartCable driver onto your computer. If you haven’t yet done so, refer to
Appendix A. Installing the USB SmartCable Driver on page 22 and/or Appendix B.
Installing the FTDI USB-to-UART Driver on page 25 to learn more about how to install
these items.
1. Open ZDS II and select File → Open Project, then navigate via the following path to
the project folder labeled ZMOTION_Serial_Config:
C:\Program Files\Zilog\ZMOTIONL100ZCOG_\SW Project and
Downloads\ZMOTION_Serial_Config_
UM023003-0813
15
ZMOTION® Detection and Control Development Kit
User Manual
2. Open the ZMOTION_Serial_Config.zdsproj project. When you first receive your
kit, this project is already loaded into the ZMOTION MCU. Right-click within the open
grey area below the menu icons and select Workbook Mode to turn on the tabs at the
bottom of the editor and therefore make it easier to switch between files.
3. Click the Rebuild All icon to build the project. The build output should not indicate any
errors. If you receive errors, try reloading the projects from the installation software,
and ensure that the folders are not set to Read Only. See Figure 12 for an example; Figure 13 indicates the location of the Rebuild All icon in the ZDS II menu bar.
Figure 12. Building the ZMOTION_Serial_Config project in ZDS II
The Rebuild All icon
Figure 13. The Location of the Rebuild All Icon
4. Make sure that the ZMOTION Development Board is powered OFF, then connect the
USB SmartCable (Debugger) to P2, as described above.
UM023003-0813
16
ZMOTION® Detection and Control Development Kit
User Manual
5. Ensure that the J4 jumper is closed in position 1–2, to control the USB power supply.
6. Apply power to the Development Board by plugging in the USB cable and setting SW1
to the ON position. Next, click the Reset icon in ZDS II. Figure 14 indicates the location of both the Reset and Go icons in the ZDS II menu bar.
The Reset icon
The Go icon
Figure 14. The Location of the Rest and Go Icons
7. An information notice may appear, indicating that the silicon is not the latest version.
This occurrence is normal and is not an issue. Click OK to continue. You should see a
message in the Debug Output Window indicating that the load was successful, as
shown in Figure 15.
Figure 15. ZDS II’s Debug Output Window for the ZMOTION_Basic project
UM023003-0813
17
ZMOTION® Detection and Control Development Kit
User Manual
8. Click the Go icon to start the application running. The Red LED (LED3) will be ON
initially until the pyroelectric sensor stabilizes – a period that can take up to 30 seconds.
After it has stabilized, (LED3) turns OFF, to turn ON only when motion is detected.
9. To test this procedure, wave your hand over the lens and notice (LED3) turning ON for
approximately 1 second.
ZMOTION Detection and Control Development Kit Application
Software
The ZMOTION application software includes the ZMOTION_Serial_Config motion
detection project, which is described in this section.
ZMOTION_Serial_Config
The ZMOTION_Serial_Config project demonstrates the basic motion detection functionality of the ZMOTION Development Board. The MCU included with the Board is
programmed with this project.
Each lens type is supported by an associated lens configuration header file which displays a
name format of API_INIT_xx.h. Header files for all supported lens types are included in
the include project folder of the ZMOTION_Serial_Config project. The main.c source
file contains the include directive to add the header file to the project. Changes to these
header files should not be required, but any modifications you make should be made to a
copy of the original header file; do not modify the original versions. As new lens types are
added to the ZMOTION family, an associated lens configuration file is made available on
the Zilog website.
Table 2 lists additional project features that can be modified or enabled in main.c and
main.h.
Table 2. Additional Project Features
Feature
File
Define/Variable
Default Values
LED ON time duration
main.h
DEF_LED_ON_TIME
DELAY_500MSEC (500
milliseconds)
Lens Support
main.c
#include "API_INIT_xx.h"
API_INIT_04.h
When motion is detected, the LED is turned ON for 500 msec (DEF_LED_ON_TIME). A
serial terminal program such as HyperTerminal can be used to view the detection messages from the ZMOTION Development Board. In Figure 16, 23 indicates the version of
the application; the S following the ZMOTION > prompt is displayed when the pyroelectric
sensor has become stable and the system is ready to detect motion. When motion is
detected, an N or E is displayed to indicate the type of detection (Normal motion or
Extended motion), along with the count and a time stamp (in seconds) after power-up.
UM023003-0813
18
ZMOTION® Detection and Control Development Kit
User Manual
Figure 16. The ZMOTION_Serial_Config Project Running in HyperTerminal
The menu shown in Figure 16 allows you to monitor and make real-time changes to the
operation of the motion detection software (a description of this menu’s selections follows). When the ZMOTION device is reset or power-cycled, all settings return to their
default values.
0) Display API Registers. Displays the current setting of the ZMOTION Engine regis-
ters.
1) Read/Write RAM. Allows you to make direct modifications to specific RAM locations
(Peek/Poke).
2) MCU Reset. Reset the ZMOTION MCU.
3) LED On/Off Time. Sets the duration of the LED ON time and minimum LED OFF
time.
4) Display Events On/Off. Turns the automatic display of motion events ON or OFF.
When OFF, events are still stored in the log.
5) Dump Event Log. Displays a history of motion events since power-on.
6) Reset Event Log/Counts. Clears the Event Log and resets the time stamp to 0.
7) Hypersense On Time. If Hypersense mode (menu item 8) is enabled when motion is
detected, the sensitivity of the system can be increased for a set amount of time; Hypersense On Time sets this time. If motion is detected while sensitivity is increased, the
ON time starts over.
UM023003-0813
19
ZMOTION® Detection and Control Development Kit
User Manual
8) Hypersense Mode/Level. There are three settings that control sensitivity to motion
during Hypersense; these settings are Major Sensitivity, Minor Sensitivity and Range. This
menu option allows you to enable and set each of these settings individually.
9) Normal Sense Level. When in normal motion sense mode (i.e., not in Hypersense
mode), this selection allows you to set the sensitivity levels of the three settings (Major
Sensitivity, Minor Sensitivity and Range).
Making Changes to the ZMOTION_Serial_Config Project
The operation of the motion detection software can be changed by making modifications
directly to the source code. Follow the comments in the code (generally in main.h and
main.c) to make any permanent changes. For example, to change the lens configuration
file and the duration of the LED ON time, observe the following procedure.
1. Change the following line in the main.h file:
#define DEF_LED_ON_TIME DELAY_500MSEC
//Time the LED
//stays on
//when motion
//is detected
2. Change the line as follows to select a five-second LED ON time:
#define DEF_LED_ON_TIME DELAY_5SEC
//Time the LED
//stays on when
//motion is
//detected
Note: LED ON time definitions are provided in the main.h file for values from 50 ms to 30 minutes.
3. Click the Rebuild icon to build the project. The build output should not indicate any
errors. Click the Go icon to download the modified project and start the application
running. Generate motion and notice that the LED now stays on for 5 seconds.
// This file must match the lens and PIR sensor used in the application
//#include "API_INIT_00.h"
// Generic settings: non-lens-specific
//#include "API_INIT_01.h"
// API configuration file for AA 0.9 GI V1 Lens
//#include "API_INIT_02.h"
// API configuration file for CM 0.77 GI V3 Lens
//#include "API_INIT_03.h"
// API configuration file for CM 0.77 GI V5 Lens
#include "API_INIT_04.h"
// API configuration file for CWM 0.5 GI V1 Lens
//#include "API_INIT_05.h"
// API configuration file for NCL-9(26) Lens
//#include "API_INIT_06.h"
// API configuration file for NCL-10IL Lens
//#include "API_INIT_07.h"
// API configuration file for NCL-3B Lens
//#include "API_INIT_08.h"
// API configuration file for NCL-3R Lens
//#include "API_INIT_09.h"
// API configuration file for NCL-10S Lens
UM023003-0813
20
ZMOTION® Detection and Control Development Kit
User Manual
//#include "API_INIT_0A.h"
//#include "API_INIT_IML-0643.h+"
// API configuration file for NCL-11 Lens
// API configuration file for IML-0643 Lens
Note: As the code listed above demonstrates, the API_INIT file must match the lens and pyroelectric sensor being used on the Development Board. Use the Lens Selection Guide in the
ZMOTION Lens and Pyroelectric Sensor Product Specification (PS0286) to determine
which API_INT file is required for each lens setting.
4. To change the lens used by the project, edit the include line at the top of the main.c
file to include the appropriate API_INIT file. The project initially uses
API_INIT_04.h to support the CWM 0.5 GI V1 (board clip-in) lens; see the above
code example. To use a different lens, edit out the comment characters (//) in the
main.c file that correspond to the new lens, and comment out the lens that is no longer
in use.
UM023003-0813
21
ZMOTION® Detection and Control Development Kit
User Manual
Appendix A. Installing the USB
SmartCable Driver
The USB Smart Cable can be installed on PCs that run on Windows 7 (32- and 64-bit),
Windows Vista (32- and 64-bit) and Windows XP operating systems. The procedures in
this appendix will guide you through the USB Smart Cable installation process.
Windows 7 32/64 Systems
Observe the following steps to install the USB Smart Cable on a Windows 7 system.
1. Connect the USB Smart Cable to a USB port on your development PC. When the PC
detects the new hardware, it will display the Installing device driver software dialog.
2. Windows automatically searches for the driver; this process can take a few moments.
Because there is no option to terminate this search process, wait for the search to complete.
If the driver was previously installed, Windows will automatically install the USB
Smart Cable driver. If this is the case, skip ahead to Step 9. If Windows cannot find the
driver, close the search dialog and proceed to the next step.
3. From the Start menu, navigate via the Search Programs and files menu, and enter
Device Manager in the Search field to cause the Device Manager to appear in a list
of search results.
4. From this search list, click Device Manager to open the Device Manager dialog,
which presents a list of devices that operate on your PC. Find Other devices, toggle it
to view a sublist of additional devices, and right-click your mouse on USB Smart
Cable.
5. In the submenu that appears, click Update Driver Software....
6. In the Update Driver Software – USB Smart Cable dialog that appears, click the
Browse my computer for driver Software option.
7. Click the Browse... button to browse to one of the following driver directories,
depending on the configuration of your PC.
On 32-bit Windows 7 systems, navigate to:
\device drivers\USB\x32
On 64-bit Windows 7 systems, navigate to:
\device drivers\USB\x64
8. Click Next to install the driver. On 32-bit: Windows systems, a security dialog will
appear; select Install this driver software anyway.
9. Click Close after the Wizard finishes the installation.
UM023003-0813
22
ZMOTION® Detection and Control Development Kit
User Manual
Windows Vista 32/64 Systems
Observe the following steps to install the USB Smart Cable on a Windows Vista system.
1. Connect the USB Smart Cable to a USB port on the development PC.
2. After the PC detects the new hardware, it will display the Found New Hardware Wizard dialog box. Click Locate and install driver software (recommended).
3. Depending on your development PC’s User Account Control settings, Windows may
ask for permission to continue the installation. Click Continue.
4. When the Insert the Disc dialog appears, select I don’t have the disc. Show me
other options. Click the Next button to display the Windows couldn’t find driver dialog.
5. Select Browse my computer for driver software (advanced) to display the Browse
For Driver dialog, which prompts you to key in or browse for the location of the
driver’s .inf file. Depending on the type of computer you use (32- bit or 64-bit), use
the Browse... button to navigate to one of the following paths, then click the Next button.
On 32-bit Vista systems, navigate to:
\device drivers\USB\x32
On 64-bit Vista systems, navigate to:
\device drivers\USB\x64
6. When the Windows Security dialog prompts you whether to install or not install, click
Install this driver software anyway and wait until the installation is completed (Windows may prompt you more than once).
7. When the software has been installed successfully, click Close.
Windows XP Systems
Observe the following steps to install the USB Smart Cable on a Windows XP system.
1. Connect the USB Smart Cable to a USB port on the development PC. When the PC
detects the new hardware, it will display the Found New Hardware Wizard dialog.
2. In the Wizard, select Install from a list or specific location (Advanced), then click
Next.
Note: If the Windows Hardware Installation dialog appears, click Continue Anyway.
3. In the Please choose your search and installations dialog, select Search for the best
driver in these locations and include this location in search.
4. Use the Browse... button to navigate to one of the following paths:
UM023003-0813
23
ZMOTION® Detection and Control Development Kit
User Manual
\device drivers\USB\x32
5. Click Next to locate the appropriate driver.
6. Click Next, then click Finish to complete the installation.
UM023003-0813
24
ZMOTION® Detection and Control Development Kit
User Manual
Appendix B. Installing the FTDI USB-toUART Driver
An FTDI USB-to-UART driver is required to allow your PC to communicate through its
USB port to the on-chip UART of the Z8F042A MCU. Observe the following procedure
to perform these connections.
1. Ensure that the USB cable is not plugged in to the Buck Converter Battery Charger
Design Module’s USB J1 connector.
2. Navigate to the following filepath and double-click the CDM20802_setup.exe file to
begin the driver installation.
\device drivers\FTDI Uart
3. The installation process will begin and you should observe output similar to the following messages on the screen of your PC:
32-bit OS detected
\dpinstx86.exe
Installation driver
FTDI CDM driver installation process completed...
4. When the installation is complete, plug in the B connector of the USB cable into the
Board, and the larger A connector into the USB port of your PC.
5. If the driver installation was successful, the Ports (COM & LPT) section of the Device
Manager will display USB Serial Port (COMx) or similar message, as highlighted in
Figure 2.
UM023003-0813
25
ZMOTION® Detection and Control Development Kit
User Manual
Figure 17. A Successful USB-to-UART Driver Installation
Note: To launch the Device Manager on Windows 7 systems, launch the Start menu, enter
device manager in the Search programs and files field, and press the Enter key.
To open the Device manager on earlier Windows systems, navigate via the following path:
Start → Control Panel → System → Hardware → Device Manager → Ports (COM&
LPT).
UM023003-0813
26
ZMOTION® Detection and Control Development Kit
User Manual
Appendix C. Schematic Diagrams
Figure 18 displays the schematics for the ZMOTION Development Board.
VCC_5v
U1
1
2
L1
FERRITE BEAD
C1
C2
4.7uF
0.1uF
6
Vin
Vout
GND
GND
EN
NC
3
VCC_3v3
5
4
NCP582LXV33T2G
P1
R4
4.75K
R3
20K
USB PWR
0.1uF
WALL PWR
1
2
3
1
2
3
4
5
C5
0.01uF
RxD
USB-OTG, mini-AB
4
20
16
15
VCCIO
TXD
VCC
RXD
RTS
USBDM
CTS
USBDP
DTR
8
R5
19
24
100K
27
28
17
NC1
DSR
RESET
DCD
NC
RI
OSCI
CBUS0
OSCO
CBUS1
CBUS2
3v3 OUT
GND3
GND2
GND1
TEST
26
21
18
7
25
0.1uF
AGND
CBUS3
C6
GREEN
D1
1
U2
CBUS4
1
5
2
VBUS
DM
DP
ID
GND
R2
330
C4
4.7uF
TxD
HDR/PIN 1x3
J4
YELL
D2
1
SH1
SH2
SH3
SH4
2
6
7
8
9
R1
330
C3
RXD
VCC_3v3_T
TXD
3
SW1
11
1
2
3
2
9
EG1218
PWR ON
10
6
23
22
13
14
U3
12
1
C7
IN
5
C8
2
FT232RL
0.1uF
OUT
4.7uF
3
R6
20K
GND
OC
EN
4
1
TPS2051B
RED
D3
OC
2
VCC_3v3
R7
100 ohm
Figure 18. ZMOTION Development Board Schematic Diagram, #1 of 2
UM023003-0813
27
ZMOTION® Detection and Control Development Kit
User Manual
TP1
3.3V_T
1
VCC_3v3_T
HDR/PIN 1x1
VCC_3v3_T
TP2
R8
3.3V_T
LED1
1
2
1
C9
HDR/PIN 1x1
BLUE
470
1uF
3.3V
TP3
GND
MOTION
1
HDR/PIN 1x1
2
TP4
GND
470
1
U4
1
2
3
4
LED3
R9
1
RED
TXD0/ANA0
VDD
PA0/T0IN/T0OUT/XIN/DBG
PA1/T0OUT/XOUT/ANA3/VREF/CLKIN
PA2/RESET/DE0/T1OUT
VSS
PA5/TXD0/T1OUT/ANA0/CINP
PA4/RXD0/ANA1/CINN
PA3/CTS0/ANA2/COUT/T1IN
8
7
6
5
TXD0/ANA0
RXD0/ANA1
ANA2
Z8FS040xSB20EG
RXD0/ANA1
HDR/PIN 1x1
VCC_3v3_T
J1
6
5
4
3
2
1
VCC_3v3_T
R11
100K
HDR/PIN 1x6
TP5
DBG
RST
J2
1
2
1
2
HDR/PIN 1x2
R12
10K
VCC_3v3_T
R13
10K
HDR/PIN 1x2
P2
TXD
2
4
6
RXD
1
3
5
VCC_3v3_T
HDR/PIN 2x3
JUMPER SETTINGS:
RXD0/ANA1
2
U6
1
2
3
4
5
6
7
8
LED2
16
15
14
13
12
11
10
9
1
2
3
4
5
6
7
8
16
15
14
13
12
11
10
9
R15
47K
C11
0.01 uF
C10
1 uF
RED
1
10
11
12
13
14
15
16
17
18
PROTO1
proto9x20
S
GND
2
PROTOTYPE AREA (.1X.1 GRID)
VCC_3v3_TDO NOT POPULATE HEADERS
U5
PyroSensor Generic
D
R14
470
10
11
12
13
14
15
16
17
18
J1,J2: IN FOR DBG
J3: 1-2 RxD
2-3 LED
J4: 1-2 USB PWR
2-3 WALL POWER
1
LED2
3
RxD
1
2
3
J3
HDR/PIN 1x3
STATUS &
WHITE LIGHT
DETECTION
spare
U7
1
2
3
4
5
6
7
8
16
15
14
13
12
11
10
9
1
2
3
4
5
6
7
8
16
15
14
13
12
11
10
9
1
2
3
4
5
6
7
8
9
1
2
3
4
5
6
7
8
9
spare
Figure 19. ZMOTION Development Board Schematic Diagram, #2 of 2
UM023003-0813
28
ZMOTION® Detection and Control Development Kit
User Manual
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 facets about Zilog product offerings, please visit the Zilog Knowledge Base or consider participating 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.
UM023003-0813
29