Generating signal for TSOP34836 IR receiver

I’m making optical barrier using TSOP34836 and IR led. At the moment, I’m using attiny 25(/45/85) to generate 36kHz pulses and light an IR LED (I’ll paste code below). At the moment LED is on for 50% time and off for another 50%.

#include <avr/io.h>
#include <avr/interrupt.h>
#define LED PORTB1                  //connect LED to this pin PB1=DIP pin 5

void setup(void) {
    CLKPR = 0x80;                   //set the Clock Prescaler Change Enable bit
    CLKPR = 0x00;                   //set the Clock Prescaler to divide by one (8Mhz assuming factory default fuses)

    DDRB |= _BV(LED);               //set the LED pin as an output
    setupTimer1();             //set timer1 up to call myISR every 10ms
}

void loop(void) {
}


void setupTimer1() {

    TCCR1 = _BV(CTC1);              //clear timer1 when it matches the value in OCR1C
    TIMSK |= _BV(OCIE1A);           //enable interrupt when OCR1A matches the timer value
    sei();                          //enable global interrupts
    OCR1A = 221;                    //set the match value for interrupt
    OCR1C = 221;                    //and the same match value to clear the timer
    
    PLLCSR &= ~(1<<2);     // Setup synchronous clock
    
    TCCR1 |= _BV(CS10);    //set prescaler to divide by 1024 (this starts the timer). Use excel to count value
}

ISR(TIMER1_COMPA_vect) {            //handles the Timer1 Compare Match A interrupt
    PINB |= _BV(LED);
}

It works OK, but my power regulator L7805 is getting very hot even using 5mm 1.2V 0.1A Led (I’ve connected it via TIP122 transistor with 33 Ohm resistor). And want to connect 1W IR star LED, which will require even more power.
Now I think is it possible to reduce duty cycle? I’ve tried some code (pasted above), but it works very unstable. LED showing that signal is received, blinks for very short periods, etc. I can’t understand is it some problem with my code (maybe I generate not exactly 36kHz…?) or TSOP34836 is just not intended to receive such signal?

#include <avr/io.h>
#include <avr/interrupt.h>

#define LED PORTB1                  //connect LED to this pin PB1=DIP pin 5

void setup(void) {
    CLKPR = 0x80;                   //set the Clock Prescaler Change Enable bit
    CLKPR = 0x00;                   //set the Clock Prescaler to divide by one (8Mhz assuming factory default fuses)

    DDRB |= _BV(LED);               //set the LED pin as an output
    PORTB = 0;      // turn off led
    setupTimer1();             //set timer1 up to call myISR every 10ms
}

void loop(void) {
}

void setupTimer1() {
    TCCR1 = _BV(CTC1);              //clear timer1 when it matches the value in OCR1C
    TIMSK |= _BV(OCIE1A);           //enable interrupt when OCR1A matches the timer value
    sei();                          //enable global interrupts
    OCR1A = 180;                    //set the match value for interrupt
    OCR1C = 180;                    //and the same match value to clear the timer
    
        // Setup synchronous clock
    PLLCSR &= ~(1<<2);
    
    //---
    TCCR1 |= _BV(CS11);    //set prescaler to divide by xxxx (this starts the timer). Use excel to count value
}

ISR(TIMER1_COMPA_vect) {            //handles the Timer1 Compare Match A interrupt
    if(PINB){
      OCR1A = 180;
      OCR1C = 180;
      PORTB = 0;
    }else{
      OCR1A = 41;
      OCR1C = 41;
      PORTB = _BV(LED);
    
    }
}

Or maybe its normal that L7805 is getting very hot and I just have to leave it as is?

PS. In attachment there as excel document to count the value of timer and prescaler.

timer.xlsx (46.3 KB)

And want to connect 1W IR star LED,

No you need a constant current driver for such a big LED, using a series resistor at these powers does not work.

Reducing the duty cycle will reduce the light output as well so it is a bit counter productive.

even using 5mm 1.2V 0.1A Led (I've connected it via TIP122 transistor with 33 Ohm resistor).

So you are running a 0.1A LED at a current of 0.115A. The heat generated by the regulator is a function of the current and the voltage you are dropping. If you want it to run cooler then reduce the input voltage.

jarik: LED showing that signal is received, blinks for very short periods, etc. I can't understand is it some problem with my code (maybe I generate not exactly 36kHz...?) or TSOP34836 is just not intended to receive such signal?

You're right -- they won't like the signal. See page 5 of your datasheet. There needs to be pauses between bursts of blinks or the receiver will reject it as noise.

The only IR receivers I'm aware of that will accept a continuous signal are the Vishay TSSP4038 and TSSP58038.

Chagrin:

jarik: LED showing that signal is received, blinks for very short periods, etc. I can't understand is it some problem with my code (maybe I generate not exactly 36kHz...?) or TSOP34836 is just not intended to receive such signal?

You're right -- they won't like the signal. See page 5 of your datasheet. There needs to be pauses between bursts of blinks or the receiver will reject it as noise.

The only IR receivers I'm aware of that will accept a continuous signal are the Vishay TSSP4038 and TSSP58038.

That's very interesting, because when I have 50% duty cycle, it work perfectly :) But I will definitely have a look at them. The problem is it may be difficult for me to buy them.