完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
目前在做一个项目用到ADE7878芯片,调试过程中遇到以下几点问题:
1、实测AVDD无输出,DVDD输出2.5V; 2、采用内部ref基准,但是REF管脚只输出0.8V;如图所示,本来是采用外部基准,但是外部Ref参考电压设计成2.5V,已经割线,并外接4.7uf去耦电容。 3、VAP/VBP/VCP调理电路前输入市电227V左右,调理后实际峰值为450mV左右,但是AVRMS/BVRMS/CVRMS读取全为0; 软件上按照官网参考demo,初始化完成后,IRQ1中断上电后产生一次中断,IRQ0中断每隔一段时间产生一次,这些都没有问题,另外SPI通讯确认没有问题;主要问题就是读取有效值没有数据产生; App_WriteReg()函数已经对寄存器的读写的数据长度 做了处理; void App_InitConfig(void) { App_WriteReg(GAIN,0x0000); //config the Gain of the PGA , which is before the ADC of ADE7878 App_WriteReg(CONFIG2,0x00); // App_WriteReg(HPFDIS,0x0000); //enabled high-pass filters App_WriteReg(VLEVEL,491520); App_WriteReg(AIGAIN,0x00000000); //calibration App_WriteReg(AVGAIN,0x00000000); App_WriteReg(BIGAIN,0x00000000); App_WriteReg(BVGAIN,0x00000000); App_WriteReg(CIGAIN,0x00000000); App_WriteReg(CVGAIN,0x00000000); App_WriteReg(NIGAIN,0x00000000); App_WriteReg(AIRMSOS,0x00000000); App_WriteReg(AVRMSOS,0x00000000); App_WriteReg(BIRMSOS,0x00000000); App_WriteReg(BVRMSOS,0x00000000); App_WriteReg(CIRMSOS,0x00000000); App_WriteReg(CVRMSOS,0x00000000); App_WriteReg(NIRMSOS,0x00000000); App_WriteReg(AWGAIN,0x00000000); App_WriteReg(AWATTOS,0x00000000); App_WriteReg(BWGAIN,0x00000000); App_WriteReg(BWATTOS,0x00000000); App_WriteReg(CWGAIN,0x00000000); App_WriteReg(CWATTOS,0x00000000); App_WriteReg(APHCAL,0x0000); App_WriteReg(BPHCAL,0x0000); App_WriteReg(CPHCAL,0x0000); App_WriteReg(CF1DEN,0x00A7); //configure the ENERGY-TO-FREQUENCY App_WriteReg(CF2DEN,0x00A7); App_WriteReg(CF3DEN,0x00A7); App_WriteReg(CFMODE,0x0E88); //CF1-total active power, disable; CF2-total reactvie power, disable; CF3- fundamental avtive power, disable App_WriteReg(ACCMODE,0x0000); App_WriteReg(COMPMODE,0x01FF); App_WriteReg(MMODE,0x00); App_WriteReg(WTHR0,0x007BBE61); //PMAX = 33,516,139 0.001WH/LSB //page 47 datasheet Rev. E App_WriteReg(WTHR1,0x00000017); App_WriteReg(VATHR0,0x007BBE61); //PMAX = 33,516,139 App_WriteReg(VATHR1,0x00000017); App_WriteReg(VARTHR0,0x007BBE61); //PMAX = 33,516,139 App_WriteReg(VARTHR1,0x00000017); App_WriteReg(LCYCMODE,0x0F); //phase A is selected for zero cross App_WriteReg(LINECYC,0x0064); App_WriteReg(MASK0,0x00020020); //IRQ0 interru enable App_WriteReg(MASK1,0x00000000); App_WriteReg(MASK1,0x00000000); App_WriteReg(MASK1,0x00000000); } #define TaskMeasure_Release_Ticks 10//ÈÎÎñÊÍ·ÅCPUµÄtickÊý void MeasureTask (void *parg) { //INT8U *msg; unsigned char i = 0; OSTimeDly(100); Ade7878_SPIInit(); App_InitConfig(); App_WriteReg(RUN,0x0001); delay_ms(100); while(1) { if(ucIRQ0Flag == 1) { ucIRQ0Flag = 0; Ade7878_CheckSTATUS0(); //这里可以进去 App_ReadUserData(); } IWDG_Feed();//feed dog OSTimeDly(TaskMeasure_Release_Ticks); /* ÊÍ·ÅCPU */ } } |
|
相关推荐
|
|
你正在撰写答案
如果你是对答案或其他答案精选点评或询问,请使用“评论”功能。
偏置电路与宽带偏置电路(Bias-Tee)-----电感器比较与选择
910 浏览 0 评论
5440 浏览 0 评论
3036 浏览 2 评论
6043 浏览 2 评论
3978 浏览 0 评论
浏览过的版块 |
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-19 03:26 , Processed in 0.683454 second(s), Total 74, Slave 56 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号