I have the analog section set to 10 bits, but something strange is happening that I can't explain.
I have an analog input that I set to give an output via USB to approximately 2048. Now there is some noise at the input, so the output dithers about ±5 counts.
However, after running for a period of time I see a significant jump where the output is 2303 (0x8FF) or 1792 (0x700). The input noise isn't the issue. The jump is 256 counts.
That tells me that a most significant bit is either getting set or cleared when it shouldn't. At least that is how it manifests itself.
I thought the A to D was on a 16-bit data buss or is it 8 bits and the processor does multiple reads to get the data?
I can see the latter case as a possibility if the conversion takes place somehow between a read of the least significant byte and the most significant byte and if the input transitions from 2047 to 2048 (or vice versa).
Not saying that is what is happening, but it appears that way. Anyone has an idea why this happens?
Main.cpp included:
I have an analog input that I set to give an output via USB to approximately 2048. Now there is some noise at the input, so the output dithers about ±5 counts.
However, after running for a period of time I see a significant jump where the output is 2303 (0x8FF) or 1792 (0x700). The input noise isn't the issue. The jump is 256 counts.
That tells me that a most significant bit is either getting set or cleared when it shouldn't. At least that is how it manifests itself.
I thought the A to D was on a 16-bit data buss or is it 8 bits and the processor does multiple reads to get the data?
I can see the latter case as a possibility if the conversion takes place somehow between a read of the least significant byte and the most significant byte and if the input transitions from 2047 to 2048 (or vice versa).
Not saying that is what is happening, but it appears that way. Anyone has an idea why this happens?
Main.cpp included: