幻彩燈珠介紹
一、幻彩燈珠其實我們可以理解為該燈珠內部有一顆LED驅動芯片外加R,G,B 3種顏色的LED的合封體。并且這顆LED驅動芯片可以驅動3路 LED,每一路LED驅動都跟內部的R,G,B通過封裝打線連接好了。
1、幻彩燈珠的應用場所:
(1)、家庭照明。幻彩燈珠可以應用于家庭中的各種照明場景,如客廳、臥室、廚房等。多彩變幻的顏色可以為家庭營造出溫馨、浪漫的氛圍。
(2)、商業場所。幻彩燈珠可以應用于商業場所的裝飾和照明,如商場、酒店、ktv等。多彩變幻的顏色可以為商業場所營造出藝術感和時尚感。
(3)、戶外景觀。幻彩燈珠可以應用于城市公園、廣場、橋梁等戶外景觀,為城市增添藝術氣息和夜間景觀
2、幻彩燈珠對比傳統燈珠優缺點:
(1)、顏色多彩變幻?;貌薀糁榈亩嗖首兓每梢詾榧彝ァ⑸虡I場所等營造出良好的氛圍
(2)、相比傳統的三基色LED燈珠+外置LED驅動芯片體積要小,更容易生產
(3)、相比傳統的LED燈珠+外置LED驅動芯片 成本更低
幻彩燈珠內置驅動芯片介紹
一、市場常見的有WS2812,SM16703P,目前我們公司推出了AD2203芯片,該芯片性價比更高。
AD2203是三通道LED驅動IC,內部集成有MCU數字接口、數據鎖存器、LED驅動等電路。通過外圍MCU控制實現該芯片的單獨灰度、級聯控制實現戶外大屏的彩色點陣發光控制 。 主要特征: 默認上電燈不亮,恒流12mA(可定制),256級灰度可調,數據自動整形,傳輸數率800---1200KHz,標準應用電壓5V
管腳定義
具體參數如下:
六、通訊方式和應用電路
芯片設計為單線歸零碼通訊方式。芯片上電復位以后,接收DIN 的數據,足24 bit 后,DOUT 端口開始轉發數據,輸出到下一個芯片。在轉發之前DOUT=0電位。芯片 OUTR、OUTG、OUTB 三個端口可輸出相應24 bit 數據的不同占空比的信號。如果DIN 端輸入信號為RESET 信號,芯片將接收到的數據送顯示,芯片將在該信號結束后重新接收新的數據,在接收完開始的 24bit 數據后,通過DOUT口轉發數據,芯片在沒有接收到RESET 碼前,OUTR、OUTG、OUTB 管腳原輸出亮度保持不變,當接收到不小于80μs 低電平RESET 碼后,芯片將剛才接收到的24 bit 亮度數據輸出到OUTR、OUTG、OUTB 引腳上。 七、數據編碼格式
T0H: 350ns T0L: 800ns T1H: 800ns T1L: 350ns (容錯20%) Trst > 80us
八、級連方法
九、數據傳輸方法
單芯片24BIT數據發送順序:高位先發,即R7先發送
十、典型應用電路
AD2202 應用編程之炫彩漸變效果(MCU 應廣150C)
#include "extern.h"
byte red, green, blue; //Could save these three bytes by using the rgb EWORD directly ( rgb$0, rgb$1, rgb$2)
byte mode;
byte hueinc;
byte firstinc;
EWORD rgb;
word pixels; //Only has to be a word if number of pixels > 255
word firstPixelHue;
#define definedPIXELS 300;//像素點
bit LED : pa.6;
bit BTN : pa.4;
int count;
//====================bit1
send1 MACRO
SET1 LED;
.DELAY 5;
$ LED low;
// .DELAY 1; //Going around is enough delay
ENDM
//===================bit0
send0 MACRO
SET1 LED;
.DELAY 2;
$ LED low;
.DELAY 2;
ENDM
//========================
void SendRGB (void)
{
DISGINT; //Let's not get interrupted
.FOR bitno, <23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0> //Regular for() loop doesn't work, but at least the compiler can do the hard work
if (rgb.bitno == 0)
{
send0;
}
else
{
send1;
}
.ENDM
ENGINT;
}
void show (void) {
rgb$0 = blue; //I lost track of MSB, LSB and endians.. This is what works. ????????
rgb$1 = red;
rgb$2 = green;
SendRGB();
}
void clearLED (void)
{
rgb = 0;
//pixels = definedPIXELS;
pixels = 300; //Debug
do
{
SendRGB();
} while (--pixels);
.delay 2000; //If you want to make sure the LED-reset is caught, use a longer one. 0.125us *2000 = 250us
}
void FPPA0 (void)
{
.ADJUST_IC SYSCLK=IHRC/2 // SYSCLK=IHRC/2 16MH 2?? 8M
count = 0;
$ T16M IHRC, /4, BIT15; // BIT15 Time increment of each T16M = 16MHz / 4 = 4 MHz
// generate INTRQ.T16 = 16,384 uS every 2^16 times
ENGINT;
$ INTEN T16; // Enable the T16M interrupt
$ LED out,low; //LED ????? ???
$ BTN in, pull; //?????????
count = 0;
unsigned word hue = 0;
firstPixelHue = 0;
byte current;
mode = 0;
firstinc = 1;
//Let's start by clearing LED's and going to sleep - we don't want anything to consume current if we restarted by mistake
clearLED();
rgb = 0;
SendRGB();//
$ LED high;
CLKMD = 0xF4; // -> ILRC
CLKMD.En_IHRC = 0; // close IHRC
while (1)
{
STOPSYS;
if (BTN == 0) break; // examine and determine whether toggle to STOPSYS or execute at high speed.
}
CLKMD = 0x34; // -> IHRC / 2
count = 0; //
//========================???===========================================
while (1) //Main loop
{
if ( BTN == 1)
{ //If button is not pressed
pixels = definedPIXELS;//300
if (mode < 3)?
{ //Rainbow
hue = firstPixelHue;//0
if (mode == 0)
{
hueinc = 5;
firstinc = 1;
}
if (mode == 1) hueinc = 0;
if (mode == 2)
{
hueinc = 10;
firstinc = 0;
}
do
{
if (hue>=768)
{
hue -= 768;
}
current = (hue & 0xFF);
if (hue < 256)
{
red = ~current;
green = current;
blue = 0;
show();
}
if (hue > 255 && hue < 512)
{
red = 0;
green = ~current;
blue = current;
show();
}
if (hue > 511 && hue < 768)
{
red = current;
green = 0;
blue = ~current;
show();
}
hue+=hueinc;
} while (--pixels);
.delay(8000); //Should be increased if fewer LED's are used
firstPixelHue+=firstinc;
if (firstPixelHue > 3072) firstPixelHue = 0; //Has to be reset sometime.
} //End rainbow
//=================??======================
if (mode == 3)
{ //Red - not too bright
red = 150;
green = 0;
blue = 0;
do {
show();
} while (--pixels);
.delay(2000);
}
//=================??=======================
if (mode == 4)
{ //Green - not too bright
red = 0;
green = 150;
blue = 0;
do {
show();
} while (--pixels);
.delay(2000);
}
//====================??==================
if (mode == 5)
{ //Blue - not too bright
red = 0;
green = 0;
blue = 125;
do {
show();
} while (--pixels);
.delay(2000);
}
if (mode == 6)
{ //Princess! - not too bright
green = 0;
red = 200;
blue = 200;
do {
show();
} while (--pixels);
.delay(2000);
}
}
else
{ //Button pressed - go to sleep
clearLED();
rgb = 0;
SendRGB();
$ LED high; //I think I remember something about setting the WS2812B signal line high, reduces leak current. Maybe not.
if (count > 10)
{ //Unless we just woke up go to sleep
//Maybe disable wakeup from other pins - PADIER
CLKMD = 0xF4; // -> ILRC
CLKMD.En_IHRC = 0; // close IHRC
while (1)
{
STOPSYS;
if (BTN == 0) break; // examine and determine whether toggle to STOPSYS or execute at high speed.
}
CLKMD = 0x34; // -> IHRC / 2
mode++;
if (mode > 6) mode = 0;
}
/* //Change mode if button held longer when coming out of sleep
count = 0;
while (count < 30) {
if (BTN == 1) {
break;
}
}
*/
count = 0;
}
// wdreset;
}
}
void Interrupt (void)
{
pushaf;
if (Intrq.T16)
{
Intrq.T16 = 0;
count ++; // 16,384uS 61 == 999,424 uS ≤ 1S
}
popaf;
}
審核編輯黃宇
-
led
+關注
關注
242文章
23252瀏覽量
660583 -
驅動芯片
+關注
關注
13文章
1277瀏覽量
54591 -
DIN
+關注
關注
0文章
15瀏覽量
10765
發布評論請先 登錄
相關推薦
評論