DATASHEET SEARCH SITE | WWW.ALLDATASHEET.COM

Document overview

  • Manufacturer or author: Provided By ALLDATASHEET.COM(FREE DATASHEET DOWNLOAD SITE)
  • PDF pages: 24

Technical content

Features

This Current Sensing Power Switch SCR with ZMOTION Control reference design offers the following features.

  • 90–240 V AC RMS input voltage range
  • Up to 3 A load current
  • Overcurrent protection
  • Adjustable minimum drop-out current protection
  • Less than 2 mA standby current at 120 V AC in an OFF state Potential Applications The motion-controlled current-sensing power switch can be used to develop a number of applications, including the following examples:
  • Occupancy-controlled commercial or architectural lighting
  • Motion controlled night-lighting within the home or medical care facility Note: Reference Design RD002302-0814 Current Sensing Power Switch SCR with ZMOTION® Control

(L) x 1.85" (W) x 0.7" (H). A block diagram of the Board is shown in Figure 2. Figure 1. The Current Sensing Power Switch SCR with ZMOTION Control

pulse from the MCU is received. Figure 2. A Block Diagram of the Current Sensing Power Switch SCR with

the MCU information about every overcurrent event. Figure 3. Power Switch Base Power Board, Top View

at the next voltage zero crossing. phase shift between AC voltage and load current due to load impedance. the current zero crossing minimizes surges in load current. Figure 4. The ZMOTION Detection Module II

MCU will deactivate the switch. alerting a technician to the over/undercurrent detection event.

  • Startup: contains the Reset and LP_Startup states
  • Off: contains the OFF state
  • Turning-on: contains the Voltage Zero Crossing (V-ZC) state
  • On: contains the Current Zero Crossing (I-ZC) state Table 1 summarizes the operating characteristics of each software state within these pri- mary modes of operation; all are further described in this section. Figure 5 depicts a state transition in the Current Sensing Power Switch SCR with ZMO- TION Control.

Table 1. Operating Characteristics of Each Software State of the hardware reset event. second to allow external circuitry to stabilize before attempting to control the Power Switch. seconds after motion detect signal goes idle.

Figure 5. Current Sensing Power Switch SCR with ZMOTION Control State Transition

RD002302-0814 Page 8 of 24 Current Sensing Power Switch SCR with ZMOTION® Control Reference Design frequency to 1.38 MHz and enables all peripherals (and GPIO pins) for normal operation. The system is then transitioned to either the OFF state or the Voltage Zero Crossing (V- ZC) detection state, depending on the setting of a configurable value in Flash memory. The default setting is to transition to the V-ZC state for the purpose of activating the Power Switch. OFF State While the Power Switch is in the OFF state, PA1 is held High, thereby blocking the load current through the Power Switch. In the OFF state, the Z8F2480 MCU is typically in a low-power mode (i.e., Halt Mode) and only executes code after an interrupt signal occurs (see the Software Events section on page 11). Whenever the system is in a non-startup state, TMR1 generates a periodic interrupt every 220 ms to allow the main routine to mon- itor the motion detect signal every 220 ms. If the motion detect signal is active, the system transitions to the V-ZC state. V-ZC State In the Voltage Zero Crossing (V-ZC) state, software continues to monitor the motion detect signal and must also monitor PD3 edges (i.e., the V-Edge signal) to estimate the period and zero crossing of the AC mains voltage. This state also requires the use of another timer (TMR2) to monitor failed V-ZC detections (i.e., the V-ZC-TO signal). As with the OFF state, the CPU is idled (i.e., enters Halt Mode) until an actual event occurs to minimize current consumption. Upon entering the V-ZC state, the software waits for the C1 output to stabilize (either High or Low), then enables PD3 edge interrupts. Because the main voltage is half-wave rectified, after three V-Edge signals occur (after approximately 1.5 to 2 periods), the soft- ware has enough information to calculate the AC period and estimate the location of the voltage zero crossing (i.e., the V-ZC-OK signal in the state diagram). At 50 Hz, two peri- ods should occur within 40 ms, which is used as the TMR2 time-out period. If TMR2 expires before the software determines V-ZC-OK, then the V-ZC-TO signal has occurred. In this instance, the software will retry the voltage zero crossing detection until the num- ber of retries exceeds Max (defaults to 10). If the software is unable to determine the AC Voltage Zero Crossing, the system transitions to the OFF state, in which it waits for another motion detection signal. If the V-ZC-OK signal is detected, the software transi- tions to the ON state. ON State Upon entry to the ON state, the software configures TMR0 for PWM Mode (using the period obtained in the V-ZC state) to generate negative pulses on PA1. In addition, the PD3 (C1 output) interrupt source is disabled (suppressing the half-wave rectified V-Edge signal) and the PA0 falling edge interrupt source is enabled. PA0 is a full-wave rectified digitized representation of the AC load current. PA0 goes Low just before the actual load current zero crossing, and goes High just after the current zero crossing. TMR2 continues to run to provide a watchdog time-out for current zero crossing detection (I-ZC), and pro- vides a timing reference for measuring the duration of the load current zero crossing. Within the PA0, edge interrupt software reads the current TMR2 count to obtain a time-

