I have to add TV remote control in an existing project, and it works on Extended NEC protocol.
For sensing the TV Remote Control IR data i am using TSOP1738 IC whose output is connected to RB0 pin of PIC18F4550 Micro-Controller. This pin can be configured as External Interrupt pin. (Hardware Can't be changed)
Can anyone help me in decoding this protocol using RB0 pin External Interrupt Feature.
Please share the algorithm/idea to do this task. I will try to implement it.
I had already looked most of the topics and most of the topics are without solution.
I am trying myself and thought that i will create a state machine and and use External Interrupt-0 and Timer-1 for sensing the pulse width and then based on this information i will decode the signal.
But i don't know this is the best method, so i am asking if someone has good algo for this, as i have to add this in my existing project, without changing much.
You will need one h/w timer. Each time you enter pin change interrupt you:
- check the timer value. If it less than some value, than it is noise, nothing to do
- if value between some other values, write 0 to buffer, shifting pointer
- if value higher than some value, write 1 to buffer, shift the pointer
- reset the timer to zero
If timer interrupt happens - transission finished. Analyze the data.
I used 10usec timer interrupt and then checks for pin state, for how much time pin is on high state and off state.
I didn't used any port change interrupt.
And its works properly.
Thanks for sharing that link.
I will definitely look the information provided in that link.
The method provided in that link looks much better than mine.