<html><head></head><body>Hi All,<div><br></div><div>OK, I have figured out the ADC overflow issue. &nbsp;It's a bit complicated, so I am posting this to the gep5 mailing list so that there is a record of it.</div><div><br></div><div>Referring to the CAEN v792 manual (this is the ADC that we are using), the output buffer actually contains an overflow bit - it is the 13th bit of the output buffer. &nbsp;When this bit is zero, then there is a normal ADC value, and the lowest 12 bits contain the ADC value ... thus 0xFFF in those lowest 12 bits corresponds to ADC = 4095 in decimal. &nbsp;Now, when the overflow bit is set to 1 (meaning that there was an overflow in that channel of the ADC, it turns out that the lowest 12 bits are NOT just set to 0xFFF, as I would have thought. &nbsp;In fact, they are encoded with something that looks like 0xFXY, where "XY" is a number which runs from 0 to 255, and is in fact related to the event number. &nbsp;That is, these lowest 8 bits start at FF, and then run down to 00 as the event number increases. &nbsp;Once it gets to 00, it resets to FF and starts over again.</div><div><br></div><div>I attach below a plot of the raw ADC value vs. event number. &nbsp;For all of the events in this plot, the overflow bit (bit 13) of the output buffer was 1, so these really are ADC overflows. &nbsp;The correlation with event number is obvious. &nbsp;</div><div><br></div><div>So, how to fix this? &nbsp;It does need to be fixed, because the ADC value for non-overflow events really can range from 0 to 4096. &nbsp;</div><div><br></div><div>I looked at the code called decodeEel.C, which is the code that extracts the ADC values from the CODA data, and I see that indeed, to extract the actual ADC value, one does a bitwise AND with the mask "0xFFF", as one might expect would be correct. &nbsp;But, this does not recognize the overflow bit. &nbsp;So, I changed this to be a bitwise AND with "0x1FFF", so that when there is an overflow, it is put near channel 8192 (and the region just below that), so that now it is clearly separated from non-overflow events. &nbsp;</div><div><br></div><div>This fixes the problem completely, and now ADC overflow events are cleanly distinguished from non-overflow events. &nbsp;&nbsp;</div><div><br></div><div>Best,</div><div>E.</div><div><br></div><div></div></body></html>