Yes, this is exactly what I thought; my VREFL = 0V, and VREFH = 3V DC. I am wondering if there is anything in my setup causing the results to be divided by two.
My ADC configuration is as follows:
{
ADC_CFG1_REG(pBase) = ADC_CFG1_ADIV(3) | ADC_CFG1_MODE(3) | ADC_CFG1_ADICLK(0); // divide clock by 8, 16-bit mode, select bus clock as input
//ADC_CFG2_REG(pBase) = ADC_CFG2_ADHSC_MASK; // 2 ADCK cycles added to the conversion time to allow for higher speed clocks
ADC_SC2_REG(pBase) = ADC_SC2_DMAEN_MASK; // enable DMA trigger
ADC_SC3_REG(pBase) = ADC_SC3_ADCO_MASK; // continuous mode
ADC_SC1_REG(pBase,0) = ADC_SC1_DIFF_MASK| ADC_SC1_ADCH(signal);// select differential mode, and correct signal channel
}
The DMA is configured as follows:
disable_int(INT); // not ready for this interrupt yet. Plug vector first.
DMA_CR = DMA_CR_GRP0PRI_MASK; //writes to the CR register must be performed when the DMA channels are inactive, that is when TCDn_CSR[ACTIVE] bits are cleared
DMA_SOFF_REG(DMA_BASE_PTR,number) = 0;
DMA_ATTR_REG(DMA_BASE_PTR,number) = DMA_ATTR_SMOD(0) // Source address module disabled
| DMA_ATTR_SSIZE(1) // 16-bit source data transfer size
| DMA_ATTR_DMOD(0) // Destination address module disabled
| DMA_ATTR_DSIZE(1); // 16-bit destination data transfer size
DMA_NBYTES_MLNO_REG(DMA_BASE_PTR,number) = 2; // Minor byte transfer count (on minor loop mapping is disabled)
DMA_SLAST_REG(DMA_BASE_PTR,number) = 0; // Last source address adjustment
DMA_DOFF_REG(DMA_BASE_PTR,number) = 2; // Destination address signed offset
DMA_DLAST_SGA_REG(DMA_BASE_PTR,number) = 0; // Adjustment value added to the destination address at the completion of the major iteration count
if(number <16){
DMAMUX0_CHCFG(number) = DMAMUX_CHCFG_ENBL_MASK | DMAMUX_CHCFG_SOURCE(40+number);
}else{
DMAMUX1_CHCFG(number-16) = DMAMUX_CHCFG_ENBL_MASK | DMAMUX_CHCFG_SOURCE(40+(number-16));
}
enable_int(INT); // Enable DMA1 interrupt