Self-diagnostic test for the ADC, DAC and analog multiplexer.
A plausibility check is done to make sure that ADC, DAC and analog multiplexer work correctly. The test is implemented in classb_analog_io_test() and consists of the following steps:
If the measured values deviate from the expected values more than the threshold configured with CLASSB_ADC_DEV, the test calls the error handler CLASSB_ERROR_HANDLER_ANALOG().
The test checks one ADC module and one DAC module at a time, i.e., it has to be repeated until all modules are tested. Further, the ADC module to test must be able to read from the DAC module it is tested together with.
Functions | |
void | classb_analog_io_test (DAC_t *dacptr, ADC_t *adcptr) |
Functional test for the ADC, DAC and analog MUX. More... | |
Internal settings | |
#define | CLASSB_ADC_DEV 0x40 |
Maximum allowed absolute deviation for test measurements. More... | |
#define CLASSB_ADC_DEV 0x40 |
Maximum allowed absolute deviation for test measurements.
Error offset for the ADC is +-2mV, which corresponds to +-0x40 when the reference is 1V and TOP
is 2047
.
Referenced by classb_dac_adc_test().
void classb_analog_io_test | ( | DAC_t * | dacptr, |
ADC_t * | adcptr | ||
) |
Functional test for the ADC, DAC and analog MUX.
This function configures the DAC to output five different voltages, which are each measured with the ADC using 12-bit resolution, signed conversion and 1V voltage reference.
Range checking of the conversion results is done to verify that ADC and DAC are working correctly.
dacptr | Base address for registers of DAC module to test. |
adcptr | Base address for registers of ADC module to test. |
References classb_dac_adc_test().
Referenced by oven_classb_run_tests().