I've never fully understood how the IPEAK stuff works on a 7816. As an experiment, with 50Hz ideal inputs on V and I, I've left the CHANNEL_SEL bit at its default of 0 so I'm monitoring channels A, B and C, and I've left MMODE untouched, so all PEAKSEL bits should be enabled. Next I set PEAKCYC to its maximum of 255, so I expect PEAK events every 2.5 seconds. I've applied current to channel C only. Channels A and B are reading 0 (or background noise levels at least).
The VPEAK stuff looks perfect. I get a PKV interrupt every 2.5 seconds and the reading makes sense:
2015-03-28-16:41:49.398262 VPEAK(2): 0x07502166
2015-03-28-16:41:51.946198 VPEAK(2): 0x07502370
2015-03-28-16:41:54.497859 VPEAK(2): 0x07501fb5
2015-03-28-16:41:57.045581 VPEAK(2): 0x075021f2
but I'm confused by what I see on the IPEAK stuff. The PKI interrupts seems to come in at about 0.6 seconds, which I'm guessing is 3x the 2.5 second frequency, which kinda' makes sense, since it has 3 times as many things to report. But in all 3, it always reports channel C ('4' in the relevant nibble below), the one that has some current:
2015-03-28-16:41:37.374508 IPEAK(2): 0x040889fb
2015-03-28-16:41:38.022934 IPEAK(2): 0x04088926
2015-03-28-16:41:38.625356 IPEAK(2): 0x04088afa
2015-03-28-16:41:39.174239 IPEAK(2): 0x040889b6
2015-03-28-16:41:39.769073 IPEAK(2): 0x04088a1a
2015-03-28-16:41:40.391257 IPEAK(2): 0x04088a32
Other than that, the reading appears correct. So it's as if each of the 3 channels are trying to report their IPEAK over the last 255 cycles, but I only get to see Channel C's peak (the only with significant current).
Does the IPEAK stuff try to compare peaks between the 3 channels and report the largest, or does each channel maintain its own independent IPEAK and report that?