我用ADE7758测量电能,电压可以测出来,但是电流跟功率读不出来,一直是0,不知道是什么原因?个人觉得原因是初始化的问题。我没有使用EPRom,所以只是把网上例子的前面输进去了。不知道后面怎么设置。
void ADE7758_Init(void)
{
write7758(OPMODE,0x40,8);
Delay(80);
write7758(OPMODE,0x00,8);
write7758(MMODE,0x00,8);
write7758(GAIN,0x00,8);
write7758(WAVMODE,0x00,8);
write7758(COMPMODE,0x9c,8);
write7758(LCYCMODE,0x78,8);
write7758(MASK,0x000e00,24);
write7758(WDIV,0x08,8);
write7758(VARDIV,0x08,8);
write7758(VADIV,0x00,8);
write7758(APCFNUM,0x78,16);
// write7758(MASK,0x000e00,24);
// write7758(APCFDEN,0xfff,12);
// write7758(VARCFNUM,0x0000,16);
// write7758(VARCFDEN,0xfff,12);
}
希望大家可以帮帮忙
} |