RD002302-0814 Page 9 of 24 Current Sensing Power Switch SCR with ZMOTION® Control Reference Design stamp, then modifies the Interrupt Edge Select Register to trigger another interrupt on the opposite edge polarity. After completing the transition to the ON state, the PWM timer will automatically gener- ate SCR pulses at the estimated midpoint of the voltage zero crossing. For a perfectly resistive load that exhibits no temperature effects, the TMR0 could remain in PWM Mode indefinitely to provide reasonably accurate pulses close to the midpoint of the zero cross- ing. However, for reactive loads (or even resistive loads with operating characteristics that vary with temperature), continuing to use the voltage zero crossing reference is not suit- able. To keep the SCR conducting, it is necessary to activate the SCR pulses near the mid- point of the current zero crossing. Consequently, the software only leaves TMR0 configured in PWM Mode, thereby gener- ating SCR pulses at the midpoint of the voltage zero crossing, until two current zero cross- ings are detected (i.e., PA0 is observed going Low, then going High, over two AC half- cycles). At this point, PA0 interrupts are disabled and the software reconfigures TMR0 for Gated operating mode to provide better accuracy in the position of the SCR pulse. In Gated Mode, TMR0 only counts while PA0 is Low (i.e., during the current zero crossing). The timer generates an interrupt when PA0 goes High (i.e., at the end of the current zero crossing) and upon each timer reload while the timer is active. When a timer reload event occurs, the timer output pin (PA1) changes state. Each time TMR0 is suspending (i.e., at the PA0 rising edge) and, when initially switching the timer from PWM Mode at the end of V-ZC, the software sets the TMR0 reload value to half the duration of the last measured current zero crossing time. As a result, the hardware automatically generates the start of the SCR pulse at the approx- imate location of the current zero crossing without software intervention. In the first TMR0 reload interrupt that occurs after PA0 goes Low, the software reconfigures the reload value to correspond to the maximum SCR pulse width (typically 2 ms). If there is a second reload interrupt during a zero crossing, the software manually deactivates the SCR pulse but leaves TMR2 active so that an accurate measurement of the current zero crossing duration can be determined on the TMR0 deassertion interrupt that occurs at the end of the zero crossing interval. This deactivation is manifested by summing the TMR0 reload intervals that occur while PA0 is Low, then adding the residual timer count on deassertion. Consequently, shortly after the PA0 rising edge occurs, software reprograms TMR0 to automatically initiate the next SCR pulse. If there is no PA0 falling edge (i.e., no current zero crossing), an SCR pulse will not get generated. Similarly, if the generated SCR pulse is too far away from the actual midpoint of the current zero crossing, the SCR will stop conducting, the switch will turn off, and no more PA0 falling edges will occur. After approximately 40 ms without any PA0 edges, the software determines that the I-ZC-TO event has occurred, and transitions to the OFF state. While in the ON state, the software must also monitor the load current to ensure that it is within an acceptable range. The external overcurrent circuit pulses PD1 during the portion of the AC signal where the load current is above the maximum threshold (Max). The soft- ware configures PD1 as a rising edge interrupt source but does not actually install a sepa- Note:

