Olin, Main idea for counting from 0-360 is that there are 4 Pulses top 2 and bottom 2 they run at 60hz no matter what And they move right and left. Their normal startup looks like this: Top2 starts at 180degree and bottom 2 starts at 28degree now That's when x register=28 default. When x register changes becomes 29 top 2 pulses moves 1 degree left which is 179 degree and bottom 2 moves 1 degree right becomes 29 degree. 60 hz never gets changed. Top2 and bottom2 they are inverted from each other this is how inverters generate sinusoid. It looks like 47,25 us is ok to use but your calculation is better. I didn't want to talk about it in detail because people do not want to read long e-mail. After all final output looks like this. <== moves left B1 T1 |------| |------| | | | | ------ |-----| |-----| |----- | | |------| B2 T2 ==> moves right B1 = rising edge of bottom pulse B2 = falling edge of bottom pilse Same thing for T1 and T2. based on battery voltage and current load x register will be updated in order to keep stable 110v 60 hz 40amp sinusoid. Andre Abelian -----Original Message----- andre abelian wrote: > This is for power inverter that from 0-360 must be 16.66 ms > 16,66/360=46.27us but we are getting 46.25us. Duh! This is wrong, and sounds silly anyway. The period of a 1 degree phase change of a 60Hz sine wave is 1 / (60Hz * 360deg/Hz) = 46.30uS/deg. Therefore 46.27uS is actually closer than 46.25uS, but neither is accurate to within the 4 implied digits. Furthermore, why does this inverter need to do whatever it does exactly every 1 degree? Degrees are a human convention, but there is otherwise nothing magic about 1/360 of cycle. ***************************************************************** Embed Inc, embedded system specialists in Littleton Massachusetts (978) 742-9014, http://www.embedinc.com -- http://www.piclist.com hint: The list server can filter out subtopics (like ads or off topics) for you. See http://www.piclist.com/#topics -- http://www.piclist.com hint: The list server can filter out subtopics (like ads or off topics) for you. See http://www.piclist.com/#topics