Attiny85 IR code for Sony protocol
Attiny85 core files used:
You must select the correct “board” type… ATtiny85@16MHz (internal PLL)>9600 BAUD serial output comes out the ATtiny on physical pin# 7
Using a dedicated Attiny85 microcontroller to monitor and decode the IR detector (MIM5383H4) frees the main uC from having to do this nasty and inefficient job. This makes for nimble IR operation on the host microcontroller where only a serial port needs to be monitored for traffic which originates from the tiny85.
My implementation uses the Sony IR protocol which is available on almost every inexpensive Universal Remote Control. The algorithm for this decode was developed and put in the public domain by Arduino Forum member pmalmsten. Full links to his work is provided in my source code. This is an Open Source implementation, so you can easily change the tiny85 to decode NEC or other remote protocols by changing the decode algorithm – but you are on your own for this effort; however there are many IR decode algorithms freely available for the searching on Google.
The main program is more efficient and requires less resources because the IR polling and decoding is eliminated and the host simply receives the decoded digits and commands on the serial port at 9600 BAUD in my example. This solution is also microcontroller agnostic: I have used it for AVR and for PIC. You can even feed the serial output of the ATtiny85 to your PC over a USB/serial converter and host software on the PC to do magic stuff.
Read more: Infrared Dedicated Decoder