Ir Remote contrller reader

Thread Starter

micropad

Joined Dec 24, 2011
106
Dear All
This is related to PIC MCU 16f877a

I need to read the Ir Remote controller signals and put the codes to LCD display
I am using Sony remote controller
I need to some tutorials about, kind of remote available and kind of protocols and there signals and number identification code table

and I need to know which peripheral I should used.( Timers or CCP or USART) ( I do not know)

If someone could point me in the right direction it would be greatly appreciated!

Please advice
Thanks in advance
 
Last edited:

MMcLaren

Joined Feb 14, 2010
861
I suspect you can find several examples in assembly language or c. There's some useful information about the 12 bit SIRC protocol here; http://www.sbprojects.com/knowledge/ir/sirc.php.

You could use any number of methods to decode SIRC. Here's a pseudo C example for decoding 12-bit SIRC using a simple loop that samples the inverted output from a TSOP4838 IR decoder at 100 usec intervals;

Rich (BB code):
;
;  unsigned int sirc = 0;           //
;  unsigned char count = 0;         //
;  unsigned char cmd = 0;           //
;  unsigned char dev = 0;           //
;
;  #define irpin porta.0            //
;
;  while(1)                         //
;  { delay_ms(326);                 // repeat delay
;    sirc = 0;                      // reset 'sirc'
;    do                             //
;    { delay_us(100);               //
;      if(irpin == 0)               // if irpin lo
;      { count++;                   // bump 100-us 'lo' count
;      }                            //
;      else                         // if irpin hi
;      { if(count)                  // if unprocessed lo pulse
;        { if(count > 2000/100)     // if 2400-us 'start' bit
;          { sirc.12 = 1;           // insert bit counter bit
;          }                        //
;          else                     //
;          { if(sirc)               // if decode in progress
;              if(count > 900/100)  // if a 1200-us '1' bit
;                sirc.13 = 1;       // insert a '1'
;            sirc >>= 1;            //
;          }                        //
;          count = 0;               // reset 'lo' width count
;        }                          //
;      }                            //
;    } while(sirc.0 == 0);          //
;    cmd = sirc >> 1 & 0x7F;        // copy 7-bit 'cmd' code
;    dev = sirc >> 8;               // copy 5-bit 'dev' code
;    ~~~                            // do "stuff" here
;  }                                //
;
 

Thread Starter

micropad

Joined Dec 24, 2011
106
Dear MMaLaren,
Thanks for the reply

Could you please guide me what is the most suitable peripheral among following for read IR sensor output

Capture
USART
TImers

Please advice
 
Top