ADE7763 Part-7 (peeling back the onion)

My ADE7763 is connected to an Arduino and I am now working on the interface code to aid in system testing. I sent several hours today with my mixed signal scope (2 channels of analog and 16 digital) debugging. What I have found is that on the whole the ADE is a pretty nice chip but it does seem to have a few rough edges.The first is that trying to use SampleMode at even the slowest data rate is well beyond the bit bad SPI interface I have on the Arduino. The first code I was working with used digitalRead and digitalWrite methods. It became painfully obvious that I had to improve the speed by switching to direct port manipulations. Now the SPI bus cycles are at least 5 times faster. I should also look into if the Arduino has any hardware SPI support that can deal with the ADE7763 strange various byte length commands.

I also found that reading the RMS value registers (V and I) and just any old time, had way too much ripple. This is mentioned in the datasheet with the caveat that you should arrange to take the samples are the zero crossing. This meant enabling the zero crossing interrupt. This is when I found the digitalRead/write SPI bus was too slow taking almost as much time as the time between zero crossing. Now the register reads for the RMS values happen at the zero crossing and seem to be rock steady (other than V and I are mysteriously swapped).

I found my negative energy problem from yesterday. Seems the V and I were 180 degrees out of phase. Swapping the CT inputs has fixed that problem.

I also learned that my investment in a good scope was worth every penny. Without it, the strange bugs I hunted down would have been impossible to find. Things are going very well. Soon I will have to think about how I am going to build 30+ of the monitors.

This entry was posted in Home Energy Monitor, Projects. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

Blue Captcha Image
Refresh

*