18
PowerCore FLEX
3.2.2 A/D Converter
The following sample programs can be found in the SAMPLES\PowerCoreFLEX\ADC
folder.
ADC_CALIB_EXTERNAL.c
—Demonstrates how to calibrate an external A/D channel
using two known voltages to generate two coefficients, gain and offset, which will be
written to the simulated EEPROM in the flash memory. The program will then display
the voltage that has been calibrated.
In order to run this sample program, you will need a separate power supply. Connect
the positive lead from the power supply to the A/D channel input located on pin 7 of
header J3 on the Prototyping Board. Connect the negative lead from the power supply
to the GND located on pin 8 of J3 on the Prototyping Board.
ADC_CALIB_RAMP.c
—Demonstrates how to calibrate the A/D ramp-generator circuit.
The A/D ramp-generator circuit is calibrated using the 2.5 V voltage reference and the
end-of-ramp voltage point located on the PowerCore module. The calibration constants
generated by this sample program will be written to the simulated EEPROM in the
flash memory, and can then be used to calculate the voltage for the following A/D
channels.
Channel 0—2.5 V reference voltage
Channel 1—end-of-ramp voltage
Channel 2—thermistor
The program will then display the voltage of these A/D channels.
In order to run this sample program, you will need a voltmeter to measure the A/D 2.5 V
voltage reference at TP10 and the end-of-ramp voltage at TP9; both test points are
located between header J4 and the edge on the bottom side of the PowerCore module.
NOTE: The above sample programs will overwrite any existing calibration constants.