AN56581 PowerPSoC® – Designing LED Driver Circuits for MR-16 Lamps with DMX-512 Interface Author: Srinivas NVNS Associated Project: Yes Associated Part Family: CY8CLED04D01-56LTXI Software Version: PSoC® Designer™ 5.4 Associated Application Notes: AN47372 AN56581 describes the design of an LED driver circuit in a MR-16 form factor with DMX-512 interface using PowerPSoC controllers. This document demonstrates the use of PowerPSoC to design small form factor fixtures such as MR-16 lamps with DMX-512 interface. It outlines the architecture of the fixture and the LED driver board reference design, followed by its bring up and operation procedure. Code examples to implement color mixing for multicolor lamps and tunable white light systems are also provided. Figure 1. MR16 Fixture Introduction Cypress has developed a compact LED driver solution for use in an MR16 fixture. The controller board uses the PowerPSoC device for lighting control and DMX-512 communication Light output of LEDs is controlled by the current flowing through them. By controlling the current in the four channels, you can achieve a desired color at the desired intensity. Alternatively, the LEDs are driven with a constant current. You can modulate the time during which the current is driven to achieve a desired color. This function of the solution is implemented by PowerPSoC. This solution incorporates DMX control, which enables you to network several fixtures, and at the same time, maintain individual control for each fixture. It provides the flexibility to connect a maximum of 85 fixtures in a network through the DMX512 communication protocol, when 6 slots are used per fixture. The fixture has four colors of LEDs: Red, Green, Blue, and Amber (RGBA). If three slots of control per fixture are used, which is similar to the tunable white light firmware variant, you can connect up to 170 fixtures. The document describes a standard MR16 lamp with integrated LED driver. It gives an overview of the PowerPSoC family of controllers, specifications of the device used in this solution and a brief introduction to the DMX-512 communication protocol. MR16 Fixture The MR16 fixture is a lighting industry standard format that has a small form factor. The fixture discussed in this application note has a RGBA LED emitter board (that forms the primary light source) and a heat sink connected to a cooler device. The fixture requires the heat sink to remove the heat generated by LEDs. The cooler on the MR16 fixture is a forced air type of cooler and removes heat from the heat sink by blowing ‘micro’ jets of air. A driver board mounted on the cooler powers it. The hardware, firmware details of the solution are explained in later sections. www.cypress.com Document No. 001-56581 Rev. *E 1 PowerPSoC® – Designing LED Driver Circuits for MR-16 Lamps with DMX-512 Interface Figure 2. Integrated MR16 Fixture Heatsink Specifications of the PowerPSoC Solution The following table gives the specifications of the four-channel PowerPSoC solution. This solution drives four channels of HBLEDs. Cooler Cooler Board Driver Board Table 1. PowerPSoC Fixture Controller Specifications Description PowerPSoC Overview The PowerPSoC family incorporates Programmable ® System-on-Chip (PSoC ) technology with the best-in-class power electronic controllers and switching devices. This combination creates easy to use power system-on-chip solutions for lighting applications. It is an ideal platform to create lighting solutions and is designed to replace the microcontroller, system ICs, and discrete components required for driving high brightness LEDs. The PowerPSoC family of devices combines up to four independent channels of constant current drivers. These drivers feature hysteretic controllers with the PSoC that contains an 8 bit microcontroller, configurable digital and analog peripherals, and embedded Flash memory. It operates from 7 V to 32 V and drives up to 1 A of current using internal MOSFET switches. It is also used to drive more than 1 A of current using external switches, and supports common power topologies such as buck and boost. PowerPSoC features three options of hardware modulators, including the Cypress patented Precise Illumination Signal Modulation (PrISM™) scheme, which interfaces with the hysteretic controllers and modulates the signal to provide dimming. For more information on PowerPSoC, see the datasheet and application notes available on the Internet at http://www.cypress.com/powerpsoc. www.cypress.com Value Cypress Solution PowerPSoC Number of LED Channels 4 Number of LEDs/Channel 1 LED drive current 700 mA per channel maximum Features Color Mix, Tunable white Light Communication protocol DMX512 –Physical layer RS485 Block Diagram Figure 3 shows the block diagram of this solution implementing a four-channel PowerPSoC. The controller is powered by a voltage supply that can vary from 7 V to 12 V, and is input through a 4-pin Molex connector. The DMX controls (D+ and D-) are also input through the same connector. The Cypress device used is a CY8CLED04D01-56LTXI from the PowerPSoC family of devices. It is programmed through the 5-pin ISSP MiniProg connector. The solution also contains the necessary discrete components, such as inductors and diodes to implement a floating load buck driver to drive current through the LEDs. The solution also provides 5 V supply to the cooler driver board. Document No. 001-56581 Rev. *E 2 PowerPSoC® – Designing LED Driver Circuits for MR-16 Lamps with DMX-512 Interface Figure 3. High Level Implementation of PowerPSoC Solution www.cypress.com Document No. 001-56581 Rev. *E 3 PowerPSoC® – Designing LED Driver Circuits for MR-16 Lamps with DMX-512 Interface PowerPSoC Figure 4. PowerPSoC Controller This solution is centered on the PowerPSoC series CY8CLED04D01-56LTXI Cypress IC. Figure 4 shows this implementation in the schematic. The CY8CLED04D0156LTXI is a PowerPSoC device that features: PSoC core with 8 digital blocks and 6 analog blocks 4 channels of constant current drivers Internal FETs rated at 32 V/1 A PWM/PrISM hardware modulators This device is used to implement a floating load buck configuration to drive current through the LEDs. The right side of the schematic in Figure 4 shows the four channels for the LEDs. Each channel is a hysteretic current regulator with a floating load buck topology, which has three implications: The regulator channel controls the current through the LED, not the voltage across the LED. No part of the LED is directly connected to ground. www.cypress.com The total voltage drop across the load must be less than the regulator’s input voltage. Several components that make a complete hysteretic controller are integrated into the PowerPSoC chip. This includes current sense amplifiers, comparators, voltage references, power FET switches, and gate drivers. The required external components include the power inductor, current sense resistor, free-wheel diode, input decoupling capacitor, and the output ripple capacitor. The corresponding component designators in the schematic for channel 1 are L1, R16, D5, C21, and C29. The channel 1 schematic is shown in Figure 5 on page 5. The left side of the schematic shows a connector J3 that provides +5 V and GND to the cooler driver board. There is also a resistive voltage divider circuit comprising of R4 and R6 that can be used to implement under-voltage lock out feature. The pins corresponding to the Built-in Switching Regulator (BSR) of the PowerPSoC are pulled to +5 V to disable it. The left side of the schematic also shows the set of decoupling capacitors for digital power, analog power, and gate drive power pins. Document No. 001-56581 Rev. *E 4 PowerPSoC® – Designing LED Driver Circuits for MR-16 Lamps with DMX-512 Interface Figure 5. Channel 1 Schematic DMX Communication The DMX controller and fixtures communicate through a RS485 transceiver. The PowerPSoC chip can only receive an 8-bit dimming data from a DMX Controller. This dimming data is used to control the current in the respective channel. The controller can send up to 512 bytes of data. Figure 6 shows a sample DMX controller. Figure 7. RS485 Transceiver Circuit Figure 6. DMX Controller Figure 8. 5 V Generation Circuit Each fixture has a PowerPSoC device. For a given lighting network, the addresses for the slots are assigned before any communication takes place between the controller and the lighting network. One light fixture can have any number of slots. For example, if the board controls only the Red, Green, Blue, and Amber LEDs, each LED channel is assigned a slot. Additional slots can be assigned for mode selection, intensity control, and more. You can also choose the required color and intensity by tuning the DMX Controller using the slider controls. The PowerPSoC device uses the DMX512 Rx User Module to receive the data packets sent across the network by the DMX Controller. Figure 7 shows the RS485 transceiver circuit. www.cypress.com Figure 8 defines the 5-V generation in the fixture controller board. Voltage input of 7 V to 12 V VCC_HV can be provided from an external power supply. LM317 is used to realize a 5-V generation circuit. This circuit powers the PowerPSoC, RS485 interface, and the Cooler Driver board in the fixture. Document No. 001-56581 Rev. *E 5 PowerPSoC® – Designing LED Driver Circuits for MR-16 Lamps with DMX-512 Interface Figure 10. Fixture Controller Board – Bottom Layer Bring Up of the PowerPSoC System This section explains how to bring up the PowerPSoC fixture controller. Figure 9 and Figure 10 show the top layer and the bottom layer of the board respectively. The power input is through the Molex connector (shown in Figure 9). 1. For a single fixture, set the external power supply to a minimum of 12 V/1 A. 2. Power-up the fixture controller board. 3. Program the part for the desired functionality using ISSP MiniProg connector in reset mode of programming (see Figure 9). 4. Ensure that the Red, Green, Blue, and Amber channels are connected between the LED MCPCB and fixture controller. 5. Connect the D+ and D- lines of the DMX controller cable to the fixture controller input connector pins 3 and 4. These pins are identified by nets A and B on the schematic shown in Figure 7. Ensure that the ground line of the DMX controller cable and the ground wire of the fixture controller cable are connected. Figure 9. Fixture Controller Board – Top Layer www.cypress.com 1. Power-up the DMX controller and vary the slider positions in the DMX Controller to see the change in the light output from the fixture. See Figure 6 on page 5. 2. Power-up the fixture controller board. 3. Program the part for the desired functionality using ISSP MiniProg connector in reset mode of programming (see Figure 9). 4. Ensure that the Red, Green, Blue, and Amber channels are connected between the LED MCPCB and fixture controller. 5. Connect the D+ and D- lines of the DMX controller cable to the fixture controller input connector pins 3 and 4. These pins are identified by nets A and B on the schematic shown in Figure 7. Ensure that the ground line of the DMX controller cable and the ground wire of the fixture controller cable are connected. 6. Power-up the DMX controller and vary the slider positions in the DMX Controller to see the change in the light output from the fixture. See Figure 6 on page 5 to see a DMX controller. Document No. 001-56581 Rev. *E 6 PowerPSoC® – Designing LED Driver Circuits for MR-16 Lamps with DMX-512 Interface value of 0 corresponds to 0%, 127 corresponds to 50%, and 255 corresponds to 100% brightness. Component Reference Designators Table 2 lists the reference designators of the significant components and connectors used on the PowerPSoC board and their description. Table 2. List of Component Reference Designators Reference Designator Table 3. DMX 512 Slider Positions for Color Mix Demo Slider Slider Position Slider 1 Description Value <= 85 LEDs are OFF Value > 85 to <= 170 Direct Control Mode Value >170 to <= 255 Preset Color Mode U1 LM317 – 5 V LDO regulator U2 CY8CLED04D01-56LTXI – PowerPSoC device Sliders 2-5 Controls the Intensity of Red, Green, Blue, and Amber LEDs respectively U5 RS485 Transceiver – the physical layer for DMX512MAX13082EESA Slider 6 Controls the Intensity of light output in the Preset Color Mode J1 Molex Connector J2 ISSP Connector R14, R16, R20, R24 Current Sense Resistors D2, D3, D6, D7 Freewheeling Diodes L1, L2, L3, L4 Inductors for the buck stage of LED drivers C29, C31, C32, C33 Output Capacitors C19, C21, C24, C27 Input Capacitors F1 Fuse Instructions 1. Power-up the DMX512 Controller. Firmware Functionality 2. To enable Direct Control mode of operation, set Slider 1 to a value between 86 and 170. 3. Increase the value of slider 2 from 0 to 255; you can see the intensity of the red LED vary from minimum to maximum. 4. Similarly, increase Slider 3 to 5 from 0 to 255 for the other three LEDs. 5. Vary the slider positions in different combinations to output different colors with varying intensity. 6. Next, set the value of slider 1 to a value greater than 170 to change to the Preset Color mode of operation. Set the value of slot 6 to 255 for maximum intensity. Seven colors are displayed in a sequential manner with a 5-second delay between them. In this mode, sliders 2 through 5 have no effect. 7. Vary the value of slot 6 from 0 to 255 to vary the intensity of the light output from 0% to 100%. There are two firmware variants: 1. Color Mix 2. Tunable White Light Color Mix Six DMX512 sliders are required for Color Mix. The sliders are mapped to slots 1 to 6. The value of Slot 1 selects the mode of operation and the value of Slot 6 controls the output light intensity described in Table 3. The Color Mix functionality has the following two modes of operation. Direct Control Mode: Sliders 2 to 5 are used to directly control the intensity of the Red, Green, Blue, and Amber LEDs individually. Preset Color Mode: Seven colors are sequentially displayed continuously. The seven colors, in order are White, Red, Green, Blue, Yellow, Magenta, and Cyan. The system displays each color for 5 seconds and then switches to the next color in the list. Slots 2 through 5 have no effect in this mode. In this mode, the intensity of the light output can be varied from 0% to 100% by varying the value of slot 6 from 0 to 255. A www.cypress.com Tunable White Light Three DMX512 Sliders are required for Tunable White Light. The sliders are mapped to slots 1 through 3. The Tunable White Light functionality has the following two modes of operation. Direct Control Mode: In this mode, the White Light varies from Warm White to Cool White. Use Slider 2 to vary the color temperature from 2,600 K to 25,000 K, in steps of 90 K. Preset Color Mode: In this mode, ten different shades of white light are displayed sequentially. The corresponding color temperatures are 2,700 K, 3,000 K, 3,500 K, 4,000 K, 4,500 K, 5,000 K, 5,700 K, 6,700 K, 8,000 K, and 10,000 K. Each color temperature is ON for five Document No. 001-56581 Rev. *E 7 PowerPSoC® – Designing LED Driver Circuits for MR-16 Lamps with DMX-512 Interface seconds and automatically switches to the next preset value. In both of these modes, the intensity of the light output can be varied from 0% to 100% by varying the value of Slot 3 from 0 to 255. A value of 0 corresponds to 0%, 127 corresponds to 50%, and 255 corresponds to 100% brightness. 4. Vary the value of slot 3 from 0 to 255, to see the intensity of light output vary from minimum to maximum. 5. Next, set the value of slot 1 to a value greater than 170 to change the mode of operation to Preset Color Mode. Set the value of slot 3 to 255 for maximum output light intensity. Ten color temperatures are displayed in a sequential manner with a 5-second delay. 6. Vary the value of slot 3 from 0 to 255 to vary the intensity of the light output from 0% to 100%. Table 4. Tunable White Light Slider Positions Slider Slider 1 Slider Position Value <= 85 LEDs are OFF Value > 85 to <= 170 Direct Control Mode Value >170 to <= 255 Preset Color Mode Slider 2 Vary the Color Temperature from 2,600K to 25,000K Slider 3 Controls the intensity of light output in both Direct Control and Preset Color modes The firmware described in this application note is developed using PSoC Designer. The latest version of PSoC Designer is available for free, and can be downloaded from http://www.cypress.com/psocdesigner/. Summary Instructions 1. Power-up the DMX512 Controller. 2. Set the value of slot 1 to any number between 86 and 170 to enable Direct Control mode of operation. Set the value of slot 3 to 255. 3. Increase value of slot 2 from 0 to 255; you can see the output color temperature varying from warm white (2,600 K) to cool white (25,000 K). www.cypress.com Accompanying Software This application note gives detailed instructions to develop a small form factor integrated MR16 Fixture Controller System based on the PowerPSoC family of devices. In addition, this solution enables you to create a network of lighting fixtures based on the DMX512 communication interface. Document No. 001-56581 Rev. *E 8 PowerPSoC® – Designing LED Driver Circuits for MR-16 Lamps with DMX-512 Interface Appendix Figure 11 illustrates the form factor of the four-channel PowerPSoC based LED fixture controller. Figure 11. Four-Channel PowerPSoC Board Mechanical Layout (all dimensions are in mm) References See the following application notes to know more about DMX 512 interfacing and implementation of PowerPSoC Lighting solutions: AN47372: PrISM™ Technology for LED Dimming CY8CLED0xx0x: Topology and Design Guide for Circuits Using PowerPSoC CY8CLED0xx0x - PowerPSoC® Firmware Design Guidelines, Lighting Control Interfaces About the Author Name: Srinivas NVNS Title: Applications Engineer Background: Srinivas holds a graduate degree in Power and Control from Indian Institute of Technology Kanpur, India. He enjoys working in power electronics and embedded systems design. He is currently working on PowerPSoC solutions. Contact: [email protected] www.cypress.com Document No. 001-56581 Rev. *E 9 PowerPSoC® – Designing LED Driver Circuits for MR-16 Lamps with DMX-512 Interface Document History ® Document Title: PowerPSoC – Designing LED Driver Circuits for MR-16 Lamps with DMX-512 Interface - AN56581 Document Number: 001-56581 Revision ECN Orig. of Change Submission Date ** *A 2769369 2811898 SNVN SNVN 09/25/2009 11/20/2009 *B 3176807 SNVN 02/18/2011 *C 3385166 MKKU 09/27/2011 *D 4542414 SNVN 10/17/2014 *E 4559173 SNVN 11/05/2014 www.cypress.com Description of Change New Spec. Update operating voltage max to 12 V. Updated Figure 11 with latest mechanical layout. Updated Figure 3 with latest block diagram. Updated software version with PSoC Designer 5.1 and PSoC Programmer 3.12 Updated firmware to remove warnings when compiled with ImageCraft compiler Document updated based on MEH-126 Projects updated and tested with PD 5.1 SP2. Updated template. Projects updated with PD 5.4. Images updated. Updated template. Corrected the abstract. Document No. 001-56581 Rev. *E 10 PowerPSoC® – Designing LED Driver Circuits for MR-16 Lamps with DMX-512 Interface Worldwide Sales and Design Support Cypress maintains a worldwide network of offices, solution centers, manufacturer’s representatives, and distributors. To find the office closest to you, visit us at Cypress Locations. PSoC® Solutions Products Automotive cypress.com/go/automotive psoc.cypress.com/solutions Clocks & Buffers cypress.com/go/clocks PSoC 1 | PSoC 3 | PSoC 4 | PSoC 5LP Interface cypress.com/go/interface Lighting & Power Control cypress.com/go/powerpsoc cypress.com/go/plc Memory cypress.com/go/memory PSoC cypress.com/go/psoc Touch Sensing cypress.com/go/touch USB Controllers cypress.com/go/usb Wireless/RF cypress.com/go/wireless Cypress Developer Community Community | Forums | Blogs | Video | Training Technical Support cypress.com/go/support PSoC is a registered trademark and PSoC Creator is a trademark of Cypress Semiconductor Corp. All other trademarks or registered trademarks referenced herein are the property of their respective owners. Cypress Semiconductor 198 Champion Court San Jose, CA 95134-1709 Phone Fax Website : 408-943-2600 : 408-943-4730 : www.cypress.com © Cypress Semiconductor Corporation, 2009- 2014. The information contained herein is subject to change without notice. Cypress Semiconductor Corporation assumes no responsibility for the use of any circuitry other than circuitry embodied in a Cypress product. Nor does it convey or imply any license under patent or other rights. Cypress products are not warranted nor intended to be used for medical, life support, life saving, critical control or safety applications, unless pursuant to an express written agreement with Cypress. Furthermore, Cypress does not authorize its products for use as critical components in life-support systems where a malfunction or failure may reasonably be expected to result in significant injury to the user. The inclusion of Cypress products in life-support systems application implies that the manufacturer assumes all risk of such use and in doing so indemnifies Cypress against all charges. This Source Code (software and/or firmware) is owned by Cypress Semiconductor Corporation (Cypress) and is protected by and subject to worldwide patent protection (United States and foreign), United States copyright laws and international treaty provisions. Cypress hereby grants to licensee a personal, non-exclusive, non-transferable license to copy, use, modify, create derivative works of, and compile the Cypress Source Code and derivative works for the sole purpose of creating custom software and or firmware in support of licensee product to be used only in conjunction with a Cypress integrated circuit as specified in the applicable agreement. Any reproduction, modification, translation, compilation, or representation of this Source Code except as specified above is prohibited without the express written permission of Cypress. Disclaimer: CYPRESS MAKES NO WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, WITH REGARD TO THIS MATERIAL, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. Cypress reserves the right to make changes without further notice to the materials described herein. Cypress does not assume any liability arising out of the application or use of any product or circuit described herein. Cypress does not authorize its products for use as critical components in life-support systems where a malfunction or failure may reasonably be expected to result in significant injury to the user. The inclusion of Cypress’ product in a life-support systems application implies that the manufacturer assumes all risk of such use and in doing so indemnifies Cypress against all charges. Use may be limited by and subject to the applicable Cypress software license agreement. www.cypress.com Document No. 001-56581 Rev. *E 11