SPI reading problem

Document created by analog-archivist Employee on Feb 23, 2016Last modified by analog-archivist Employee on Feb 23, 2016
Version 4Show Document
  • View in full screen mode

We are facing a problem when reading Status Register 1. In our project the
interrupt enabling at the initialization of ADE7878 for the zero crossing of
each phase is „Status1; Bit9 - Bit11“.

When the interrupt is triggered, we read the corresponding bit and toggle an

Here it can be seen that the signal toggles every 10ms but this happens only
with Bit9 and Bit10: "Status_Reg_1_1.png"

Bit11 will be irregularly set therefore the interrupt will be also irregularly
triggered. If we use Bit8-10 of Status Register 1, then we have 3 clear signals
every 10ms : "Status_Reg_1_1.png"

Then we saw that there are two default values in Status Register 1 and
therefore we tried to display the values of the array on the LCD. However, the
assignment of the displayed and default values don’t match. Is there eventually
a mistake in the datasheet? We have also exchanged MSB and LSB in the array to
see if that could be the problem but that was not the case : "table.png"


It seems the bits of STATUS1 register are received shifted right: bit 9 is
received as bit 8, bit 10 is received as bit 9, etc.
You need to debug this. You need to look with the oscilloscope at the STATUS1
bits as they are sent out by the ADE7878 on the MOSI line. And make a
correlation between what you see on the oscilloscope and the word received by
the microcontroller.