Design Articles

Hands On: Evaluation Kit Eases Lighting Design Starts

Cypress’ CY3267 PowerPSoC Lighting Evaluation Kit enables you to start experimenting with complex HB LED systems in a matter of minutes.

By John Donovan, Low-Power Design

CY kit picture

Normally you order an evaluation kit to check out whether a particular microcontroller seems appropriate for a design you have in mind; if everything seems OK, you then order a more costly development kit to prototype your design. Cypress’ CY3267 PowerPSoC Lighting Evaluation Kit manages to cross that line, enabling a quick out-of-the-box evaluation within a few minutes but including a full suite of tools, circuits, and programmable components to enable developing some sophisticated lighting control systems.

The CY3267 PowerPSoC kit includes a main board built around a CY8CLED04D PowerPSoC MCU in a floating load buck topology. The PSoC core drives four 1A internal MOSFETs that power a 10W 4-channel RGBA LED mounted on a separate daughter card sitting atop a large heatsink. A power supply, USB cable, LED diffuser, an assortment of jumpers, and a MiniProg programming connector complete the kit.

Within five minutes of opening the package I was able to connect the daughter card to the main board; connect the main board to my computer; power up both boards; and cycle through the different colors in the LED array using the two Capsense buttons. Five minutes later I had installed the Intelligent Lighting Control application included on the kit CD and could experiment with basic lighting control.

Figure 1
Figure 1: Intelligent Lighting Control GUI

The Intelligent Lighting Control application (Figure 1) works with the default firmware to demonstrate 4-channel color mixing. From the CIE Color Selection tab you can click on any point on the color gamut and watch the LED array output that color. You can set the intensity by moving the Requested Luminous Flex slider. You can also set the white intensity by moving the Color Temperature Control slider (up to 4000K).

Clicking on the Direct LED Control tab you can move each of the four sliders to select the intensity of the red, green, blue, and amber LEDs.

Control Architecture

PowerPSoC adds numerous peripherals to the programmable PSoC core to address lighting control and other high-power applications. Each chip in the CY8CLED04Dx family includes up to four independent channels of constant-current drivers with hysteretic controllers, gate drivers, internal 1A MOSFETs, configurable digital and analog peripherals, embedded flash memory, and an 8-bit MCU. The high degree of integration makes the evaluation board look rather Spartan.

Figure 2
Figure 2: PowerPSoC control loop

The PowerPSoC control loop (Figure 2) consists of internal current sense amplifiers and hysteretic controllers that continuously monitor the current through each channel. This is made possible by implementing a floating buck topology, with the loads ‘floating’ between a high-side current sense resistor and a low-side switch. The controller monitors the load current in real time and controls it by switching the power MOSFET. The two DACs are programmed with the lower and upper current thresholds respectively, which can easily be controlled by firmware.

Dimming the LEDs

 Cypress takes an unusual approach to dimming LEDs. Dimming is usually accomplished using pulse width modulation (PWM), varying the width of the rectangular pulses to achieve the desired dimming level. In a typical PWM circuit a reference signal and a sawtooth waveform are both fed into a comparator. When the value of the reference signal exceeds that of the sawtooth, the comparator output goes high, turning on a MOSFET and lighting the LED; when the reference signal drops below that of the sawtooth, the LED is turned off. The reference clock frequency is fixed, with the duration of the pulses determining the duty cycle.

Rather than relying on PWM Cypress utilizes its proprietary variation of high-resolution stochastic signal density modulation (SSDM), which it calls precision illumination signal modulation (PrISMTM). A PrISM circuit consists of three components (Figure 3):

  • A pseudo-random counter, which generates n-bit pseudo random code for each clock tick.
  • A signal density register, a simple n-bit register that holds the desired signal density.
  • An asynchronous comparator; its value goes high when the signal density value called for is greater than the value in the pseudo random counter, and conversely.
Figure 3
Figure 3: PrISM Block Diagram

As the name implies, PrISM varies the density of the pulses going to the MOSFET rather than their length (Figure 4). The frequency of the pulses is a function of signal density, resulting in a sort of random spread spectrum modulation of the LEDs. Since there are no spectral spikes at a particular frequency, the result is lower overall EMI and lower inductor noise in downstream filter circuits. Lower EMI and noise compared to standard PWM circuits seems to have been Cypress’ main reasons for choosing to use this modulation technique.

