I found this code
angle = math.Cos(outcome * 360 * c.PowerFrequency / ade7878Clock * halfCircle)
It has difference from equation 5 at ade7878a data sheet, and i get confused.
Ok, let's calc. One step of ANGLEx reg is 0.0703° for 50 Hz source. 180/0.0703 = 2560 is max ANGLEx for this formula. But in my case i receive out negative power factor. It mean the value of ANGLEx register can be more then 2056 and every next 2056 the sign will change.
I found this code
angle = math.Cos(outcome * 360 * c.PowerFrequency / ade7878Clock * halfCircle)It has difference from equation 5 at ade7878a data sheet, and i get confused.
Ok, let's calc. One step of ANGLEx reg is 0.0703° for 50 Hz source. 180/0.0703 = 2560 is max ANGLEx for this formula. But in my case i receive out negative power factor. It mean the value of ANGLEx register can be more then 2056 and every next 2056 the sign will change.