Hi Ryan,
Today, I do a test with TRK-KEA64 board with bandgap measurement.
My test result the ADC_R register value is within [0x3bb ~ 0x3bf] range.
Below is my ADC initialization code, which I use slow ADCK clock and use long sample time:
#define TWELVE_BIT 2
ADC_Init(23,TWELVE_BIT); /* Configure ADC channel 3 in 8-bit resolution mode */
/***********************************************************************************************
*
* @brief ADC_Init - Initiates the Channeln to read the value of the ADC channel
*
* @param Channel to init and resolution
* @return none
*
************************************************************************************************/
void ADC_Init(UINT8 channel, UINT8 mode)
{
SIM_SCGC |= SIM_SCGC_ADC_MASK; /* Enable bus clock in ADC*/
ADC_SC3 |= ADC_SC3_ADICLK(0b00); /* Bus clock selected*/
ADC_SC2 |= 0x00; /* Software Conversion trigger, disable compare function*/
ADC_SC2 |=ADC_SC2_REFSEL(0b01); /* Select VDD and VSS as voltage reference source*/
ADC_SC1 = 0 ; /* Enable ADC by setting ADCH bits as low*/
ADC_SC1|= ADC_SC1_ADCO_MASK; /* Continuous mode operation */
ADC_APCTL1 |= ADC_APCTL1_ADPC(1<<channel); /* Channel selection */
ADC_SC3 |= ADC_SC3_MODE(mode); /* 8,10,12 bit mode operation */
ADC_SC3 |= ADC_SC3_ADLSMP_MASK | ADC_SC3_ADICLK(1) |ADC_SC3_ADIV(3);
}
The ADC module is using VDDA and VSSA as reference voltage. I measure the TRK-KEA63 VDDA voltage is about 4.88V.
Then, the measured Bandgap voltage is about 1.143V.
Wish it helps.
best regards
Ma Hui
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------