Quote Originally Posted by HenrikOlsson View Post
Hello again,
If Fosc=10MHz then Tosc=100ns. If you select the source for the Dead Time unit to be Fosc/2 then one "unit" of dead time equals 200ns. You want 5us deadtime which equals 25 "units" of 200ns each so the lower 6 bits of DTCON should be set to 25. If you're using the Fosc/4 setting then one "unit" of deadtime is 400ns and the lower 6 bits would have to be to set to 12.5 to get exactly 5us which obviously isn't possible - use 12 or 13.

/Henrik.
Oh .. I didn't notice this comment when did it show up ? thanks Henrick
but still the only left problem is the delay thing which is leading to a lower output frequency.
Also I made an array to lookup up entries and I'm not sure i I'm doing it the right way..
I had to declare each entry in the array one by one .. also compiler refuse using .Lowbyte and .Highbyte (ex : pdc0l=duty[i].lowbyte) with arrays so I made two arrays one for pdcxL and another for pdcxH
is there any other way to declare an array ? or other other function for this case ?