Truncated match.
PICList
Thread
'IR coding - decoding with PIC'
1999\10\24@033237
by
Agnes en Henk Tobbe
Hallo all,
Of course this has been asked before. I cannot find the codes that are
transmitted by my TV/VCR remote control. I see signals on the scope and want
to do something with it but...
So:
where can I find the standard codes? (read something about ISI ASCII) but
ISI site is too full of info and no search engine
Is the decoding software in the public domain (for 16F84 for instance)?
Henk - VK2GWK
1999\10\24@072145
by
Thomas Wright
Hello
the codes you look for are pwm so you have to do bit test
feed the get an IR sensor put one leg to earth and the other to 5v through a
10k resistor
the high leg then feed to pic on input pin
then test this pin for high or low ect
if you play around with the timeing ect adding nops to bit test
you will get a value for a long pulse and a short pulse
add the long and short pulses up to get value
this value will be different when you press a different remote key.
if you want some sample code i have it for 12c508
1999\10\24@085920
by
a b
<x-flowed>Can you send me the IR codes to??
Manny Thanks,
Joep Schroen
______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com
</x-flowed>
1999\10\24@105924
by
Dan Creagan
The codes are (IIRC) always PWM for the TV remotes. Unfortunately, each
manufacturer has a bit different codes for their particular machine. While
there are tons of sites about all this, the best tutor for actually
programming for it was given to me by Don Roy (his webiste is
http://www3.sympatico.ca/donroy) . His code for it is in his newsletter
archive, but I also have an unmodified version of it at :
http://204.233.101.40/robots/irremote.txt It is Stamp 2 code, so it is
easy to figure out what is happening. The particular example decodes a Sony
remote controller output and sends it back to the PC in ASCII number format.
Easy to modify - used it to control robots with the TV remote - works great.
Dan
{Original Message removed}
1999\10\24@105930
by
Thomas Wright
there is not a set code
this you will have to find your self with pic and ir sensor
once you have a hex value for a key press then you can reverse the pic code
to send back out to ir transmitter
what is it that you want to do ???
what remote is it for ?
what code have you written so far?
1999\10\24@120739
by
firewall_fred
|
At 05:28 PM 10/24/99 +1000, you wrote:
>Hallo all,
>Of course this has been asked before. I cannot find the codes that are
>transmitted by my TV/VCR remote control. I see signals on the scope and
want
>to do something with it but...
>So:
>where can I find the standard codes? (read something about ISI ASCII) but
>ISI site is too full of info and no search engine
>Is the decoding software in the public domain (for 16F84 for instance)?
>Henk - VK2GWK
It is now if it wasn't before. My code (a beginner's hack from start to
finish for the JVC RM-RXC30) is below. I used this on a 16F84 with four
common anode 7-segment displays on portb and digit driver PNP transistors
on porta.0-3. The input from the ir demodulator is on porta.4. Drive with
a 4MHz crystal. With my remote, the code is always F9xx, so I test for the
F9 before setting the digits. Yours may be differerent, so try disabling
that check.
As to standard codes, I don't think there are any in practice - I looked
at 6 remotes on my scope - not one looked anything like the other. They
all had different transmission rates and pulse widths, some PWM, some fixed
pulse width.
Enjoy.
;Firewall Fred's public domain code for the JVC RM-RXC30 IR remote. Use
and abuse freely.
processor 16f84
include <p16f84.inc>
__config _XT_OSC & _WDT_OFF & _PWRTE_ON
J equ H'1F' ; J = address hex 1F
K equ H'1E' ; K = address hex 1E
L equ H'1C' ; L.0-L.3=digit0 L.4-L.7=digit1
M equ H'1B' ; M.0-M.3=digit2 M.4-M.7=digit3
DigEn equ H'1A' ;turn on bits 0-3 to enable digit 0-3
w_temp equ H'19' ;
rxlow equ H'17' ;ir code, lsb
rxhigh equ H'16' ;ir code, msb
rxbits equ H'15' ;ir code length
rxlow1 equ H'14' ;ir code, lsb for confirmation
rxhigh1 equ H'13' ;ir code, msb for confirmation
goodthresh equ H'12' ;ir code, msb for confirmation
;=======================================
; Initialization
;=======================================
org 0 ; start at address 0
goto config
nop
nop
nop
goto INTERRUPT
config:
movlw B'00010000' ; Set port a.4=in A.3-A.0=out
tris PORTA
movlw B'00000000' ; Set port B.7-B.0 as output
tris PORTB
movlw B'00000001'
movwf DigEn ;begin refresh on digit0
movlw H'00'
movwf L
movwf M
movlw H'03'
movwf goodthresh
movlw H'03'
option ;prescale to 1:16
movlw H'A0' ;GIE & T0IE set, T0IF cleared
movwf INTCON ;t0 interrupts now enabled
main_loop:
call high_3mS ;wait for 3mS of high (startbit)
wtfrlow:
btfsc PORTA,4 ;wait for logical low (first bit)
goto wtfrlow
movlw D'16' ;16 bits of data
movwf rxbits
clrf rxlow ;reset received code
clrf rxhigh ;reset received code
waitforhigh: ;get next bit
btfss PORTA,4
goto waitforhigh
call wait_100uS ;state determined after 700uS
call wait_100uS
call wait_100uS
call wait_100uS
call wait_100uS
call wait_100uS
call wait_100uS
btfss PORTA,4
goto rxlowbit
rxhighbit:
bsf STATUS,C ;bit goes into carry for rotate
goto recordbit
rxlowbit:
bcf STATUS,C ;bit goes into carry for rotate
goto recordbit
recordbit:
rlf rxlow,f ;shift bit in rxlow.0, rxlow.7 >> C
rlf rxhigh,f ;shift C >> rxhigh.0
waitforlow:
btfsc PORTA,4
goto waitforlow
checkiffinished:
decfsz rxbits,f
goto waitforhigh
movfw rxlow
subwf rxlow1,0
bz checkhighbyte ;good so far, check high byte
goto bad_comp ;bad compare, get another one
checkhighbyte:
movfw rxhigh
subwf rxhigh1,0
bz checkf9 ;good so far, check rxhigh for f9
goto bad_comp ;bad compare, get another one
checkf9:
movfw rxhigh
sublw H'F9'
bz good_comp ;good compare test for threshold
goto bad_comp ;bad compare, get another one
good_comp:
decfsz goodthresh,f ;must be good n times
goto main_loop
movfw rxlow
movwf L
movfw rxhigh
movwf M
goto main_loop
bad_comp:
movlw D'3' ;reset test threshold
movwf goodthresh
movfw rxlow
movwf rxlow1
movfw rxhigh
movwf rxhigh1
goto main_loop
;=======================================
;high3mS: looks for 3mS of high on PORTA,4
; instr = 3n + 5n^2
;=======================================
high_3mS: ;3000 instr at 4MHz
movlw D'24' ;=2952 instr
movwf J
j3mS:
movwf K ;K=J
btfss PORTA,4
goto high_3mS ;start over if it goes low during wait
k3mS:
decfsz K,f ;K=K-1
goto k3mS ;5 instr per k loop
decfsz J,f ;J=J-1
goto j3mS ;3 instr per j loop
return
;=======================================
;Wait_100uS: Delays return for 100uS
;=======================================
wait_100uS: ;100 instructions at 4MHz
movlw D'31'
movwf J ; J = 10
jloop:
decfsz J,f ; J = J-1, skip next if zero
goto jloop
return
INTERRUPT:
movwf w_temp ;save W
test1:
btfsc DigEn,0 ;if on dig0, set dig0
goto setdig0
btfsc DigEn,1 ;if on dig1, set dig1
goto setdig1
btfsc DigEn,3 ;if on dig2, set dig2
goto setdig3
goto setdig2 ;if on dig3, set dig3
setdig0:
movf PORTA,W ;clear dig enable
; andlw H'F0' ;(com cathode)
iorlw H'0F' ;(com anode)
movwf PORTA ;
movf L,W ;
andlw H'0F' ;keep lower nibble
call seg_pat ;get seg pattern in w
xorlw H'FF' ;(com anode)
movwf PORTB ;and put in on the port
; bsf PORTA,0 ;then enable dig0 (com cathode)
bcf PORTA,0 ;then enable dig0 (com anode)
rlf DigEn,f ;adjust digit pointer
goto restore_fi
setdig1:
movf PORTA,W ;clear dig enable
; andlw H'F0' ;(com cathode)
iorlw H'0F' ;(com anode)
movwf PORTA ;
swapf L,0 ;reverse nibbles in L, result in W
andlw H'0F' ;keep lower nibble
call seg_pat ;get seg pattern in w
xorlw H'FF' ;(com anode)
movwf PORTB ;and put in on the port
; bsf PORTA,1 ;then enable dig1 (com cathode)
bcf PORTA,1 ;then enable dig0 (com anode)
rlf DigEn,f ;adjust digit pointer
goto restore_fi
setdig2:
movf PORTA,W ;clear dig enable
; andlw H'F0' ;(com cathode)
iorlw H'0F' ;(com anode)
movwf PORTA ;
movf M,W ;
andlw H'0F' ;keep lower nibble
call seg_pat ;get seg pattern in w
xorlw H'FF' ;(com anode)
movwf PORTB ;and put in on the port
; bsf PORTA,2 ;then enable dig1 (com cathode)
bcf PORTA,2 ;then enable dig0 (com anode)
rlf DigEn,f ;adjust digit pointer
goto restore_fi
setdig3:
movf PORTA,W ;clear dig enable
; andlw H'F0' ;(com cathode)
iorlw H'0F' ;(com anode)
movwf PORTA ;
swapf M,0 ;reverse nibbles in M, result in W
andlw H'0F' ;keep lower nibble
call seg_pat ;get seg pattern in w
xorlw H'FF' ;(com anode)
movwf PORTB ;and put in on the port
; bsf PORTA,3 ;then enable dig1 (com cathode)
bcf PORTA,3 ;then enable dig0 (com anode)
bcf DigEn,3 ;adjust digit pointer
bsf DigEn,0
goto restore_fi
restore_fi:
movf w_temp,W ;restore W
bcf INTCON,T0IF
retfie
seg_pat:
addwf PCL,f ;bit.0=seg.a
retlw B'00111111' ;0
retlw B'00000110' ;1
retlw B'01011011' ;2
retlw B'01001111' ;3
retlw B'01100110' ;4
retlw B'01101101' ;5
retlw B'01111101' ;6
retlw B'00000111' ;7
retlw B'01111111' ;8
retlw B'01100111' ;9
retlw B'01110111' ;a
retlw B'01111100' ;b
retlw B'00111001' ;c
retlw B'01011110' ;d
retlw B'01111001' ;e
retlw B'01110001' ;f
end
Get HushMail. The world's first free, fully encrypted, web-based email system.
Speak freely with HushMail.... http://www.hushmail.com
1999\10\24@122026
by
Wagner Lipnharski
|
IR remote are not always PWM. The most widely used code, the RC5, is not
PWM, but differential signal level, what confuse people to think it is
pwm. If a person who never had deal with data communication look at the
output wave form of a RC5 at scope, he will say it is pwm, but its not.
Each bit transmitted in RC5 has the same length, and exactly in the
middle of the bit it changes level. The level transition happens from
one to zero if the bit is zero, from zero to one if the bit is one, so,
the second half of the bit tells you what level the bit is.
Transmitting mixed bit levels will generate patterns that someone can
thinks is pwm. Example, sending bits combination of 01010101 will
generate a square wave with half the frequency than sending only ones or
zeros... but this is just because bits zeros start with high level, and
ones with low level.
bit 0: -_
bit 1: _-
0000 : -_-_-_-_
1111 : _-_-_-_-
0101 : -__--__-
0011 : -_-__-_-
Some other remotes use real PWM, with a double bit time for different
level, they are not difficult, but demand some more work. RC5 is easy to
decode, it is just as a serial data transmitted, you just need to
produce a software serial reception routine, that samples the incoming
data at the middle of the second half of each bit, it is the bit level.
The bit train represent identifiers. For example, some bits identify the
equipment, as TV, Radio, Tape, CD, DVD, Laser Disk, and more. Other bits
means the key pressed or function.
If you want to use a remote to control something else, go for Philips
remotes, they use only 14 bits and low frequency modulation, even to
sync at the scope :) so a 6 MHz uC can understand it perfectly.
I already produced a device IR controlled, and used the Philips way,
after testing Panasonic, Pioneer, JVC, and another bunch of codes
produced by those 4in1 programmable remotes. Of course, as I produced
the transmitter and receiver, I changed the codes, so not even the
Philips remotes can interfere with my machine. I could use *any* bits
combination or timings, but upon a jumper on the board allows me to
return the receiver to understand Philips remotes.
I am producing a web page about it, it is not finished, but I hope that
what is ready helps you in anyway. Take a look at:
http://www.ustr.net/infrared.shtml
Wagner.
1999\10\24@145710
by
Nigel Goodwin
In message <002501bf1df1$564a58a0$865d868b@oemcomputer>, Agnes en Henk
Tobbe <spam_OUTtobbeTakeThisOuT
BIGPOND.COM> writes
>Hallo all,
>Of course this has been asked before. I cannot find the codes that are
>transmitted by my TV/VCR remote control. I see signals on the scope and want
>to do something with it but...
It depend on the particular type of remote control, different makes use
totally different coding and modulation schemes. The most common is the
Philips RC5 system, this is used by many manufacturers, there has been
source posted here for RC5 in the past.
--
Nigel.
/--------------------------------------------------------------\
| Nigel Goodwin | Internet : .....nigelgKILLspam
@spam@lpilsley.demon.co.uk |
| Lower Pilsley | Web Page : http://www.lpilsley.demon.co.uk |
| Chesterfield | Official site for Shin Ki and New Spirit |
| England | Ju Jitsu |
\--------------------------------------------------------------/
1999\10\26@103113
by
eplus1
More... (looser matching)
- Last day of these posts
- In 1999
, 2000 only
- Today
- New search...