Mạch Khóa Số Điện Tử Mạch Đếm Sản Phẩm Mạch Đèn giao thông Ngã Tư Mạch Trái Tim Final Mạch Trái Tim Final Mạch Trái Tim I Love U

January 24, 2016

[Share] - Full Led cube 5x5x5 dùng PIC 16F877A

Hi all,

Chip chia sẻ cho những bạn nào cần Full Nguyên lý - Layout - Mạch in - Code C led cube 5x5x5 dùng IC PIC nhé.

1. Hình ảnh mô phỏng


2. Nguyên lý


3. Mạch layout


4. Code mở bằng MLAP nhé

// ***************************************************
// ***************************************************
#include <htc.h>
#include <math.h>

// Cau hinh su dung dao dong noi 4MHz
__CONFIG(HS & WDTDIS & PWRTEN & UNPROTECT & BORDIS & LVPDIS);
#define _XTAL_FREQ 4000000


//*******************KHOI TAO*******************
void init_PORTE(void)
{
PORTE = 0X00;
TRISE = 0X00;
}
void init_PORTD(void)
{
PORTD = 0X00;
TRISD = 0X00;
}
void init_PORTC(void)
{
PORTC = 0X00;
TRISC = 0X00;
}
void init_PORTB(void)
{
PORTB = 0X00;
TRISB = 0X00;
}
void init_PORTA(void)
{
PORTA = 0X00;
TRISA = 0X00;
}
//******************KET THUC KHOI TAO************************
//-----------------------------------ma_hex--------------------------------------------
const unsigned char a[]={
//0
0x1E,0x0E,0x00,0x0E,0x1E, //"I"
//5
0x39,0x36,0x1D,0x36,0x39, //"trai tim"
//10
0x30,0x0F,0x0F,0x0F,0x30, //"U"
//15
0x3E,0x3E,0x10,0x3E,0x3E, //"T"
//20
0x13,0x35,0x36,0x35,0x13, //"A"
//25
0x10,0x3D,0x3B,0x37,0x10, //"N"
//30
0x10,0x3B,0x3B,0x3B,0x10, //"H"
//35
0x00,0x1E,0x1E,0x1E,0x00,0x1E,0x3F,0x3F,0x3F,0x1E,0x1E,0x3F,0x3F,0x3F,0x1E,0x1E,0x3F,0x3F,0x3F,0x1E,0x00,0x1E,0x1E,0x1E,0x00,
0x7F,0x3F,0x3F,0x3F,0x7F,0x7F,0x31,0x35,0x31,0x7F,0x7F,0x35,0x3F,0x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3F,0x3F,0x3F,0xBF,0xBF,0x3F,0x3F,0x3F,0xBF,0xBF,0x3F,0x3F,0x3F,0xBF,0xBF,0x3F,0x3F,0x3F,0xBF, //phao hoa
//735
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
};
//******************************************************
//Ten CTC: on_full().
//******************************************************
void scancode (unsigned long code)
{
unsigned long i;
unsigned scan ;
scan = 0x01;
//----------------------------quet PORTB----------------------------
for(i=code;i<=code+7;i++)
{
PORTB = scan;
PORTA = a[i];
__delay_us(500);
scan = scan << 1;
PORTB = 0x00;
PORTA = 0xFF;
__delay_us(200);
}
scan = 0x01;
//----------------------------quet PORTC----------------------------
for(i=code+8;i<=code+15;i++)
{
PORTC = scan;
PORTA = a[i];
__delay_us(500);
scan = scan << 1;
PORTC = 0x00;
PORTA = 0xFF;
__delay_us(200);
}
scan = 0x01;
//----------------------------quet PORTD----------------------------
for(i=code+16;i<=code+23;i++)
{
PORTD = scan;
PORTA = a[i];
__delay_us(500);
scan = scan << 1;
PORTD = 0x00;
PORTA = 0xFF;
__delay_us(200);
}
i = code +24;
PORTE = 0x01;
PORTA = a[i];
__delay_us(500);
PORTE = 0x00;
PORTA = 0xFF;
__delay_us(200);
}
//*****************************************************
void scancode5 (long code, char x1, char x2, char x3, char x4, char x5)
{
long i;
unsigned scan ;
//----------------------------X_1----------------------------
if(x1==1)
{
scan = 0x01;
for(i=code;i<=code+4;i++)
{
PORTB = scan;
PORTA = a[i];
__delay_us(500);
scan = scan << 1;
PORTB = 0x00;
PORTA = 0xFF;
__delay_us(200);
}
}
//----------------------------X_2----------------------------
if(x2==1)
{
scan = 0x20;
for(i=code;i<=code+2;i++)
{
PORTB = scan;
PORTA = a[i];
__delay_us(500);
scan = scan << 1;
PORTB = 0x00;
PORTA = 0xFF;
__delay_us(200);
}
scan = 0x01;
for(i=code+3;i<=code+4;i++)
{
PORTC = scan;
PORTA = a[i];
__delay_us(500);
scan = scan << 1;
PORTC = 0x00;
PORTA = 0xFF;
__delay_us(200);
}
}
//----------------------------X_3----------------------------
if(x3==1)
{
scan = 0x04;
for(i=code;i<=code+4;i++)
{
PORTC = scan;
PORTA = a[i];
__delay_us(500);
scan = scan << 1;
PORTC = 0x00;
PORTA = 0xFF;
__delay_us(200);
}
}
//----------------------------X_4----------------------------
if(x4==1)
{
scan = 0x80;
i = code;
PORTC = scan;
PORTA = a[i];
__delay_us(500);
scan = scan << 1;
PORTC = 0x00;
PORTA = 0xFF;
__delay_us(200);
scan = 0x01;
for(i=code+1;i<=code+4;i++)
{
PORTD = scan;
PORTA = a[i];
__delay_us(500);
scan = scan << 1;
PORTD = 0x00;
PORTA = 0xFF;
__delay_us(200);
}
}
//----------------------------X_5----------------------------
if(x5==1)
{
scan = 0x10;
for(i=code;i<=code+3;i++)
{
PORTD = scan;
PORTA = a[i];
__delay_us(500);
scan = scan << 1;
PORTD = 0x00;
PORTA = 0xFF;
__delay_us(200);
}
i = code +4;
PORTE = 0x01;
PORTA = a[i];
__delay_us(500);
PORTE = 0x00;
PORTA = 0xFF;
__delay_us(200);
}
}
//*****************************************************
void scancode4 (long code, char x1, char x2, char x3, char x4)
{
long i;
unsigned scan ;
//----------------------------X_1----------------------------
if(x1==1)
{
scan = 0x01;
for(i=code;i<=code+4;i++)
{
PORTB = scan;
PORTA = a[i];
__delay_us(500);
scan = scan << 1;
PORTB = 0x00;
PORTA = 0xFF;
__delay_us(200);
}
}
//----------------------------X_2----------------------------
if(x2==1)
{
//--------------------y_1-------------------
i=code;
PORTB = 0x10;
PORTA = a[i];
__delay_us(500);
scan = scan << 1;
PORTB = 0x00;
PORTA = 0xFF;
__delay_us(200);
//--------------------y_2-------------------
i=code+1;
PORTC = 0x02;
PORTA = a[i];
__delay_us(500);
scan = scan << 1;
PORTC = 0x00;
PORTA = 0xFF;
__delay_us(200);
//--------------------y_3-------------------
i=code+2;
PORTC = 0x40;
PORTA = a[i];
__delay_us(500);
scan = scan << 1;
PORTC = 0x00;
PORTA = 0xFF;
__delay_us(200);
//--------------------y_4-------------------
i=code+3;
PORTD = 0x08;
PORTA = a[i];
__delay_us(500);
scan = scan << 1;
PORTD = 0x00;
PORTA = 0xFF;
__delay_us(200);
//--------------------y_5-------------------
i=code+4;
PORTE = 0x01;
PORTA = a[i];
__delay_us(500);
scan = scan << 1;
PORTE = 0x00;
PORTA = 0xFF;
__delay_us(200);
}
//----------------------------X_3----------------------------
if(x3==1)
{
scan = 0x10;
for(i=code;i<=code+3;i++)
{
PORTD = scan;
PORTA = a[i];
__delay_us(500);
scan = scan << 1;
PORTD = 0x00;
PORTA = 0xFF;
__delay_us(200);
}
i = code +4;
PORTE = 0x01;
PORTA = a[i];
__delay_us(500);
PORTE = 0x00;
PORTA = 0xFF;
__delay_us(200);
}
//----------------------------X_4----------------------------
if(x4==1)
{
//--------------------y_1-------------------
i=code;
PORTB = 0x01;
PORTA = a[i];
__delay_us(500);
scan = scan << 1;
PORTB = 0x00;
PORTA = 0xFF;
__delay_us(200);
//--------------------y_2-------------------
i=code+1;
PORTB = 0x20;
PORTA = a[i];
__delay_us(500);
scan = scan << 1;
PORTB = 0x00;
PORTA = 0xFF;
__delay_us(200);
//--------------------y_3-------------------
i=code+2;
PORTC = 0x04;
PORTA = a[i];
__delay_us(500);
scan = scan << 1;
PORTC = 0x00;
PORTA = 0xFF;
__delay_us(200);
//--------------------y_4-------------------
i=code+3;
PORTC = 0x80;
PORTA = a[i];
__delay_us(500);
scan = scan << 1;
PORTC = 0x00;
PORTA = 0xFF;
__delay_us(200);
//--------------------y_5-------------------
i=code+4;
PORTD = 0x10;
PORTA = a[i];
__delay_us(500);
scan = scan << 1;
PORTD = 0x00;
PORTA = 0xFF;
__delay_us(200);
}
}
//===================================================================
//========================CHUONG TRINH CHINH========================
//===================================================================
void main (void)
{
//Khai bao Port
init_PORTA();
init_PORTB();
init_PORTC();
init_PORTD();
init_PORTE();

unsigned long code;
int scan_t;
char lap,x1,x2,x3,x4,x5;
//Chuong trinh chay led
while(1)
{
//===================================================================
//--------------------------------------------------canh to -> nho------------------------------------------------
for(lap=0;lap<=1;lap++)
{
code=35;
while(code!=110)
{
for(scan_t=0;scan_t<=100;scan_t++)
{
scancode(code);
}
code=code+25;
}
code=110;
while(code!=35)
{
code=code-25;
for(scan_t=0;scan_t<=50;scan_t++) //time = scan_t * (0,5ms + 10us) * 25
{
scancode(code);
}
}
}
__delay_ms(100);

//===================================================================
//---------------------------------------------------I LOVE U----------------------------------------------------
for(lap=0;lap<=0;lap++)
{
//----------------I-----------------
code=0;
x1=0; x2=0; x3=1; x4=0; x5=0;
for(scan_t=0;scan_t<=300;scan_t++)
scancode5(code,x1,x2,x3,x4,x5);
//----------------LOVE-----------------
code=5;
x1=0; x2=0; x3=1; x4=0; x5=0;
for(scan_t=0;scan_t<=500;scan_t++)
scancode5(code,x1,x2,x3,x4,x5);
//----------------U-----------------
code=10;
x1=0; x2=0; x3=1; x4=0; x5=0;
for(scan_t=0;scan_t<=300;scan_t++)
scancode5(code,x1,x2,x3,x4,x5);
}
__delay_ms(100);
//===================================================================
//-------------------------------------------------PHAO HOA---------------------------------------------------
/* PORTA = 0X00;
PORTB = 0X00;
PORTC = 0X00;
PORTD = 0X00;
PORTE = 0X00;
for(lap=0;lap<=11;lap++)
{
code=385;
while(code!=735)
{
for(scan_t=0;scan_t<=5;scan_t++)
{
scancode(code);
}
code=code+25;
}
}
PORTA = 0X00;
PORTB = 0X00;
PORTC = 0X00;
PORTD = 0X00;
PORTE = 0X00;
__delay_ms(100);
*/
//===================================================================
//-----------------------------------------------------TUAN------------------------------------------------------
/* for(lap=0;lap<=0;lap++)
{
//----------------T-----------------
code=15;
x1=1; x2=0; x3=0; x4=0; x5=0;
for(scan_t=0;scan_t<=300;scan_t++)
scancode5(code,x1,x2,x3,x4,x5);
//----------------U-----------------
code=10;
x1=1; x2=0; x3=0; x4=0; x5=0;
for(scan_t=0;scan_t<=300;scan_t++)
scancode5(code,x1,x2,x3,x4,x5);
//----------------A-----------------
code=20;
x1=1; x2=0; x3=0; x4=0; x5=0;
for(scan_t=0;scan_t<=300;scan_t++)
scancode5(code,x1,x2,x3,x4,x5);
//----------------N-----------------
code=25;
x1=1; x2=0; x3=0; x4=0; x5=0;
for(scan_t=0;scan_t<=300;scan_t++)
scancode5(code,x1,x2,x3,x4,x5);
}
__delay_ms(100);
*/
//===================================================================
//-------------------------------------------------------LOVE----------------------------------------------------
/* for(lap=0;lap<=0;lap++)
{
code=5;
x1=1; x2=0; x3=0; x4=0; x5=0;
for(scan_t=0;scan_t<=350;scan_t++)
scancode5(code,x1,x2,x3,x4,x5);
code=5;
x1=0; x2=1; x3=0; x4=0; x5=0;
for(scan_t=0;scan_t<=350;scan_t++)
scancode5(code,x1,x2,x3,x4,x5);
code=5;
x1=0; x2=0; x3=1; x4=0; x5=0;
for(scan_t=0;scan_t<=350;scan_t++)
scancode5(code,x1,x2,x3,x4,x5);
code=5;
x1=0; x2=0; x3=0; x4=1; x5=0;
for(scan_t=0;scan_t<=350;scan_t++)
scancode5(code,x1,x2,x3,x4,x5);
code=5;
x1=0; x2=0; x3=0; x4=0; x5=1;
for(scan_t=0;scan_t<=350;scan_t++)
scancode5(code,x1,x2,x3,x4,x5);
}
__delay_ms(100);
*/
//===================================================================
//-------------------------------------------------------HANH---------------------------------------------------
/* for(lap=0;lap<=0;lap++)
{
//----------------H-----------------
code=30;
x1=0; x2=0; x3=0; x4=0; x5=1;
for(scan_t=0;scan_t<=300;scan_t++)
scancode5(code,x1,x2,x3,x4,x5);
//----------------A-----------------
code=20;
x1=0; x2=0; x3=0; x4=0; x5=1;
for(scan_t=0;scan_t<=300;scan_t++)
scancode5(code,x1,x2,x3,x4,x5);
//----------------N-----------------
code=25;
x1=0; x2=0; x3=0; x4=0; x5=1;
for(scan_t=0;scan_t<=300;scan_t++)
scancode5(code,x1,x2,x3,x4,x5);
//----------------H-----------------
code=30;
x1=0; x2=0; x3=0; x4=0; x5=1;
for(scan_t=0;scan_t<=300;scan_t++)
scancode5(code,x1,x2,x3,x4,x5);
}
__delay_ms(100);
*/
//===================================================================
//-------------------------------------------------I LOVE U 4 mat----------------------------------------------
for(lap=0;lap<=2;lap++)
{
//==============LAN 1===============
//----------------I-----------------
code=0;
x1=1; x2=0; x3=0; x4=0;
for(scan_t=0;scan_t<=300;scan_t++)
scancode4(code,x1,x2,x3,x4);
//----------------LOVE-----------------
code=5;
x1=0; x2=1; x3=0; x4=0;
for(scan_t=0;scan_t<=300;scan_t++)
scancode4(code,x1,x2,x3,x4);
//----------------U-----------------
code=10;
x1=0; x2=0; x3=1; x4=0;
for(scan_t=0;scan_t<=300;scan_t++)
scancode4(code,x1,x2,x3,x4);

//==============LAN 2===============
//----------------I-----------------
code=0;
x1=0; x2=0; x3=0; x4=1;
for(scan_t=0;scan_t<=300;scan_t++)
scancode4(code,x1,x2,x3,x4);
//----------------LOVE-----------------
code=5;
x1=1; x2=0; x3=0; x4=0;
for(scan_t=0;scan_t<=300;scan_t++)
scancode4(code,x1,x2,x3,x4);
//----------------U-----------------
code=10;
x1=0; x2=1; x3=0; x4=0;
for(scan_t=0;scan_t<=300;scan_t++)
scancode4(code,x1,x2,x3,x4);

//==============LAN 3===============
//----------------I-----------------
code=0;
x1=0; x2=0; x3=1; x4=0;
for(scan_t=0;scan_t<=300;scan_t++)
scancode4(code,x1,x2,x3,x4);
//----------------LOVE-----------------
code=5;
x1=0; x2=0; x3=0; x4=1;
for(scan_t=0;scan_t<=300;scan_t++)
scancode4(code,x1,x2,x3,x4);
//----------------U-----------------
code=10;
x1=1; x2=0; x3=0; x4=0;
for(scan_t=0;scan_t<=300;scan_t++)
scancode4(code,x1,x2,x3,x4);

//==============LAN 4===============
//----------------I-----------------
code=0;
x1=0; x2=1; x3=0; x4=0;
for(scan_t=0;scan_t<=300;scan_t++)
scancode4(code,x1,x2,x3,x4);
//----------------LOVE-----------------
code=5;
x1=0; x2=0; x3=1; x4=0;
for(scan_t=0;scan_t<=300;scan_t++)
scancode4(code,x1,x2,x3,x4);
//----------------U-----------------
code=10;
x1=0; x2=0; x3=0; x4=1;
for(scan_t=0;scan_t<=300;scan_t++)
scancode4(code,x1,x2,x3,x4);
}
__delay_ms(100);
//===================================================================
//---------------------------------------------------I LOVE U "TRONG RA, NGOAI VAO"----------------------------------------------------
for(lap=0;lap<=1;lap++)
{
//----------------I-----------------
code=0;
x1=0; x2=0; x3=1; x4=0; x5=0;
for(scan_t=0;scan_t<=200;scan_t++)
scancode5(code,x1,x2,x3,x4,x5);
//---------------I I----------------
code=0;
x1=0; x2=1; x3=0; x4=1; x5=0;
for(scan_t=0;scan_t<=200;scan_t++)
scancode5(code,x1,x2,x3,x4,x5);
//--------------I   I---------------
code=0;
x1=1; x2=0; x3=0; x4=0; x5=1;
for(scan_t=0;scan_t<=100;scan_t++)
scancode5(code,x1,x2,x3,x4,x5);
//---------------I I----------------
code=0;
x1=0; x2=1; x3=0; x4=1; x5=0;
for(scan_t=0;scan_t<=50;scan_t++)
scancode5(code,x1,x2,x3,x4,x5);
//--------------LOVE-----------------
code=5;
x1=0; x2=0; x3=1; x4=0; x5=0;
for(scan_t=0;scan_t<=200;scan_t++)
scancode5(code,x1,x2,x3,x4,x5);
//--------------LO VE----------------
code=5;
x1=0; x2=1; x3=0; x4=1; x5=0;
for(scan_t=0;scan_t<=200;scan_t++)
scancode5(code,x1,x2,x3,x4,x5);
//------------- LO   VE--------------
code=5;
x1=1; x2=0; x3=0; x4=0; x5=1;
for(scan_t=0;scan_t<=100;scan_t++)
scancode5(code,x1,x2,x3,x4,x5);
//--------------LO VE----------------
code=5;
x1=0; x2=1; x3=0; x4=1; x5=0;
for(scan_t=0;scan_t<=50;scan_t++)
scancode5(code,x1,x2,x3,x4,x5);
//----------------U-----------------
code=10;
x1=0; x2=0; x3=1; x4=0; x5=0;
for(scan_t=0;scan_t<=200;scan_t++)
scancode5(code,x1,x2,x3,x4,x5);
//---------------U U----------------
code=10;
x1=0; x2=1; x3=0; x4=1; x5=0;
for(scan_t=0;scan_t<=200;scan_t++)
scancode5(code,x1,x2,x3,x4,x5);
//--------------U   U---------------
code=10;
x1=1; x2=0; x3=0; x4=0; x5=1;
for(scan_t=0;scan_t<=100;scan_t++)
scancode5(code,x1,x2,x3,x4,x5);
//---------------U U----------------
code=10;
x1=0; x2=1; x3=0; x4=1; x5=0;
for(scan_t=0;scan_t<=50;scan_t++)
scancode5(code,x1,x2,x3,x4,x5);
}
__delay_ms(100);
//===================================================================
//-----------------------------------------------SANG THEO COT---------------------------------------------
/* for(lap=0;lap<=3;lap++)
{
PORTA = 0x00;

PORTE = 0x01; __delay_ms(100); __delay_ms(100);
PORTD = 0X80; __delay_ms(100); __delay_ms(100);
PORTD = 0XC0; __delay_ms(100); __delay_ms(100);
PORTD = 0XE0; __delay_ms(100); __delay_ms(100);
PORTD = 0XF0; __delay_ms(100); __delay_ms(100);
PORTC = 0X80; __delay_ms(100); __delay_ms(100);
PORTC = 0X84; __delay_ms(100); __delay_ms(100);
PORTB = 0X20; __delay_ms(100); __delay_ms(100);
PORTB = 0X21; __delay_ms(100); __delay_ms(100);
PORTB = 0X23; __delay_ms(100); __delay_ms(100);
PORTB = 0X27; __delay_ms(100); __delay_ms(100);
PORTB = 0X2F; __delay_ms(100); __delay_ms(100);
PORTB = 0X3F; __delay_ms(100); __delay_ms(100);
PORTC = 0X86; __delay_ms(100); __delay_ms(100);
PORTC = 0XC6; __delay_ms(100); __delay_ms(100);
PORTD = 0XF8; __delay_ms(100); __delay_ms(100);
__delay_ms(100);
__delay_ms(100);
PORTB = 0X00; PORTC = 0X00; PORTD = 0X00; PORTE = 0X00;
__delay_ms(100);
}
*/
//===================================================================
//-------------------------------chu "I" sang duoi----------------------------------
/* for(lap=0;lap<=0;lap++)
{
code=0;
x1=1; x2=0; x3=0; x4=0; x5=0;
for(scan_t=0;scan_t<=100;scan_t++)
scancode5(code,x1,x2,x3,x4,x5);
code=0;
x1=0; x2=1; x3=0; x4=0; x5=0;
for(scan_t=0;scan_t<=100;scan_t++)
scancode5(code,x1,x2,x3,x4,x5);
code=0;
x1=0; x2=0; x3=1; x4=0; x5=0;
for(scan_t=0;scan_t<=100;scan_t++)
scancode5(code,x1,x2,x3,x4,x5);
code=0;
x1=0; x2=0; x3=0; x4=1; x5=0;
for(scan_t=0;scan_t<=100;scan_t++)
scancode5(code,x1,x2,x3,x4,x5);
code=0;
x1=0; x2=0; x3=0; x4=0; x5=1;
for(scan_t=0;scan_t<=100;scan_t++)
scancode5(code,x1,x2,x3,x4,x5);
}
__delay_ms(100);
*/
//===================================================================
//------------------------------------sang diem----------------------------------
/* for(lap=0;lap<=0;lap++)
{
code=450;
while(code!=700)
{
for(scan_t=0;scan_t<=20;scan_t++) //time = scan_t * (0,5ms + 10us) * 25
{
scancode(code);
}
code=code+25;
}
code=700;
while(code!=475)
{
code=code-25;
for(scan_t=0;scan_t<=20;scan_t++) //time = scan_t * (0,5ms + 10us) * 25
{
scancode(code);
}
}
}
__delay_ms(100);
*/
//===================================================================
}
}


 link mediafire
