Tool/software: Code Composer Studio
Dear team
My customer used the following code to do DAC calibration. But it failed. Please help.
DAC12_0CTL_bit.DAC12ENC = 0u; // DAC12 is disabled
DAC12_1CTL_bit.DAC12ENC = 0u; // DAC12 is disabled
// Reset the control registers to thier default power-up states.
DAC12_0CTL = 0x0000u;
DAC12_1CTL = 0x0000u;
DAC12_1CTL_bit.DAC12OPS = 0u; // outputs: DAC0 = P6.6, DAC1 = P6.7
DAC12_1CTL_bit.DAC12SREFx = 2u; // DAC reference = eVref+
DAC12_1CTL_bit.DAC12RES = 0u; // 12-bit resolution
DAC12_1CTL_bit.DAC12LSELx = 0u; // DAC12 values loaded immediately
DAC12_1CTL_bit.DAC12IR = 1u; // DAC output at 1X reference input
DAC12_1CTL_bit.DAC12AMPx = 7u; // In/out buffers = high speed/current
DAC12_1CTL_bit.DAC12DF = 0u; // staright binary data (0 to 0xFFFF)
DAC12_1CTL_bit.DAC12IE = 0u; // DAC12 interrupts disabled
DAC12_1CTL_bit.DAC12IFG = 0u; // clear any existing flags
DAC12_1CTL_bit.DAC12GRP = 0u; // DAC outputs are not grouped
DAC12_1DAT = 0u; // Set initial output = 0V
DAC12_1CTL_bit.DAC12ENC = 1u; // DAC12 is enabled
DAC12_1CTL_bit.DAC12CALON = 1u; // Initiate DAC12 Calibration
// Wait for calibration complete. bit will automatically reset
do {TEST_HARNESS_TICK;} while(1u == DAC12_1CTL_bit.DAC12CALON);
So What may be cause the problem? Is the output pin voltage of DA inconsistent?
After jumping from the boot to the main program, the DAC calibration will fail probabilistically and is related to the board. Some boards will appear, and some will not appear thousands of times.
Any suggestions?