Do with STM32F103RBT6 + ATT7059S voltage, current, power, frequency detection, the use of voltage sensor (ma: 2 ma), current sensor (10 A: 5 ma.) now, voltage, frequency detection is normal, normal in their pure resistance load current, the perceptual load vary widely (measure the actual current is 4.6 A, 8.34 A), for both sensors are isolated, considering phase is wrong, but now how to adjust, the detected results did not change, only to adjust the gain, used to ask A great god, and how to handle?
X32//ATT7059S_Wirte (0, 0 x00bc);//open the write protect; Operation timing parameters of 40 to 45 h h register
//ATT7059S_Wirte (0 x40, 0 x0000);//EMU configuration register 0000
X32 ATT7059S_Wirte (0, 0 x00a6);//open the write protect; Operation timing parameters of 50 h to 7 ch register
X0000 x59 ATT7059S_Wirte (0, 0);//ADC channel gain is 1 times
Xd982 x50 ATT7059S_Wirte (0, 0);//channel 1 active power correction err=43%
Xd982 ATT7059S_Wirte (0 x51, 0);//channel 1 reactive power correction
Xd982 x52 ATT7059S_Wirte (0, 0);//the apparent power of channel 1 correction
X6d ATT7059S_Wirte (0, 0 xe038);//channel 1 phase correction of PQ way 0000
X58 ATT7059S_Wirte (0, 0 xe038);//reactive phase compensation FF00