Khi nhấn nút "Tải Về Máy", bạn sẽ vào trang quảng cáo, vui lòng chờ 5 giây. Nút  hiện ra ở góc phải phía trên, nhấn vào để đến trang download

Theo tronghuu117 ( codientu.org)
Điện Tử | Tin Học - eChipKool.Com - Chia sẻ kiến thức - Kết nối đam mê điện tử


2 comments:

hussien alhasha said...
5/7/16

can you add a new photo please?
i need this project for my school so please help my with this project and add a protues fiels and new photo and thank you very much.

hussien alhasha said...
5/7/16

sorry i found the fiels.
can you add video when the cube is run?

Post a Comment

Bạn đọc hãy giúp chúng tôi xây dựng cộng đồng bằng cách để lại bình luận, chúng tôi luôn đón nhận mọi ý kiến của các bạn:
» Bình luận nghiêm túc và không chứa các liên kết quảng cáo.
» Vui lòng không Spam nhận xét với mọi hình thức.
» Rất mong bạn đề tên cho nhận xét của chính mình - Bằng cách chọn vào Tên/URL và điền tên bạn vào (Phần URL có thể bỏ trống ).

- Bạn có thể chèn Link nhạc (NCT), video(Youtube),Hình ảnh vào comment bằng cú pháp:
+ [youtube] Link video Youtube [/youtube].
+ [img] Link ảnh( định dạng PNG, JPG,GIF) [/img]
+Chèn link liên kết: <a href="LINK" rel="nofollow">Name</a>
-Bạn copy mã bên cạnh biểu tượng chèn vào nhận xét để bày tỏ cảm xúc!!

:) :( :)) :(( =)) =D> :D :P