Emulating RC6-6-20 IR Remote: Part 1 – Understanding the protocol

Print Friendly, PDF & Email

In this series of How To I shall emulate a IR remote control using a Texas Instruments Launchpad MSP-430G2 and few discreet components. The exercise was undertaken by me purely as a self learning exercise.

Before I proceed to the coding basics , I would like to introduce readers to the RC6 protocol and its variant 6-20. The users may ask where is this protocol used, the answer may be in your own house. The IR controller of Tata Sky (DTH service provider in India) and Sky HD in Europe DTH STBs employ the protocol.

Understanding the RC6 Protocol. RC6 protocol is a derivative of the ubiquitous RC5 protocol developed by Philips. The RC5 protocol is extremely simple, at the same time robust and very well documented. RC6 protocol on the other hand is sparsely documented and its implementation varies from one manufacturer to another.   That’s extremely surprising considering its impressive pedigree. Before I go ahead, readers may be eager to know how the waveform actually looks.  A partial  scope-grab of such a transmission is shown below

At a first glance, it appears as a normal set of pulses differing in width and temporal separation. But then why is the pulse area shaded?  Zooming in to the waveform (decreasing the time base of the scope) we can observe that each of the pulse actually consists of a set of pulses with period of silence between them. These series of pulses which are switched on and off comprise the carrier of the transmitted signal.

 

Continue reading

Posted in DIY, MSP-GCC, MSP430 | Tagged , , , , , , , | Leave a comment

Plane Spotting: ADS-B Plane Director Script

Print Friendly, PDF & Email

Phew! Been a while since I have posted something on my blog. Well, that does not mean that I have been too busy or idling around. Just that my work-life balance was heavily tilted towards the work side. Excuses aside, for a past few years I have been dabbling with the ADS-B setup that I have with me.

While the setup has worked beyond my wildest expectations, what I wanted next was design some aid to help guide me towards the direction of the plane. So the next thing I did was was to code a small script to do the same. What does it do? Outputs the slant range, bearing and elevation angle of the plane track dumped by my ADS-B receiver. The code has been written in C.

The next step: Maybe integrate it with gpsd daemon  and a pan-tilt camera mount.

Source Code: polarplot.c
To Compile use : gcc -o polarplot polarplot.c -lm

 

Posted in Default, DIY, GNU C, Programming, Projects | Tagged , , , | Leave a comment

Simple Script to Download epaper from Deccan Chronicle

Print Friendly, PDF & Email

Wanted to download epapers in pdf from Deccan Chronicle.. Look no further… Click to download the script Deccan_Chronicle_New_Jul13

How to get it running

Copy the script to your Linux desktop
go to command prompt using terminal
type following commands

cd ~/Desktop
chmod +x Deccan_Chronicle_New_Jul13.sh
./Deccan_Chronicle_New_Jul13.sh

Posted in BASH, Programming | Tagged , , , , , , , | 1 Comment

Fun with IR Transmitter: Transmitting Sony SIRC protocol remote commands using TI Launchpad MSP-EXP430G2

Print Friendly, PDF & Email

Simple code to transmit SONY remote control commands using Launchpad. The code can used to make your own IR Blaster. The code is not elegant but is certainly functional. This code would not have been possible without the lucid explanation about SONY SIRC protocol available at SB Projects informative web site.

Source Code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
/* ----------------------------------------------------------------------
* Encode Data to Sony SIRC remote protocol using MSP430 Microcontroller
* Coded by Ishan Karve (ishan at the rate gmail dot com)
* 26 Jan 2013
* Platform : TI MSP-EXP430G2 Launchpad running MSP430G2231
* Software Suite : Code Compose Studio, Version: 4.2.3.00004
* Note:
*
* IR Led is connected at port 1.0
* GND--<Res>---|<|--------P1.0
* Diode
* ----------------------------------------------------------------------
*/

#include "msp430g2452.h"
#define LED_OFF LED_OUT &= ~LED_0
#define LED_ON LED_OUT |= LED_0
#define LED_OUT P1OUT
#define LED_0 BIT0
#define LED_DIR P1DIR

void tx_wait(void);
void tx_start(void);
void tx_bit(short);
void tx_cmd(int);
void tx_adr(int);
void delay_ms(unsigned int ms)
{
while (--ms)
{
__delay_cycles(1000);
}
}

void main()
{
//stop watchdog
WDTCTL = WDTPW + WDTHOLD;

//setup internal DCO
BCSCTL1 = CALBC1_1MHZ;
DCOCTL = CALDCO_1MHZ;
//General GPIO Defines
LED_DIR |= LED_0; // Set P1.0 to output direction
LED_OUT &= ~LED_0; // Set the LEDs off

while(1)
{

tx_start();
tx_cmd(21);
tx_adr(1);
tx_wait();

}
}
void tx_wait()
{

//delay_ms(45);//
delay_ms(500);
}
void tx_cmd(int n)
{

int i=0;
int k=0;
for (i = 6; i >= 0; i--)
{
k=n%2;
n/=2;
tx_bit(k);
}

}
void tx_adr(int n)
{

int i=0;
int k=0;
for (i = 4; i >= 0; i--)
{
k=n%2;
n/=2;
tx_bit(k);
}

}

void tx_start()
{
int i;
for (i=0;i<96;i++)
{
//40 Khz Carrier generation. 25us pulse time
//9us On and 16us off
//96 pulses in one start bit time
LED_ON;
__delay_cycles(4);
LED_OFF;
__delay_cycles(8);
}
__delay_cycles(320); //600us delay
}
void tx_bit(short bitval) ///just makes a 1 to 0 and vice versa
{
int i=0;
switch (bitval)
{
case 0:
for (i=0;i<24;i++)
{
//40 Khz Carrier generation. 25us pulse time
//9us On and 16us off
LED_ON;
__delay_cycles(4);
LED_OFF;
__delay_cycles(8);
}
__delay_cycles(320); //600us delay
break;
case 1:
for (i=0;i<48;i++)
{
//40 Khz Carrier generation. 25us pulse time
//9us On and 16us off
LED_ON;
__delay_cycles(4);
LED_OFF;
__delay_cycles(8);
}
__delay_cycles(320); //600us delay
break;
}

}

Download Project Source

Posted in DIY, MSP430, Projects | Tagged , , , , , , , , , , | Leave a comment

Jupiter with its four moons

Print Friendly, PDF & Email

image

Posted in Astronomy | Tagged , , , , , , , , , | Leave a comment