I am using an MKE18F512VLH16 MCU at 250MHz. I have a set up where I use eDMA to collect samples from the ADC, and stuff them into an array for processing later on.
I calibrate the ADC at least once on every start up using the auto calibration function. However, it would be beneficial if I could manually update the cal coefficients while the system is running. I have a function that will receive these coefficients over a CAN bus, and writes the values into the registers. After I receive the values that need to be written, I put them through a range check. If they pass the check, I commit them to the ADC. Currently the registers that I am writing to are: CLPS, CLP0, CLP1, CLP2, CLP3, CLP9, CLPX, OFS, and G.
I am simply just writing to the registers, and letting the system resume its normal actions. However, when I try writing to the registers, the system does not behave correctly. Without getting too much into the nitty gritty details of the code, the DMA channel that collects the ADC samples is supposed to interrupt after so many samples are collected. This is where I run into issues.
I am wondering if simply writing to registers and resuming normal operations is sufficient enough for re-calibrating the ADC? If there is a guide that I can use to help me with this, that would also be helpful. I have read App Note 2989(Design, Accuracy, and Calibration of Analog to Digital Converters on the MPC5500 Family), and App Note 5314(ADC Calibration on Kinetis E+ Microcontrollers). Didn't really get too much out of it.
Any help is appreciated. Thank you.