Hi Rob,
Thanks for responding, even though you're on vacation. First some more information. I have a device that I normally operate with push buttons, but that can also work with RC5 if i connect  a Tsop1836 on it, for example. I also have the codes used for address and commands. So I want to use a Pic as a transmitter.
Actually I don't need the whole IR part  because I can also connect an output of the PIC directly to the RC5 input of the device.. I have already found the information about what the pulse train should look like.
At least it keeps the gray matter flexible.
Greetings and have a nice holiday
Hans
Hi Rob,
I've tried a few things but it's not as easy as I thought. Simply removing the IR receiver and replacing it with an optocoupler will not work. There's something behind it with no license plates. So I put the case back together and checked with a standard remote. He's working again. End of story : I do need a lib for the normal IR operation. If it can send and receive. I hope you have the time for it.
Here is what i have done.
 I have a very old RC5 reader and on that one the data reeceived is correct, adres and commands. But not on the one i like to use. (as i said above)
-- Title: RC5 test
--
Â
-- ------------------------------------------------------
--
--
include 16f877a                    -- target PICmicro
--
Â
pragma target clock 20_000_000Â Â Â Â Â -- oscillator frequency
--
pragma target OSCÂ Â Â Â Â HSÂ Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â -- crystal or resonator
pragma target WDTÂ Â Â Â Â DISABLEDÂ Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â -- watchdog
pragma target DEBUGÂ Â Â DISABLEDÂ Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â -- no debugging
pragma target BROWNOUT DISABLEDÂ Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â -- no brownout reset
pragma target LVPÂ Â Â Â Â DISABLED---ENABLEDÂ Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â -- low voltage programming
--
Â
enable_digital_io()Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â -- make all pins digital I/O
Â
-- library with delay procedures
include delay
Â
alias RC5Â Â Â is pin_D2
pin_D2_direction = output
RC5 = low
Â
Â
include delay                        -- fetch delay library
--
 procedure HOOG is
 RC5 = low
 _usec_delay(889)
 RC5 = high
 _usec_delay(889)
 end procedure
Â
 procedure LAAG is
 RC5 = high
 _usec_delay(889)
 RC5 = low
 _usec_delay(889)
 end procedure
Â
 procedure BASIS is
 hoog
 hoog
 laag
 laag
 laag
 hoog
 laag
 hoog
 end procedure
Â
 procedure  START_PAUZE is
 for 10 loop
 basis
 hoog
 hoog
 laag
 hoog
 laag
 hoog
 delay_1mS(114)
 end loop
 end procedure
Â
 procedure STOP is
 for 10 loop
 basis
 hoog
 hoog
 laag
 hoog
 hoog
 laag
 delay_1mS(114)
 end loop
 end procedure
Â
 procedure VOLGENDE is
 for 10 loop
 basis
 hoog
 laag
 laag
 laag
 laag
 laag
 delay_1mS(114)
 end loop
 end procedure
Â
Â
  delay_1S(5)
  forever loop
Â
  start_pauze
  delay_1S(2)
  start_pauze
  delay_1S(2)
  start_pauze
  delay_1S(2)
  stop
  delay_1S(2)
  volgende
  delay_1S(2)
  start_pauze
  delay_1S(2)
  stop
  delay_1S(5)
 Â
  end loop
 Â
Â
Â
Â
Thanks again.
regards
Hans