CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

RGB LED DRIVER

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
IceMetal



Joined: 20 Nov 2008
Posts: 79
Location: white Plains, NY

View user's profile Send private message Yahoo Messenger

RGB LED DRIVER
PostPosted: Fri Jul 10, 2009 1:54 pm     Reply with quote

Hi guys I'm trying control an RGB led driver, the led driver has 2 inputs that I'm using, the clock the for every pulse selects the led and the SDI that everytime is high will light up the LED
The driver can control 8 RGB leds( 24 LEDS) so after 24 clock pulses it goes back to the begining of the led.
in between thouse pulses I have to set the SDI high to light up the LEDs I want, so I was thinking to send a command like R00011000 to lit up the 2 middle red LEDs, or B00011000 to lit up the 2 middle blue leds, how can I send 2 package of data like to select the color and the location of the LED.
Thank you guys.


Code:
#include <16F887.h>           
#FUSES NOWDT            
#FUSES NOMCLR
#FUSES NOCPD
#FUSES NOBROWNOUT
#FUSES XT 

#use delay(clock=4000000)
#use rs232(baud=9600,parity=N,xmit=PIN_C6,rcv=PIN_C7,bits=8)
/////////////////////////////////////////////////////////////////////////////////

#define SDI     PIN_D0   
#define CLK     PIN_D1

int i, data;

counting()
{
output_low(SDI);
for (i=0; i<data; ++i){
output_low(CLK);
delay_ms(100);
output_high(CLK);
delay_ms(100);
}
printf("%2x", data);
}   

Main() {
output_high(SDI);
delay_ms(100);
output_high(CLK);
delay_ms(100);
output_low(CLK);
while(1){
if(kbhit())
          {
             data=getc(); 
counting();
            }     

}
}   
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Fri Jul 10, 2009 1:59 pm     Reply with quote

Quote:
I'm trying control an RGB led driver

Post the manufacturer and part number of this chip.
IceMetal



Joined: 20 Nov 2008
Posts: 79
Location: white Plains, NY

View user's profile Send private message Yahoo Messenger

PostPosted: Fri Jul 10, 2009 2:08 pm     Reply with quote

sure its the STP24DP05
http://www.st.com/stonline/products/literature/ds/14714.pdf
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group