AnsweredAssumed Answered

lwadc calibration procedure

Question asked by Goncalo Andre on Dec 5, 2016
Latest reply on Dec 6, 2016 by Daniel Chen


I am trying to use the lwadc api provided with MQX 4.2.0 to read some analog inputs on the Freescale K60, but the documentation is a bit scarce and I have some doubts regarding the calibration function. I am basing myself on the sample code to read the potentiometer provided with mqx.

-Here is recommended to run the calibration procedure using ioctl, but the lwadc does not use file handles. So where should I get this file handler to each adc channel? Can't I just read/write the register (in this case bit CAL on ADCx_SC3) myself?

-Why does the sample aplication have no calibration procedure? Isn't is allways needed?

-When should I do the calibration? After _lwadc_init() and before _lwadc_init_input()?


Thanks in advance.