Sonsivri
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
March 28, 2024, 04:27:19 16:27


Login with username, password and session length


Pages: [1]
Print
Author Topic: RC5 code  (Read 8424 times)
0 Members and 1 Guest are viewing this topic.
nileshhande
Junior Member
**
Offline Offline

Posts: 70

Thank You
-Given: 23
-Receive: 5


« on: May 06, 2008, 11:22:57 11:22 »

hi all,

want to control few relays via infrared remote control: some latch,some momentry and some timer based..and 1 port PWM if possible

thanks...
Logged
mississippi1
Newbie
*
Offline Offline

Posts: 27

Thank You
-Given: 26
-Receive: 7


« Reply #1 on: May 06, 2008, 04:22:40 16:22 »

That should be no problem with a PIC16F628a.
PBP is than also the right language for this problem.
Logged
nileshhande
Junior Member
**
Offline Offline

Posts: 70

Thank You
-Given: 23
-Receive: 5


« Reply #2 on: May 07, 2008, 07:38:44 07:38 »

Thanks..can i have the project detals.(schematic and code)
thanks a lot.
Logged
maddoc
Newbie
*
Offline Offline

Posts: 32

Thank You
-Given: 49
-Receive: 14


« Reply #3 on: May 07, 2008, 08:39:59 08:39 »

Here is an extract from Proton IDE, basic compiler, found on this forum.

You just have to put next to the PIC an IR receiver like rpm71xx or tsop48xx (xx stands for IR frequency, go for 40 with RC5 codes).


Code:
RC5IN 12 14 16
 
Syntax

Variable = RC5IN
 
Overview

Receive Philips RC5 infrared data from a predetermined pin. The pin is automatically made an input.
 
Operators
Variable - a bit, byte, word, dword, or float variable, that will be loaded by RC5In. The return data from the RC5In command consists of two bytes, the SYSTEM byte containing the type of remote used. i.e. TV, Video etc, and the COMMAND byte containing the actual button value. The order of the bytes is COMMAND (low byte) then SYSTEM (high byte). If a byte variable is used to receive data from the infrared sensor then only the COMMAND byte will be received.

Example

  Device = 16F628A
 RC5IN_PIN = PORTC.0                         ' Choose the port and pin for the infrared sensor
 DIM RC5_WORD as WORD                        ' Create a WORD variable to receive the data
 DIM RC5_COMMAND as RC5_WORD.Lowbyte         ' Alias the COMMAND byte to RC5_WORD low byte
 DIM RC5_SYSTEM as RC5_WORD.Highbyte         ' Alias the SYSTEM byte to RC5_WORD high byte
 
 ALL_DIGITAL = ON                            ' Make all pins digital mode
 Cls                                         ' Clear the LCD
 While 1 = 1                                 ' Create an infinite loop
  Repeat                     
    RC5_WORD = RC5In                         ' Receive a signal from the infrared sensor
  Until RC5_COMMAND<> 255                    ' Keep looking until a valid header found
  Print at 1,1,"SYSTEM  ",Dec RC5_SYSTEM," "  ' Display the SYSTEM value
  Print at 2,1,"COMMAND ",Dec RC5_COMMAND," " ' Display the COMMAND value
 Wend
 
 
Declares

There is a single Declare for use with RC5In: -
 
DECLARE RC5IN_PIN PORT . PIN
Assigns the Port and Pin that will be used to input infrared data by the RC5In command. This may be any valid port on the PICmicro.
 
If the Declare is not used in the program, then the default Port and Pin is PORTB.0.
 
Notes

The RC5In command will return with both COMMAND and SYSTEM bytes containing 255 if a valid header was not received. The CARRY (STATUS.0) flag will also be set if an invalid header was received. This is an ideal method of determining if the signal received is of the correct type.

RC5In is oscillator independent as long as the crystal frequency is declared at the top of the program. If no XTAL Declare is used, then RC5In defaults to a 4MHz crystal frequency for its timing.
 
Logged
DINESHjp
Guest
« Reply #4 on: August 23, 2008, 02:14:46 02:14 »

i think  rc5in is not a valid command in proton ide
Logged
pickit2
Moderator
Hero Member
*****
Offline Offline

Posts: 4639

Thank You
-Given: 823
-Receive: 4194


There is no evidence that I muted SoNsIvRi


« Reply #5 on: August 23, 2008, 07:49:24 19:49 »

i think  rc5in is not a valid command in proton ide
Yes it is
----------------------------from the Help file------------
RC5IN
 
Syntax

Variable = RC5IN
 
Overview

Receive Philips RC5 infrared data from a predetermined pin. The pin is automatically made an input.
 
