Calibrating the eQADC module of the Freescale MCP5510 Microcontroller Family 1/2
eQADC stands for Enhanced Queued Analog-to-Digital Converter, and this is the name of the ADC module integrated in the MCP5510 Family microcontrollers. As a hardware engineer, I was more used to the simple 10bit ADC which are usually found in lower end 8-bit microcontrollers (like the PIC18 series, for instance). The first time I came across a MPC5517 from Freescale, however, I was baffled by the need to calibrate the eQADC module, which would otherwise be affected by large errors.
When properly configured, the eQADC performs accurate and fast conversions. The module is built around a 12-bit ADC we will see further in this article, most of the time the result is 14-bit (when properly calibrated and formatted).
A block diagram of the eQADC module is visible below, detailing the main components:
It is quite a complex module, capable of performing many types of special operations based on prioritized commands. It is also capable of DMA transactions, supporting software and external hardware triggers. But most important of all, it is capable of automatically providing calibrated results, based on two coefficients determined during a calibration routine which is to be run at start-up.
The image below illustrates two things: the ideal transfer function of a 12-bit ADC module, in green, and the real transfer function of an eQADC which was not yet calibrated, in red (it was exaggerated for better viewing, in reality the two curves are much closer to each other).
If the appropriate calibration routine is performed at start-up, the eQADC module is capable of automatically transforming a value from the red line to its corresponding value from the green line. As most registers of the MPC5517 family, the register containing the result of the conversion is a 16-bit register. When the conversion is performed, it will contain the conversion result data, formatted to 14-bit and right justified. The result can be calibrated or not, according the status of the CAL bit in the command that initiated the conversion.
But why 14 bits and not 12 bits? When CAL=0 the 14 bits are simply obtained by shifting the 12-bit conversion result by 2 positions to the left. Hence the last two bits will not be significant.
When CAL=1, the 14-bit data results from some calculations performed by the eQADC module on the 12-bit result, calculations which are performed in the MAC (Multiply and Accumulate) unit of the eQADC and which use two calibration constants which would be determined during the start-up calibration routine (GCC – Gain Calibration Constant and OCC – Offset Calibration Constant). Once the calibrated result is obtained, if the eQADC module is properly set, it will zero-extend the 14-bit result to 16 bit filling the entire register:
The errors which affect the uncalibrated result of the ADC are gain and offset type of errors. Fortunately, they can be compensated by calibration.
- brumbarchris's blog
- 523 reads



Post new comment