Though 8-bit PrISM can be implemented using a single PSoC digital block, the technique isn’t without its challenges for the lighting designer. The dimming performance of PrISM is limited by the lower and upper modulation frequencies, each of which faces certain constraints:

  • The lower frequency needs to be at least 120 Hz and preferably at least 300 Hz for the result to be flicker free.
  • The upper frequency should be <=0.1*fsw –the switching frequency of the regulator circuit—to ensure that the regulator doesn’t filter out some of the high-frequency components.
Figure 4
Figure 4: PWM, PrISM, and DSM at 50% duty cycle

Using the CY3267 evaluation kit you can implement PrISM dimming with 8-, 16-, and 32-bit precision using one, two, or three PSoC digital blocks, respectively. Higher resolution gives you finer control, but at a price. Assuming 16-bit precision and an input frequency (FIN) to PrISM of 1 MHz:

FOUT (MIN) = FIN/2n = 1 MHz / 65536 = 15 Hz

To avoid the resulting visible flickering, you might increase the input frequency to 8 MHz, resulting in

FOUT(MIN)=  FIN / 2n = 8 MHz / 65536 = 120 Hz
FOUT(MAX) = FIN / 2 = 8 MHz / 2 = 4 MHz

The lower frequency just barely avoids visible flickering and FOUT(MAX at 4 MHz risks density loss due to filtering of the highest frequency components by the regulator circuit. The solution is to reduce the resolution to the point where significant signal density is no longer lost. Assuming typical switching regulators, this is usually somewhere between 8- and 16-bit resolution. Cypress provides all the source code in the evaluation kit to enable you to experiment with these options.

Trying It Out

While the “out of the box” installation is quick, preparing to work with the kit takes a bit longer. First install the CY3267 kit software from the supplied disk. The Intelligent Lighting Control application installs directly from the Software directory. Then copy the other directories to your hard drive:

  • Documents contains the Quick Start Guide and full Kit Guide.
  • Firmware contains project files to use with the kit along with the hex files for the default firmware.
  • Hardware contains schematics and Gerber files for the main board and LED board.
Figure 5
Figure 5: PSoC Designer project screen

Next install first PSoC Designer 5.x from the second disk and then PSoC Programmer. Launch both programs and check for updates. Finally connect PSoC MiniProg1 to your PC and install it, too.

Now launch PSoC Designer and open the file The Start Page provides numerous PSoC resources, including all manuals, app notes, software, drivers, videos, and recent updates. Click on the [Chip] tab and you’ll see something like Figure 5. This view is highly customizable from the View menu, which offers a dozen different options. In the Chip view you can manually program each of the PSoC components and route their inputs and outputs accordingly. Since that’s already been done for this demo program, don’t change it for now.

  • Build the project (F6); after a minute or two you should see “CY3267_PowerPSoC – 0 error(s).” If not, the offending code will pop up in an editor window so you can fix it and try again.
  • Plug the PSoC MiniProg to J12 and connect it to your PC with a USB cable; the red LED on MiniProg should light up.
  • Select Program Part (Ctrl-F10). This calls up PSoC Programmer, which appears as a popup window that should say “Powered” and “Connected” in green. Set Acquire Mode to Reset and leave Verification off.
  • Click on the down arrow to program the PSoC. The green light on MiniProg will flash while this is happening. After seeing Busy for some time you should see “Operation Succeeded!” Congratulations, you’ve just re-flashed the firmware!

All of the C and ASM source files for this program are available in the Workspace Explorer window. They’re well structured, clearly commented, and informative to read (well, the C files anyway). You can obviously customize them at will, but as of this writing the Intelligent Lighting Control program isn’t available as source code, so you’ll have to write your own GUI to reproduce that functionality.

Cypress does supply source code for another program that works with this kit, CE61163 - PowerPSoC - Using CapSense(R) Buttons for LED Control on the CY3267 Evaluation Kit, a code example that demonstrates the use of the Capsense interface for LED lighting control. The code from both these examples can form the basis for any intelligent lighting control system you choose to designing around PowerPSoC.

The CY3267 PowerPSoC Lighting Evaluation Kit is highly extensible. The main board has an Artaflex Radio interface; a FirstTouch RF interface; fan and thermistor interfaces; headers for programming both PSoCs (the second is CY8C24894); an RJ-45 jack that connects to CY3215-DK ICE Cube Emulation Kit; plus the board can be controlled by I2C and Full Speed USB.

Bookmark and Share

Insert your comment

Author Name(required):

Author Web Site:

Author email address(required):


Please Introduce Secure Code: