Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

How can i send blinking led command to STP16CP05 ?

Status
Not open for further replies.

vedo35

Newbie level 4
Newbie level 4
Joined
Sep 18, 2009
Messages
6
Helped
3
Reputation
6
Reaction score
3
Trophy points
1,283
Location
netherlands
Visit site
Activity points
1,318
Hi friends since long time i was busy with STP16CP05 led driver ic. Its a serial in led driver with 16 bit output. I made myself development board for learning. Codes work ok but now next step project is to make blinking leds or some leds are blinking some are continious burning. which codes i need? and to which line i have to put that code?

My example code:


#include <16F877.h>
#FUSES NOWDT
#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_C0
#define CLK PIN_C1
#define LE PIN_C2
int i, data;

void 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);
}
void Send16Bit(unsigned int16 data16bit )
{
unsigned int16 i;
for(i=0x8000;i>0;i>>=1)
{
if(i&data16bit)output_high(SDI);
else output_low(SDI);
output_high(CLK);
delay_us(1);
output_low(CLK);
}
output_high(LE);
delay_us(5);
output_low(LE);

}
unsigned int16 led_data;

void Main()
{
output_high(SDI);
delay_ms(100);
output_high(CLK);
delay_ms(100);
output_low(CLK);
while(true)
{
led_data = 0x80BF;

Send16Bit(led_data );
if(kbhit())
{
data=getc();
counting();

}
}
}
 

Post project files and circuit zipped.

source code is up side i already gave.

datasheet:

https://www.st.com/web/en/resource/technical/document/datasheet/CD00126634.pdf

i made same like in page 17. pin OE connected to grounded. STP16CP05.jpg

Thanks for helps.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top