RD002302-0814 Page 10 of 24 Current Sensing Power Switch SCR with ZMOTION® Control Reference Design rate interrupt handler to monitor the overload signal. Because the CPU is brought out of Halt Mode in the ON state (due to an I-Edge or a TMR1 interrupt), the software can poll the state of the PD1 interrupt request signal in the Z8F2480 MCU’s interrupt controller to determine if there were any overcurrent events. This configuration helps simplify the soft- ware structure and allows greater priority to the I-Edge event. After eight consecutive overcurrent events occur, the software determines that an I > Max event has occurred, and will transition to the OFF state. This transition typically occurs in approximately 80 ms. The software uses two strategies for detecting I < Min. The first strategy is employed within the IZC_Isr after PA0 goes High, thereby ending the load current zero crossing. At this time, the voltage on PB2 (i.e., the load current sense resistor) is above the hardware threshold of approximately 200 mV (indicating that the load current is above 200 mA) but might not be above the software threshold (default of 220 mV). Therefore, at the end of the current zero crossing, IZC_Isr samples the voltage on PB2 (via the ADC) for up to 1 ms. If the load current remains below Min for this duration, the second load current sampling strategy is enabled; otherwise, the secondary sampling algorithm is disabled. If the IZC_Isr is not able to detect I > Min within approximately 1 ms of PA0 going High, then the foreground task will monitor the load current while PA0 is High. If no ADC read- ings above Min are obtained in four consecutive AC half-cycles (approximately 40 ms), the software determines that the I < Min event has occurred, and will transition to the OFF state. While in the ON state, the software continues to monitor the motion detect signal each time the MCU comes out of Halt Mode (which can occur every AC half-cycle). If the motion detect signal is still active, the 30-second motion detect time-out period is reset. If the motion detect signal remains inactive for 30 seconds, the motion detect time-out event occurs (i.e., Mot_TO), causing the Power Switch to be deactivated (i.e., TMR0 is disabled, thereby stopping the SCR pulses), thereby causing the system to transition to the OFF state. Software Strategy The current sensing power switch software is designed to minimize the number of time- critical events that must be processed by software. Where possible, hardware timers are used to initiate SCR pulses and time their duration, while software performs the less time- critical operation of calculating the starting position of the next SCR pulse. The most time-critical event that must be processed by software is servicing the I-Edge interrupt. Within this interrupt service routine, software must quickly calculate the period from the PA0 falling edge until I-ZC for the current zero crossing that just ended and reprogram TMR0 with a new reload value before the next falling edge of PA0, thereby marking the beginning of the next current zero crossing. For small load currents, PA0 will be Low most of the time, and the next zero crossing occurs approximately ¼ AC period (typically more than 4 ms) from the falling edge of PA0. In this instance, after the SCR pulse is initiated by the hardware, the software repro- grams the TMR0 reload value with the maximum SCR pulse width (typically 2 ms). Therefore, when PA0 goes High, thereby ending the current zero crossing interval, the

the next SCR pulse ¼ period from the PA0 falling edge. Table 2 summarizes the main events that cause software state transitions. Table 2. Main Events that Cause Software State Transitions Power Switch. V-Edge is a dual-edge interrupt in the V-ZC state. SCR pulse must be generated in the ON state. events, the software determines I > Max.

software determines I < Min. approximately 10 AC half-cycles after entering the ON state. transition to the OFF state (i.e., Max = 0 during I-ZC). the V-ZC state from the OFF state, or to stay within the ON state. state, the system is transitioned to the OFF state. Table 2. Main Events that Cause Software State Transitions (Continued)

RD002302-0814 Page 13 of 24 Current Sensing Power Switch SCR with ZMOTION® Control Reference Design Powering the Board The Base Power Board should be powered from a single-phase AC source between 90 to 240 V RMS. If any measurements will be performed on this Board, an insulated power source should be used to avoid the hazards of electrical shock and board damage. The Board should be connected to an American standard AC wall receptacle. Loads should be connected to the Board using an American standard three-pronged plug, which is inserted into the on-board receptacle. The Board wakes up and turns on the load after a delay of approximately one second. Downloading and Installing ZDS II If you have already installed ZDS II – Z8 Encore! <version> and have downloaded the RD0023-SC01 software and documentation by following the procedure on the paper insert in your kit (FL0159), skip ahead to the Viewing and Rebuilding ZMOTION Detection Module II Software section on page 15. The Current Sensing Power Switch SCR with ZMOTION Control Reference Design is delivered with the software installed and ready to use. If modifications are made to the existing software, it is necessary to use the ZDS II – Z8 Encore! Integrated Development Environment to update the firmware image stored in Z8F2480 MCU Flash memory. Observe the following procedure to download and install ZDS II. 1. Download the latest version of ZDS II – Z8 Encore! from the Downloadable Software category in the Zilog Store. 2. Run the software installation file and fo llow the on-screen instructions to install ZDS II – Z8 Encore!. Downloading and Installing the Software Observe the following brief procedure to download and install your RD0023-SC01 soft- ware. 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 ZMOTION 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. 2. Download the RD0023-SC01 software files, which are available free from the Zilog website. 3. When the download is comple te, unzip the file to a convenient location on your PC’s hard drive. Double-click the following installation file and follow the on-screen instructions: Note:

