MarkT:
Yes, I think you've got the idea.
You need to ensure you don't drive to 400 - limit at 399 perhaps?
You also need to find out how fast your H-bridge switches off to set the actual
dead-time value.
If you footle with the timer TCCRxA register (I think) you can invert one of the pins
it drives but not the other, and the code can be as simple as:
analogWrite (pinA, x) ; // or a direct register access like OCRxA = x ; OCRxB = x+1
analogWrite (pinB, x+1) ;
Careful reading of the relevant timer section of the datasheet is recommended.
I will probably need only from around 130 to around 270 (I'm driving CD player ejection motors).
If I understand correctly its a few microseconds? Thats a lot :\ If frequency of timer is 16MHz, one tick lasts 62.5ns and thus the enforced dead time by adding "1" distance. Im not sure how to calculate with these values there, do I have to subtract rise and fall or something else. With these values I might have to put difference of even 32 :\ Current still flows a bit after turning off, right, so if I make a big gap it wont be actually seen as a big gap by the motor, right? I dont want to defeat the purpose of locked antiphase drive by adding too much space between phases :\
You know, despite the heating I guess the h-bridge must have some sort of protection or it would get much more hot I reckon.

Yes, I did that, I was using exactly that when I was testing:
void connectPWM(int val)
{
// Disable interrupts for this timer
TIMSK1 = 0;
// Set Phase-Correct PWM, use ICR1 as TOP
// Set prescaler to 1
TCCR1A = BIT(WGM11);
TCCR1B = (BIT(WGM13) | BIT(CS10));
// Set TOP to 400 + 1 for 20kHz PWM
ICR1 = 401;
// Reset Timer/Counter to 0
TCNT1 = 0;
// Set duty cycles
int norm_val = val - 1; // Dead Time. Temp variable to be able to change registers at the same time (well as possible)
int invr_val = val + 1;
OCR1A = norm_val; // set pwm duty
OCR1B = invr_val; // set pwm duty
// connect pwm to pins on timer 1, channels A and B
// Clear OC1A on Compare Match when upcounting. Set OC1A on Compare Match when downcounting.
// Set OC1B on Compare Match when upcounting. Clear OC1B on Compare Match when downcounting.
TCCR1A |= (BIT(COM1A1) | BIT(COM1B1) | BIT(COM1B0));
digitalWrite(ENABLE_PIN, HIGH);
}
Edit:
Looking at the times, to me it seems that there is already built-in some delay to prevent shoot through?
To me it seems there is already built-in some dead time?