Showing posts with label Remote. Show all posts
Showing posts with label Remote. Show all posts

Thursday, September 24, 2015

Giải mã tín hiệu từ remote tivi sharp với 89S52

Posted by dientudieukhien at 3:08 PM 1 Comment
   Trong project này, chúng ta sử dụng vi điều khiển 89S52 để giải mã (decoder) tín hiệu từ remote tivi sharp.
H1 - Sơ đồ đấu dây

Read More »

Tuesday, April 2, 2013

Điều chỉnh độ sáng tối bóng đèn bằng remote tivi Sony dùng vi điều khiển pic12f683

Posted by dientudieukhien at 4:10 PM 0 Comments
Sơ đồ nguyên lý:

Code viết bằng ngôn ngữ Mikroc:

The code devided into 2 parts, AC chopper for light dimming control and SIRC decoding for input remote control. As I mention earlier, the SIRC decoding part is on my previous example. For dimming control, GP3 is setup as interrupt-on-change, that's mean INTCON.GPIF is set every zero-crossing is dectected, then microcontroller performs delay by using the Timer1 then activates the triac.

#define tx GPIO.GP5

unsigned TMR1 absolute 0x0E;

char current_dim = 0;
char done_flag = 0;
//preload timer1 value 100%, 90%, 80%, 70% 60%, 50%, 40%, 30% 20% and 10%
unsigned preload_time[10] = {65535,63823,63082,62481,61925,61370,60814,\
60259,59656,58916};

//************************************************** ****************************
//*** interrupt-on-change when zero-crossing occur, preload timer1 value
//*** turn on timer1 to perform delay before gate trigger
//************************************************** ****************************
if(INTCON.GPIF){
tx = 1;
TMR1 = preload_time[current_dim];//preload_time into Timer1
T1CON.TMR1ON = 1; //start timer1
INTCON.GPIF = 0;
}
//************************************************** ****************************
//*** perform gate trigger, turn off itself
//************************************************** ****************************
if(PIR1.TMR1IF){
T1CON.TMR1ON = 0; //stop timer1
tx = 0; //turn on triac
delay_us(150);
tx = 1; //turn off triac
PIR1.TMR1IF = 0; //clear interrupt flag
}
}
At 60 Hz AC power line, one circle is 16.6667 milliseconds, half circle is 8.333 milliseconds. If the microcontroller delay 4166 us before activate the triac on both side, positive and negative, then the light bulb would have half of the power. In this project, the 8.333ms is divided into 10 steps for the power control by calculation then put it into preload_time variable. The program decode SIRC VOL+ key for step up and VOL- key for step down(dim) by changeing current_dim variable.

if(done_flag == 0){
if(got_data){
Command_code = input_data & 0x7F;
Device_code = input_data >> 7;
if(Device_code == 1){
switch (Command_code){
case 0x12: if(current_dim > 0) current_dim --;
break;
case 0x13: if(current_dim < 9) current_dim ++;
break;
}
}
done_flag = 1;
}
}



Nguồn: http://www.pic_examples.byethost3.com/
Read More »

Tuesday, November 13, 2012

Lập trình điều khiển thiết bị bằng remote tivi sony - Chuẩn RC5

Posted by dientudieukhien at 10:53 PM 0 Comments
Ở project này dientudieukhien.net chia sẽ cùng bạn cách lập trình giải mã tín hiệu được mã hóa bởi remote tivi theo chuẩn RC5, ở đây mình sử dụng remote tivi sony.

Giải mã remote tivi chuẩn RC5

Video minh họa:



|| Tải code in mikroc
Read More »

    tab

back to top