Newbie trying to work with the CY8CLED04 with not much luck

This is the forum to discuss the Intelligent Lighting solutions offered by Cypress. The discussion topics include HBLED Drivers, Dimming Technology and Communication Methods.

Moderator: yzr

Newbie trying to work with the CY8CLED04 with not much luck

Postby Corp666 » Tue Nov 24, 2009 9:47 am

I have a CY3269 lighting starter kit that had a CY8CLED04-68 chip on it.

I am trying to just learn about the PSOC, but I am also getting back into C... it's been close to 20 years since I was programming heavily in C, and I've forgotten a LOT. I'm also new to embedded programming, but I do know enough about circuit design and what the various features and components of the chips are and how they work.

Anyway, one of the first things I want to do with this CY3269 board is just do a simple fade in then out of red, then blue, then green.

I have placed 3 SSDM modules and connected them to the appropriate pins that the LED is connected to, and I have set the parameters of the SSDM modules naming them SSDM_Red, SSDM_Green, and SSDM_Blue. Clock on the modules is VC3 (which is the same as VC1, and VC1 is SysClk/12 and SysClk is 24Mhz). Compare type on my SSDM modules is less than, Dimming resolution 8 bit, Signal density 127 and sync to SysClk.

I'm not sure I understand the SSDM datasheet... it seems SSDM_WriteSignalDensity should take a parameter from 0..127 which should correspond to the proportional brightness of that SSDM channel. Am I wrong?

The following code just produces a quick fade of the red LED from off to full brightness, then it just starts over. I don't understand why it's doing this instead of red, then green, then blue.

I know the following code is probably atrocious, but I am mostly trying to figure out the SSDM modules for now :)

Any ideas on why it's doing what it's doing? I can't figure it out.


Code: Select all
   while(1) {
      
      //cycle through red intensity
      for (i=0; i < 127; i++) {
          SSDM_Red_WriteSignalDensity(i);
         //delay loop
         for (j = 0; j < 10; j++) {
             for (k = 0; k < 200; k++);
         }
      }   

       SSDM_Red_WriteSignalDensity(0);

      //cycle through green intensity
      for (i=0; i < 127; i++) {
          SSDM_Green_WriteSignalDensity(i);
         //delay loop
         for (j = 0; j < 10; j++) {
             for (k = 0; k < 200; k++);
         }
      }   
       SSDM_Green_WriteSignalDensity(0);

      //cycle through blue intensity
      for (i=0; i < 127; i++) {
          SSDM_Blue_WriteSignalDensity(i);
         //delay loop
         for (j = 0; j < 10; j++) {
             for (k = 0; k < 200; k++);
         }
      }         
   }
Corp666
Newbie
Newbie
 
Posts: 4
Joined: Sun Sep 28, 2008 5:47 pm

Re: Newbie trying to work with the CY8CLED04 with not much luck

Postby yzr » Fri Dec 11, 2009 7:57 am

Corp66,
The signal density does correlate to the intensity of a channel. The SSDM UM is based on the on time of the channel being broken into pseudorandom pulses. A PRS module produces random variables that are based on the dimming resolution (or seed value), an internal register compare function turns on the channel if PRS pulse is smaller then signal density value.

In your code, you are observing a fade sequence on the RED channel because you are incrementing the signal density using value i. The j and k variable loops only act as a delay source.

If the Green and Blue channels had to be accessed then a SSDM_Green_WriteSignalDensity(i) and SSDM_Blue_WriteSignalDensity(i) instructions are also required.

Did this address your question?

yzr
yzr
Cheese Cube
Cheese Cube
 
Posts: 27
Joined: Wed Jul 09, 2008 12:28 pm

Re: Newbie trying to work with the CY8CLED04 with not much luck

Postby Corp666 » Sat Dec 12, 2009 5:45 pm

Hi,

Thanks for your reply, yzr... I ended up going a different route. I found that the SSDM modules were (in my view) more designed for specifying exact colors and lumen values in relation to the type of LED's being used.

I ended up going a different direction - still using the CY8CLED04 chip, but I set up three 8-bit PWM's instead, and used a lookup table to equate percentage values with LED duty cycle. I managed to get the effect I wanted, and it is working well.

Thanks!
Corp666
Newbie
Newbie
 
Posts: 4
Joined: Sun Sep 28, 2008 5:47 pm


Return to “%s” Intelligent Lighting

Who is online

Users browsing this forum: No registered users and 1 guest

cron