Plan B:
Use an other pic and set up the HPWM manually for 38 kHz. Then you connect an IR diode to the HPWM pin using a resistor to get aprox 20 mA in the led.
Then in the code you make a simple main loop. Turn on the HWPM, delay 9 ms, and then turn off the HPWM, wait a while (i.e 5 ms) and then goto main again. Point this led towards the ir-receiver from a close distance and now you have a signal that you really know how it looks like. Then you put a shoebox upside down over both the receiver and the transmitter led so they get a nice dark space to be in.
Have you ever thought about catching the IR signal using the CCP module or by using interupts and a timer?
This way you can even build a text signal for the NEC protocol ... [startpulse] delay [bit0] delay etc..
Which way to decode the signal is the best? Well it all depends what other things your pic will do. If it will only decode the IR signal you can just read the pin in a fast loop and increment a counter when it is LOW.
Keep in mind that the receiver you are using is ACTIVE LOW.. so the pin will be high when there is no modulated IR light present.
Bookmarks