This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AFE4300: AFE4300 calibration routine

Part Number: AFE4300

Hey everyone,

still having problems with calibration of AFE4300. Gonna measure impedance in FWR mode, my schematic has 2 references resistors, 99.7 Ohms and 997 Ohms.

When my afe4300 starts, I prepare registers to calibrate the board

write_register(ADC_CONTROL_REGISTER1,0x4120); //Differential measurement mode, 32 SPS
write_register(MISC_REGISTER1,0x0000);
write_register(MISC_REGISTER2,0xFFFF);
write_register(DEVICE_CONTROL1,0x6006); //Power up BCM signal chain

write_register(VSENSE_MUX,0x0201); //VSENSERN0 - VSENSERP1
write_register(VSENSE_MUX,0x0202); //VSENSERN1 - VSENSERP1

write_register(ISW_MUX,0x0408); //VSENSEP0 - VSENSEN1
write_register(ISW_MUX,0x0408); //IOUTP0 - IOUTN1

write_register(IQ_MODE_ENABLE,0x0000);
write_register(WEIGHT_SCALE_CONTROL,0x0000);
write_register(BCM_DAC_FREQ,0x0020); //0x0040
write_register(DEVICE_CONTROL2,0x0000);
write_register(ADC_CONTROL_REGISTER2,0x0063); //ADC selects output of BCM-I output
write_register(MISC_REGISTER3,0x0030);

How can I get the ADC code of each references resistor?

I guess I need to read_register(ADC_DATA_RESULT) twice, but where I have to put it? After the 1st ISW_MUX and the 2nd ISW_MUX?

  • Hello Ivan,

    Below is one example of pseudo code. You could implement it as a state machine.

    /* State 1 - AFE configuration */
    write_register(ADC_CONTROL_REGISTER1,0x4120); //Differential measurement mode, 32 SPS
    write_register(MISC_REGISTER1,0x0000);
    write_register(MISC_REGISTER2,0xFFFF);
    write_register(MISC_REGISTER3,0x0030);
    write_register(IQ_MODE_ENABLE,0x0000);
    write_register(WEIGHT_SCALE_CONTROL,0x0000);
    write_register(BCM_DAC_FREQ,0x0020); //0x0040
    write_register(DEVICE_CONTROL2,0x0000);
    write_register(ADC_CONTROL_REGISTER2,0x0063); //ADC selects output of BCM-I output
    write_register(DEVICE_CONTROL1,0x6006); //Power up BCM signal chain

    /* State 2 - Reference resistor1 measurement */
    write_register(VSENSE_MUX,0x0201); //VSENSERN0 - VSENSERP1
    write_register(ISW_MUX,0x0201);
    // Insert wait time to allow the signal to settle
    // use the interrupt signal to capture data points from AFE (read ADC_DATA_RESULT register)
    // Take average of the data points collected

    /* State 3 - Reference resistor2 measurement */
    write_register(VSENSE_MUX,0x0202); //VSENSERN1 - VSENSERP1
    write_register(ISW_MUX,0x0202);
    // Insert wait time to allow the signal to settle
    // use the interrupt signal to capture data points from AFE (read ADC_DATA_RESULT register)
    // Take average of the data points collected

    // calculate gain and offset from the reference resistors

    /* State 4 - Unknown impedance measurement */
    write_register(VSENSE_MUX,0x0408); //VSENSEP0 - VSENSEN1
    write_register(ISW_MUX,0x0408); //IOUTP0 - IOUTN1
    // Insert wait time to allow signal to settle
    // use the interrupt signal to capture data points from AFE (read ADC_DATA_RESULT register)
    // Take average of the data points collected

    // Calculate the impedance using gain and offset from calibration.
  • Hey Praveen, thank you for your reply.
    When I use DRDY interruption the pin (DRDY) is changing very fast, should I stop something? For example, another IC of TI (ads12xx) has a special register STOP, which must be written when DRDY is changed and data is ready.

    without interruption I got slope about 0.062354 and very large offset ~110, my resistors are 99.7 Ohms and 997 Ohms.
    Also my measurement of RC network (556 Ohm and 0.1 uF) shows different % of error, I do 5 measurement and the result is in range (5, 100) % (yes, I use slope and offset)

    If I wanna use IOUT0 and IOUT1 for current injection and VSENSE0 and VSENSE1 for receiving current, should I write 0x0408 to VSENSE_MUX and ISW_MUX?

    According to datasheet it routes signal from VSENSEP0 to VSENSEN1 (IOUTP0 to IOUTN1), is it correct? Why N1 and not N0?   Because there are used 2 pairs of electrodes, which are connected to channel 0 and 1

    UPD: To be sure, that my chip works correctly, I wrote 0x0065 to enable Weight scale mode and I got 1.7V of VLDO pin (seems to be so), how to accurate output data, to get less % of error (like in this document, where the error is less then 1%)

  • Added 2 more resistors for feedback chain, so now I have 4 feedback's resistors (each one is 10M) : RP0-RN1, RP0-RN0, RP1-RN1, RP1-RN0.
    But it doesn't help, the error is about 10% for 50kHz. What else do I need to improve to get error less then 1%?