Hallo zusammen, habe ein Problem mit einer externen Referenzspannung an einem ATxmega128A1 für den ADC. Ich lege über einen Spannungsteiler eine Referenzspannung von 2.5V an VREF+ und Ground an VREF-. Leider bricht mir die Spannung immer ein auf ca 100mV am VREF+. Den Querstrom habe ich von 3 bis 10 mA varriert aber keine Veränderung. VCC ist 3.3V. Hätte einer mal eine Idee worna das liegen könnte? Mein code ist meiner Meinung nach richtig
1 | .
|
2 | .
|
3 | // ADCA is enabled
|
4 | // Resolution: 12 Bits
|
5 | // Load the calibration value for 12 Bit resolution
|
6 | // from the signature row
|
7 | ADCA.CALL=read_calibration_byte(PROD_SIGNATURES_START+ADCACAL0_offset); |
8 | ADCA.CALH=read_calibration_byte(PROD_SIGNATURES_START+ADCACAL1_offset); |
9 | |
10 | // Free Running mode: Off
|
11 | // Conversion mode: Signed
|
12 | ADCA.CTRLB=(ADCA.CTRLB & (~(ADC_CONMODE_bm | ADC_FREERUN_bm | ADC_RESOLUTION_gm))) | |
13 | ADC_CONMODE_bm | ADC_RESOLUTION_12BIT_gc; |
14 | |
15 | // Clock frequency: 62,500 kHz
|
16 | ADCA.PRESCALER=(ADCA.PRESCALER & (~ADC_PRESCALER_gm)) | ADC_PRESCALER_DIV512_gc; |
17 | |
18 | // Reference: AREF pin on PORTA
|
19 | // Temperature reference: On
|
20 | ADCA.REFCTRL=(ADCA.REFCTRL & ((~(ADC_REFSEL_gm | ADC_TEMPREF_bm)) | ADC_BANDGAP_bm)) | |
21 | ADC_REFSEL_AREFA_gc | ADC_TEMPREF_bm; |
22 | |
23 | // Read and save the ADC offset using channel 0
|
24 | ADCA.CH0.CTRL=(ADCA.CH0.CTRL & (~(ADC_CH_START_bm | ADC_CH_GAINFAC_gm | ADC_CH_INPUTMODE_gm))) | |
25 | ADC_CH_GAIN_1X_gc | ADC_CH_INPUTMODE_DIFF_gc; |
26 | ADCA.CH0.MUXCTRL=(ADCA.CH0.MUXCTRL & (~(ADC_CH_MUXPOS_gm | ADC_CH_MUXNEG_gm))) | |
27 | ADC_CH_MUXPOS_PIN0_gc | ADC_CH_MUXNEG_PIN0_gc; |
28 | // Enable the ADC in order to read the offset
|
29 | ADCA.CTRLA|=ADC_ENABLE_bm; |
30 | // Insert a delay to allow the ADC common mode voltage to stabilize
|
31 | delay_us(2); |
32 | // Perform several offset measurements and store the mean value
|
33 | .
|
34 | .
|
35 | .
|

