ADE9000 Technical Reference Manual
UG-1098
Rev. 0 | Page 39 of 86
To ensure that a buffer’s worth of samples has been captured
before the event, follow this sequence:
1.
Select center capture on trigger mode: WF_CAP_SEL = 1,
WF_MODE = 2.
2.
Disable all trigger events by writing WFB_TRG_CFG = 0.
3.
Make sure that at least half of the buffer has been filled by
enabling an interrupt to occur on IRQ0 when Page 7 is filled,
by setting only Bit 7 in the WFB_PQ_IRQEN register and
enabling the PAGE_FULL bit in the STATUS0 register.
Alternatively, the LAST_PAGE register can be read instead
of using the interrupt.
4.
Start the capture by writing WF_CAP_EN = 1.
5.
Wait for the buffer to be filled (indicated by when the
PAGE_FULL interrupt occurs or LAST_PAGE = 15).
6.
When the buffer is filled, enable the desired waveform
buffer events in the WFB_TRG_CFG register and set the
WFB_TRIG_IRQ bit in the STATUS0 register to generate
an interrupt when the event has occurred and the
waveform buffer has stopped filling.
7.
When WFB_TRIG_IRQ occurs, read the
WFB_TRIG_ADDR register to obtain the address of the
trigger event, which is within a sample or two of when the
event occurred. The last filled address is 1024 samples later.
Save Event Address and Keep Filling
To record the waveform buffer address when a trigger event
occurs, while still filling the buffer, select WF_MODE = 3 for
continuous filling. When a trigger event that is enabled in the
WFB_TRG_CFG register occurs, the WFB_TRIG bit in the
STATUS0 register is set, which can be configured to generate an
interrupt on the IRQ0 pin. Read the WFB_TRIG_ADDR bits in
the WFB_TRIG_STAT register to obtain the waveform buffer
address for the event. Only the first enabled trigger address is
stored; any later trigger events are ignored.
RESAMPLED WAVEFORMS
When resampling is enabled, the data from all seven channels is
calculated and stored into the buffer. One sample set consists of
one sample per channel, seven samples total, which are from the
same point in time. Each resampled waveforms sample is 16-bits
wide.
Figure 51 shows how the resampled waveforms are stored into
the buffer. Every sample set is separated in memory from the
adjacent one by the use of spare cells, as shown in Figure 51.
These spare cells do not contain any sample data. There is one
16-bit spare cell at the end of every fourth consecutive 32-bit
memory location. If the neutral current channel is disabled, the
16-bit location that stores IN samples also act as spare cells.
IN, IF WF_IN_EN = 1
SPARECELL, IF WF_IN_EN = 0
SPARE CELL
0
15
31
0 xFFF
0x802
0x801
0x800
IN
VC
VB
VA
IC
IB
IA
IN
VC
VB
VA
IC
IB
IA
IN
VC
VB
VA
IC
IB
IA
15
523-
0
51
Figure 51. Resampled Waveform Sample Storage
The waveform buffer contains 2048, 32-bit memory locations
and can hold 512 (2048/4) sets of samples in coherent fill mode.
In the
, the buffer is filled with 128 resampled points
per line cycle, which implies that the buffer can hold four line
cycles’ worth of data at any instant in time(128 × 4 = 512). With
a 50 Hz line frequency, the buffer contains 80 ms worth of
resampled data.
To start filling the waveform buffer with resampled waveforms,
first clear the WF_CAP_EN bit to disable the waveform buffer.
Then clear the WF_CAP_SEL bit in the WFB_CFG register to
select the resampled data to be stored in the waveform buffer.
Finally, set the WF_CAP_EN bit to start the resampling process.
The waveform buffer starts filling from its first address location,
0x800. When the waveform buffer is full, the COH_WFB_FULL
bit of STATUS 0 goes high, which can be enabled to generate an
interrupt on IRQ0. Note that this is the only status bit available
for the resampled waveforms. The filling of the waveform buffer
stops.
To obtain a new set of resampled data, first clear the
WF_CAP_EN bit in the WFB_CFG register to 0 and then set
the bit back to 1.
The time taken to fill the buffer depends on the line frequency.
The waveform buffer values are retained even when the
waveform buffer is disabled by clearing the WF_CAP_EN bit
in the WFB_CFG register.