I've got a couple of old teensy 3.2s around and I'm trying to use them to read some voltages. I've just run the example sketch internal_reference and I'm getting some strange results. I've measured between 3.3v and AGND and modified the value to be 3.33v in the code. Here are the results:
The diff voltage seems to drift around wildly, it almost always gets to the 100th iteration (not in this one case for brevity) and the diff can be upwards of 800mV. The measured 3.3v value also seems to fluctuate, I've seen it go between 5.2v and 2.1v. What could possibly be causing this? I have two 3.2s and both of them give similar results. They have both been used in other projects but it seems unlikely they've both been damaged in the same way.
Code:
niter, a, b, midpoint, diff (mV)
0, 0, 63, 31, 196.81
1, 31, 63, 47, 97.74
2, 47, 63, 55, 59.85
3, 55, 63, 59, 60.31
4, 59, 63, 61, 94.19
5, 61, 63, 62, 75.98
6, 62, 63, 62, 47.30
7, 62, 63, 62, 74.15
8, 62, 63, 62, 49.15
9, 62, 63, 62, 75.26
10, 62, 63, 62, 65.49
11, 62, 63, 62, 70.65
12, 62, 63, 62, 123.23
13, 62, 63, 62, 25.31
14, 62, 63, 62, 103.12
15, 62, 63, 62, 107.12
16, 62, 63, 62, 19.62
17, 62, 63, 62, 115.11
18, 62, 63, 62, 75.85
19, 62, 63, 62, 9.32
20, 62, 63, 62, 40.21
21, 62, 63, 62, 96.67
22, 62, 63, 62, 122.39
23, 62, 63, 62, 121.45
24, 62, 63, 62, 119.25
25, 62, 63, 62, 124.61
26, 62, 63, 62, 12.05
27, 62, 63, 62, 19.35
28, 62, 63, 62, 63.36
29, 62, 63, 62, 109.95
30, 62, 63, 62, 35.74
31, 62, 63, 62, 85.34
32, 62, 63, 62, 57.38
33, 62, 63, 62, 130.82
34, 62, 62, 62, 87.44
Optimal trim value: 62
3.3V pin value: 3.43108 V.
Bandgap value: 0.99792 V. (Should be between 0.97 and 1.03 V.)
3.3V pin value: 3.05212 V.
3.3V pin value: 3.02360 V.
3.3V pin value: 3.47785 V.
3.3V pin value: 3.12794 V.
3.3V pin value: 3.19468 V.
3.3V pin value: 3.00158 V.
3.3V pin value: 3.33352 V.
3.3V pin value: 3.00562 V.
3.3V pin value: 3.61679 V.
3.3V pin value: 3.68001 V.
3.3V pin value: 3.10439 V.
3.3V pin value: 3.77255 V.
3.3V pin value: 3.27442 V.
3.3V pin value: 3.13333 V.
3.3V pin value: 3.96769 V.
3.3V pin value: 3.41462 V.
The diff voltage seems to drift around wildly, it almost always gets to the 100th iteration (not in this one case for brevity) and the diff can be upwards of 800mV. The measured 3.3v value also seems to fluctuate, I've seen it go between 5.2v and 2.1v. What could possibly be causing this? I have two 3.2s and both of them give similar results. They have both been used in other projects but it seems unlikely they've both been damaged in the same way.