1

I'm trying to use Analog Devices' isolated ADC ADE7912 to build a native product for voltage and current sensing, using an Arduino as a microcontroller. The IC communicates with the Arduino using SPI (and SCK frequencies of 8,4,2 and 1 MHz), and I have followed the datasheet and written down some basic code using SPI-transactions and all, which seems to be giving correct results when I apply a positive voltage to the inputs of the ADC. I have two problems here:

  1. When I try to display the SCLK, MISO and MOSI signals on an oscilloscope, the clock seems to have trouble maintaining its value (it becomes erratic and hence the SPI communication also misses some values etc.) Why is this happening?

  2. When I apply a negative voltage to the ADC inputs, the IC does not really show any response to that even though it clearly supports negative voltage inputs to the ADC, as mentioned in the datasheet. This might be an IC related problem, but I am not sure.

Also, is there anyone who has built a library for this IC? Would be greatly obliged if they could share it.

  • As for the first question, what happens when you don't connect the oscilloscope? Cause sometimes (unlikely in this case, but who knows) the capacitance you add by connecting a probe changes the behavior. As for the second question, probably you'll need to post the schematic too – frarugi87 Apr 1 '16 at 12:42
  • Please post screenshots of what you see on the oscilloscope -- that makes problems like this much easier to debug. – David Cary Apr 2 '16 at 21:25
  • The Arduino drives the SCLK pin of the ADE7912, right? I often find it much easier to debug problems if I can (at least temporarily) use a slower clock. The ADE7912 datasheet says it works at 250 kHz SCLK; can you program the Arduino to use that speed? (It is normal for the SCLK to run at the programmed frequency for 8 or 16 cycles, and then pause for long times; that kind of "erratic SCLK" is perfectly normal). – David Cary Apr 2 '16 at 21:41
1

I have not written a full library, but I have recently been using the ADE7913 (same as ADE7912 but with an extra voltage channel) with an Arduino MEGA.

The basic sketch located here talks to the ADE7913 over SPI, and then prints the results of the measurement registers over serial (so you can see them using a serial monitor).

I have not yet done much measurement testing, so can't comment on the negative voltage issue you have seen, but the sketch sets up the ADE7913 to use the V2WV register for monitoring temperature, and converts the result into degrees C, so you should be able to tell if its working properly.

In terms of the issues you have been having with the SPI comms, I can offer the following suggestions based on my troubleshooting experience (I also had glitchy comms initially):

  1. I'm pretty new to SPI, but my interpretation of the data-sheet is that the ADE791X chips use SPI_MODE3 (i.e. SCLK is normally high, and samples are read on the trailing clock edge). I have found SPI_MODE1 also works, but unless others can correct me would suggest using 3.
  2. I found having physically long jumper wires (my prototyping is still on a bread-board) caused issues. I have read elsewhere that at frequencies in the ones of MHz, distances less than tens of meters shouldn't be an issue; but I shortened / tidied my wiring and it seemed to help.
  3. I would run everything at lowest possible speeds to troubleshoot, i.e. set the ADC sampling rate to 1kHz (set CONFIG bits 5:4 to 11), and set the SCLK at 250kHz.
  4. In the attached sketch, I am reading the register values based on an interrupt from the CLKOUT\!DREADY pin. You have to be careful that this reading routine takes less than one ADC sampling time to read all the registers. There is a good explanation of this timing constraint in Figure 8 of this application note. The attached sketch also reports some timing information over serial to help with this.

Hope that helps,

  • Khalid.
  • Just to update the note above, I have now tested over a range of positive and negative voltages (from +250mV to -250mV at the V1P pin) and confirmed excellent linearity over this range (within 1% is as good as I can say with the test equipment I have). – kabdulla Jun 26 '16 at 4:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.