Operators
Variable - a bit, byte, word, dword, or float variable, that will be loaded by RC5In. The return data from the RC5In command consists of two bytes, the SYSTEM byte containing the type of remote used. i.e. TV, Video etc, and the COMMAND byte containing the actual button value. The order of the bytes is COMMAND (low byte) then SYSTEM (high byte). If a byte variable is used to receive data from the infrared sensor then only the COMMAND byte will be received.

Example

 Device = 16F877
 RC5IN_PIN = PORTC.0                         ' Choose the port and pin for the infrared sensor
 DIM RC5_WORD as WORD                        ' Create a WORD variable to receive the data
 DIM RC5_COMMAND as RC5_WORD.Lowbyte         ' Alias the COMMAND byte to RC5_WORD low byte
 DIM RC5_SYSTEM as RC5_WORD.Highbyte         ' Alias the COMMAND byte to RC5_WORD high byte
 
 ALL_DIGITAL = ON                            ' Make all pins digital mode
 Cls                                         ' Clear the LCD
 While 1 = 1                                 ' Create an infinite loop
  Repeat                     
    RC5_WORD = RC5In                         ' Receive a signal from the infrared sensor
  Until RC5_COMMAND<> 255                    ' Keep looking until a valid header found
  Print at 1,1,"SYSTEM  ",Dec RC5_SYSTEM," "  ' Display the SYSTEM value
  Print at 2,1,"COMMAND ",Dec RC5_COMMAND," " ' Display the COMMAND value
 Wend
 
 
Declares

There is a single Declare for use with RC5In: -
 
DECLARE RC5IN_PIN PORT . PIN
Assigns the Port and Pin that will be used to input infrared data by the RC5In command. This may be any valid port on the PICmicro.
 
If the Declare is not used in the program, then the default Port and Pin is PORTB.0.
 
Notes

The RC5In command will return with both COMMAND and SYSTEM bytes containing 255 if a valid header was not received. The CARRY (STATUS.0) flag will also be set if an invalid header was received. This is an ideal method of determining if the signal received is of the correct type.

RC5In is oscillator independent as long as the crystal frequency is declared at the top of the program. If no XTAL Declare is used, then RC5In defaults to a 4MHz crystal frequency for its timing.
 
See Also
SONYIN
Logged

Note: I stoped Muteing bad members OK I now put thier account in sleep mode
DINESHjp
Guest
« Reply #6 on: August 24, 2008, 01:05:41 01:05 »

i once again search the command rc5in in help also but it is not available
i am using proton+basic compiler downloaded from this forum. ide version 1.0.0.1
and compiler version 2.2.0.20
 
Logged
pickit2
Moderator
Hero Member
*****
Offline Offline

Posts: 4639

Thank You
-Given: 823
-Receive: 4194


There is no evidence that I muted SoNsIvRi


« Reply #7 on: August 24, 2008, 11:12:00 11:12 »

Your way out of date with Proton IDE
ide current ver 1.0.4.6
compiler current version is 3.2.5.5
Logged

Note: I stoped Muteing bad members OK I now put thier account in sleep mode
DINESHjp
Guest
« Reply #8 on: August 25, 2008, 12:55:15 00:55 »

where can i download this version , there are so many version that i am confused, so plz help me
Logged
Ahmad_k
SCG Moderator
Hero Member
*****
Offline Offline

Posts: 747

Thank You
-Given: 169
-Receive: 1288



« Reply #9 on: August 25, 2008, 04:22:45 16:22 »

Take this :
Proton IDE 1.0.4.6 and Compiler 3.2.5.5
http://www.sonsivri.com/forum/index.php?topic=4267.msg21417#msg21417
Logged
ABBOSE
Junior Member
**
Offline Offline

Posts: 37

Thank You
-Given: 26
-Receive: 21


« Reply #10 on: October 15, 2008, 03:12:27 15:12 »

Hi nileshhande
for infrared remote control see http://amateurworld.in/sd_4/3%20channel%20IR%20remote%20control.html
Logged
nileshhande
Junior Member
**
Offline Offline

Posts: 70

Thank You
-Given: 23
-Receive: 5


« Reply #11 on: October 16, 2008, 04:45:55 16:45 »

HI, Thanks..Good explanation, Source code is in Assly, Basic code would have helped a lot..Thanks lot..
Logged
Pages: [1]
Print
Jump to:  


DISCLAIMER
WE DONT HOST ANY ILLEGAL FILES ON THE SERVER
USE CONTACT US TO REPORT ILLEGAL FILES
ADMINISTRATORS CANNOT BE HELD RESPONSIBLE FOR USERS POSTS AND LINKS

... Copyright © 2003-2999 Sonsivri.to ...
Powered by SMF 1.1.18 | SMF © 2006-2009, Simple Machines LLC | HarzeM Dilber MC