best solution for 12 analog outputs (5 bits)

How does that solve your problem?

It can be made to work.

Let's say that each time block is 1ms. You need 32ms to send 5 bits of data.

Run your timer isr in 1ms, 2ms, 4ms, 8ms, 16ms chunks. And set pins based on the data bits for each of those data chunks - essentially PPM.

Some pseudo code:

#define ANALOG_RESOLUTION 5 //analog resoultion, in bits
#define ANALOG_CHANNEL 12 //analog channel

const unsigned short duration[ANALOG_RESOLUTION]={1000, 2000, 4000, 8000, 16000}; //duration
unsigned char analog_output[ANALOG_CHANNEL]={2, 5, 1, 19, 2, ...};

timer_isr {
  static unsigned char i=0;
  set timer to interrupt after duration[i];
  increment i;
  if i = ANALOG_RESOLUTION then i = 0;
  loop:
    if analog_output[ch] & (1<<i) then set output pin for ch;
    else clear output pin for ch;
    increment ch;
  end loop
}

If you don't like ripples, you can shrink the minimum time block from 1ms to something smaller but I would go below 30 ticks (2us for an AVR at 16Mhz).