So you are saying that the first way works but it will make the MCU busy and can't do other things
but aren't we adjust the timers in the start of the program and then leave it to work alone?
In first example the Frequency / PWM Generation is fully made by software in both Timer 1 Comparematch Interrupts.
Between two Cycles are only 444 Clock Cycles that give you ~ 440 Assembler commands for 1 Cycle.
A further Interrupt will make trouble and disturb the PWM generation.
Normal programs in Main Routine will work, but they are very often interupted by the Comparematch. So it'll not run with full speed.
The other way is too calculate the Controller Frequency or an external Frequency for Timer 1 that there will be an 38kHz Signal generated.
E.g. 38Khz * 256 = 9.728kHz in Fast PWM Mode 8Bit, of Timer 1 with Prescaler 1.
So the PWM generation runs into Hardware. The Controller core has nothing to do beside load the Comparematch A ( B ) Register with duty cycle information.
This PWM has 256 steps between 0% an 100% duty cycle.
Additional there is no needing of Interupts for PWM generation in this mode.
By using a 10MHz Crystal, is not exact 38kHz reachable!
In fast PWM Mode one Duty cycle is not Possible.
Im not shure ist that 0% or 100% ?
Look into Datasheet to clear that.