0

I have TSOP1738 and PIC16f887a, 4mH. I want to do something which is:

  • if I push button '2', led1 should work.
  • if I push button '4', led2 should work.

I just simply thought a method but couldn't succeed. I found my remote controller buttons' addresses. For example the address of button '2' is 0XFF18E7 and I made this :

if(input(pin_a0) == 0xFF18E7){
    output_b(0b00000001);
    delay_ms(500);
}

By the way, I connected output pin of TSOP1738 to pin_a0 and connected led to pin_b0.

I think pins work only 1 or 0 and do not see that address as I tried. How can I interface my remote controller with PIC?
Which way should I follow?
I don't know interrupt method, is there any way except interrupt?

(I have term project, I just trying this remote controller to see if it works or not. I will then use that on a DC motor action)

Mike
  • 4,041
  • 6
  • 20
  • 37
Berke
  • 1
  • 2
  • We need a wiring diagramm and your code if you want help. – Mike Dec 04 '19 at 07:47
  • The website wants at least 10 reputation so I could not upload image of my simulation and wiring diagram picture. Could you share your email address so I can mail you image – Berke Dec 04 '19 at 13:00
  • It looks like aß you wants to read a 24bit value on a single pin. – Mike Dec 04 '19 at 14:17
  • I use TSOP1738 and don't know if it is 32 or 24 bit, which way do you suggest me to follow and I can mail pin connections diagram in my circuit. – Berke Dec 04 '19 at 16:18
  • You can only read one Bit from a pin otherwise you need something like SPI or UART. Look into the datasheet. – Mike Dec 04 '19 at 18:36
  • Thanks Mike. I found a solution which is ready to go on this website link, https://simple-circuit.com/pic16f877a-nec-remote-control-decoder/ – Berke Dec 04 '19 at 20:56
  • https://www.sbprojects.net/knowledge/ir/index.php much better link. Yes pretty easy to use one of those receivers and an mcu to decode a remote. I actually did my first with a pic but then have repeated it many times. Fun beginner project. not all remotes are nec, a lot arent. some protocols are easier than others. NEC and others that have a sync pattern up front are easier than ones that are just biphase/manchester encoded. – old_timer Dec 04 '19 at 23:03
  • you have to decode the protocol then from that take the value decoded and then if-then-else your way to which led you want to light up. if you simply tie the output of the receiver to an led either through software or directly through a resistor you will just get the led to blink in visible light what is happening in IR – old_timer Dec 04 '19 at 23:05
  • which in and of itself isnt a bad first task in software – old_timer Dec 04 '19 at 23:05

0 Answers0