Hello All.
I am testing the AFE 24 bits and it is working but.
I short circuit the ADP0 and ADM0 and get readings of -48000 the readings are steady they are not varying a lot.
Is that normal this offset?
the clock i am using is 4MHz internal.
void Configura_Afe_24bits(void)
{
SIM_SCGC6 |= (SIM_SCGC6_AFE_MASK); //habilita modulo AFE 24 bits
SIM_SCGC4 |= SIM_SCGC4_VREF_MASK; // HABILITA PERIFERICO GERADOR DE REFERENCIA
VREF_VREFH_SC = VREF_VREFH_SC_VREFEN_MASK + VREF_VREFH_SC_REGEN_MASK
+ VREF_VREFH_SC_ICOMPEN_MASK + VREF_VREFH_SC_MODE_LV(1);
AFE_CH0_CFR = ( AFE_CFR_DEC_OSR(5)
+ AFE_CFR_PGA_EN_MASK
+ AFE_CFR_PGA_GAIN_SEL(1)
+ AFE_CFR_BYP_MODE(0)
+ AFE_CFR_SD_MOD_EN_MASK
+ AFE_CFR_DEC_EN_MASK
+ !AFE_CFR_CC_MASK
+ AFE_CFR_DEC_CLK_EDGE_SEL(0)
+ AFE_CFR_DEC_CLK_INP_SEL(0)
+ !AFE_CFR_HW_TRG_MASK
);
AFE_CH1_CFR = AFE_CH0_CFR;
AFE_CH2_CFR = AFE_CH0_CFR;
AFE_CH3_CFR = AFE_CH0_CFR;
AFE_CR = ( AFE_CR_MSTR_EN_MASK
+ !AFE_CR_LPM_EN_MASK
+ AFE_CR_RST_B_MASK
+ !AFE_CR_DLY_OK_MASK
+ AFE_CR_RESULT_FORMAT_MASK
+ AFE_CR_STRTUP_CNT(0)
);
}
void Ler_Afe_Adc(void)
{
AFE_CR |= AFE_CR_SOFT_TRG0_MASK;
while((AFE_SR & AFE_SR_COC0_MASK)==0)
{
}
resultado = AFE_CH0_RR;
}
Hi all.
I am keeping studying this Analog front end and know i got better measures changing the Vref settings
VREF_VREFH_TRM |= VREF_VREFH_TRM_CHOPEN_MASK;
VREF_VREFH_SC = VREF_VREFH_SC_VREFEN_MASK + VREF_VREFH_SC_REGEN_MASK
+ VREF_VREFH_SC_ICOMPEN_MASK + VREF_VREFH_SC_MODE_LV(1);
My problem now is that i can't find the Input impedance and i think i will have to use an external buffer to get measures.
As an example if i use a 50R to short circuit the +-input i got 0.0012V offset if i use a 4700R i get 0.088V if i turn the PGA on the results are even worse.
Does anyone know what is the input impedance for this AFE? i was not able to find the information.
thanks.
Hi, Edriano,
i do not think the result -48000 is normal, how about connect both ADP0 and ADM0 to GND so that the common mode voltage is zero, then have a test.
I will test your code on my tower board and give your my test result next week.
BR
Xiangjun Rong
Hi Xiangjun Rong.
I did that and the value decrease to -30000.