Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

RC-5 Infrared encoding with PIC

Status
Not open for further replies.

Jay.slovak

Active Member
Hi guys,

My Philips TV's remote died, and I need to tune-in some new stations. I have a replecement remote, but it can only do some basic comands (volume, station, off). So I was thinking, I can build a remote with a PIC. (I only want it to send the required Tuning functions)

I studied I bit. Found out RC-5 encoding principle.

I connected a LED directly (via 180ohm resistor) to 18F2620 (was at hand) CCP2 output. I realize this will produce a very weak IR signal, but I only need it to tune-in new stations. So far, I can produce modulated IR signal at 36.31Khz with 889uS deleys between modulation pulses as seen on these **broken link removed**. I am using CCP2s PWM fucntionality to generate 36Khz carieer, and I modulate it by altering TRIS register. I used my digital camera in night vision mode and my Hi-Fi set (which flashes a LED everytime it sees a carieer) to confirm this technique works. My TV, however doesn't react to Device code 0 and function code 0.

My question (to anybody who has done this before, maybe Nigel ;) ) is what is the requered precision of the carieer freq. (eg. will it accept 36.31Khz ?) and how precise should the time-slots be? The source states: "Constant bit time of 1.778ms (64 cycles of 36 kHz)"

Any advice will be helpfull.
 
Jay.slovak said:
Hi guys,

My Philips TV's remote died, and I need to tune-in some new stations. I have a replecement remote, but it can only do some basic comands (volume, station, off). So I was thinking, I can build a remote with a PIC. (I only want it to send the required Tuning functions)

I studied I bit. Found out RC-5 encoding principle.

I connected a LED directly (via 180ohm resistor) to 18F2620 (was at hand) CCP2 output. I realize this will produce a very weak IR signal, but I only need it to tune-in new stations. So far, I can produce modulated IR signal at 36.31Khz with 889uS deleys between modulation pulses as seen on these **broken link removed**. I am using CCP2s PWM fucntionality to generate 36Khz carieer, and I modulate it by altering TRIS register. I used my digital camera in night vision mode and my Hi-Fi set (which flashes a LED everytime it sees a carieer) to confirm this technique works. My TV, however doesn't react to Device code 0 and function code 0.

My question (to anybody who has done this before, maybe Nigel ;) ) is what is the requered precision of the carieer freq. (eg. will it accept 36.31Khz ?) and how precise should the time-slots be? The source states: "Constant bit time of 1.778ms (64 cycles of 36 kHz)"

The frequency isn't at all critical, nor is the precision of the pulse widths - the whole point of RC5 is that it's the changes from high to low, and low to high, that signify the bits, and NOT the width of the pulses.

Pointless though using the PWM module, it's far easier to do it in software - I can send you RC6 code for the 16F628 that I use (extended RC5, for Sky Digiboxes).
 
Great. Please do so. I Chose CCP module to save some time (I didn't have to write the delay routine :D ), I have a XLS file which helps to find correct TMR2 reload value for CCP module.
 
Jay.slovak said:
Great. Please do so. I Chose CCP module to save some time (I didn't have to write the delay routine :D ), I have a XLS file which helps to find correct TMR2 reload value for CCP module.

OK, here it is, it was written to transmit the 'backup' code periodically.
 

Attachments

  • Skyrem.zip
    1.5 KB · Views: 178
Thanks Nigel. A brief look at the source code revealed 40Khz carieer modulation and Device ID 0x01. I will do some changes and try it on 16F628.
 
Jay.slovak said:
Thanks Nigel. A brief look at the source code revealed 40Khz carieer modulation and Device ID 0x01. I will do some changes and try it on 16F628.

I seem to remember that RC6 uses more bits that RC5?, so you will have to shorten it as well.
 
Yes it does. The change is from RC6 to RC5 is not difficult.

Please, don't confuse RC-6 and Extended RC-5. They are a bit different.
 
Well, I said I did study this a bit. But I couldn't find any information regarding precision of the signal. Now I see you use 40Khz (for 36 or 38Khz receiver).
 
Jay.slovak said:
Well, I said I did study this a bit. But I couldn't find any information regarding precision of the signal. Now I see you use 40Khz (for 36 or 38Khz receiver).

It makes very little difference, if you like?, increase the delay a touch to drop the frequency.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top