RD002302-0814 Page 14 of 24 Current Sensing Power Switch SCR with ZMOTION® Control Reference Design ZRD0023SCZMZRD_<version>.exe Viewing and Rebuilding the Base Power Board Software Source code and ZDS II project files are provided with this reference design to allow users to become familiar with the operation of the AC Power Switch. No software modifications are required to use this reference design. Observe the following procedure to view and rebuild the Base Power Board software. 1. Launch the ZDS II – Z8 Encore! application by navigating via the Windows Start menu to: Programs → Zilog ZDS II_Z8Encore!_<version_number> → ZDSII_Z8Encore!<version_number> 2. From the File menu, select Open Project. The Open dialog box appears. 3. Browse to the ZRD0023SCZMZRD Base Power Board which, by default, is located in the following path: C:\\Program Files\\Zilog\\ZRD0023SCZMZRD_<version>\\Firmware\\Base Board\\ 4. Select the AC_Switch_ZM.zdsproj file and click Open to display the initial ZDS II program screen. To view the source files, double-click the Project Files folder on the left side of the IDE interface. Double-click an individual file to open the file in the ZDS II file editor. 5. Click the Rebuild All toolbar icon or select the Build → Rebuild All menu option. 6. When the rebuild is complete, a Build succeeded message will appear, as high- lighted in Figure 6. Note:

The checksum shown in Figure 6 may be different at the time of the software release. are required to use this reference design. Figure 6. A Successful Build

RD002302-0814 Page 16 of 24 Current Sensing Power Switch SCR with ZMOTION® Control Reference Design Observe the following procedure to view and rebuild the ZMOTION Detection Module II software. 1. From the File menu, select Open Project. The Open dialog box appears. 2. Browse to the ZMOTION Detection Module II pr oject which, by default, is located in the following path: C:\\Program Files\\Zilog\\ZRD0023SCZMZRD_<version>\\Firmware\\ZMOTION\\ 3. Select the ZMOTION.zdsproj file and click Open to display the initial ZDS II pro- gram screen. To view the source files, double-click the Project Files folder on the left side of the IDE interface. Double-click an individual file to open the file in the ZDS II file editor. 4. Click the Rebuild All toolbar icon or select the Build → Rebuild All menu option. 5. When the rebuild is complete, a Build succeeded message will appear, as high- lighted in Figure 7.

The checksum shown in Figure 7 may be different in the final software release. this document is subject to change. Figure 7. A Successful Build

SCR with ZMOTION Control Reference Design Board. Stresses greater than those listed in Table 3 may cause permanent damage to the device. to absolute maximum rating conditions for extended periods affects device reliability. SCR with ZMOTION Control Reference Design Board. with ZMOTION Control Reference Design Board. Table 3. Absolute Maximum Ratings Table 4. Recommended Operating Conditions Table 5. Electrical Operating Characteristics

Figures 8 and 9 show waveforms for the operation of the Base Power Board. The three channels in Figure 8 are described below. Yellow. Channel 1: Rectified load current. Green. Channel 2: Pulses to turn CPC1966 ON. Red. Channel 3: Load current. Figure 8. Switcher Executes Command ON

RD002302-0814 Page 20 of 24 Current Sensing Power Switch SCR with ZMOTION® Control Reference Design The three channels in Figure 9 are described below. Yellow. Channel 1: Rectified load current. Green. Channel 2: Pulses to turn CPC1966 ON. Red. Channel 3: Load current.

Ordering Information

The products associated with this Current Sensing Power Switch SCR with ZMOTION Control Reference Design can be purchased from the Zilog Store – simply click the Store Product ID listed in Table 6. Figure 9. Switcher Executes Command OFF Table 6. Current Sensing Power Switch Reference Design: Ordering Information

  • Base Power Board (preprogrammed with software contained in the RD0023-SC01 source code file)
  • ZMOTION Detection Module II (affixed to the Base Power Board)
  • Current Sensing Power Switch SCR with ZMOTION Control Reference Design Kit In- sert (FL0159) Software and Documentation Upon installation, the software and documentation for this reference design will be located in the following directories. <Installation directory> \\Docs \\Firmware |___ Base Board |___ ZMOTION \\PCB Related Documentation The documents associated with this Current Sensing Power Switch SCR with ZMOTION Control Reference Design are listed in Table 7. Each of these documents can be obtained from the Zilog website by clicking the link associated with its document number.

Table 7. ZMOTION RF Wireless Module Documentation

RD002302-0814 Page 24 of 24 Current Sensing Power Switch SCR with ZMOTION® Control Reference Design 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 at http:// zilog.com/kb or consider participating in the Zilog Forum at http://zilog.com/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. 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 TH E EXPRESS PRIOR WRITTEN APPROV AL 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 fa ilure of the life support device or system or to affect its safety or effectiveness. Document Disclaimer ©2014 Zilog, Inc. All rights reserved. Information in this publication concerning the devices, applications, or technology described is intended to suggest possible uses and ma y 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 INFORMATI ON, 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. Z8 Encore!, Z8 Encore! XP, and ZMOTION are trademarks or registered trademar ks of Zilog, Inc. All other product or service names are the property of their respective owners. Warning: