Hi David,
For the past one week I have been working with Voltage and Current calibration. I was trying out various things and making sure that voltage and current calibrations are fine.
These are the steps I did till now.
1. Initialize the PIC for SPI as per the guidelines given in SPI section of ADE datasheet.
2. I connected PM0 to 3.3V and PM1 to ground so that ADE powers up in PSM0 mode.
3. Then I reset the ADE by pulling down reset pin of ADE
4. After some delay I release the reset pin.
5. Then I wait for IRQ1 pin to go down.
6. After that I write some dummy value to 0xebff register three times to toggle SS pin three times.
7. After that I read the value from CONFIG2 register and make some change to bit[1:0] and write it back and then read it again to make sure that write was successful. If it was successful it denotes that SPI is locked.
8. After locking SPI, I read STATUS1 register and then write it back so that RSTDONE done bit is cleared and IRQ1 pin goes back high.
9. Then I read COMPMODE register and set 50Hz by clearing SELFREQ bit.
10. Next I read RUN register and write back 0x01 so as to switch ON DSP.
11. Then I write 0xFF6A6B to WTHR0 and 0x01 to WTHR1 as you mentioned.
12. Then I calculate VLEVEL (Vfs = 391 and Vn = 230) to be CC000 and then write it to VLEVEL register.
13. After that I begin reading Phase A voltage and current register values. I multiply it with V/LSB and I/LSB respectively to obtain real-world values. Till this step everything is working as expected. I am able to read back correct voltage and current values.
14. Next I tried reading AWATT register value. Below mentioned are the values I get for different power.
Register Values Power(W)
FFFE8ACD 274
FFFD259F 530
FFFBCC3B 780
FFFA6FFE 1030
FFF91786 1270
FFF7C394 1490
FFF6C518 1710
As you can see, when the power increases, register value is decreasing (power is positive). I am using a resistive load here. And I am increasing the load step by step. I have a weird feeling that I am doing something wrong or that I missed some trick.
Please help me calibrate these values too. Once this is done a big task gets over.
Waiting for your reply at the earliest.