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.

AFE4404: AFE4404 WITH EXTERNAL MCU & INTERNAL CLOCK MODE

Part Number: AFE4404


Hi,

I have AFE4404 EVM which is interfaced with K65 MCU from NXP. Sensor board comprising of SFH and NJ series is connected to AFE4404 EVM. To connect external MCU, I removed the following passives and took connections to external MCU as mentioned below. 

  • R7, R8  for SCL, SDA
  • R18 for ADC_RDY which is connected to a GPIO with falling interrupt
  • R15 for AFE_CLK
  • R16 for AFE_RSTZ

I could write as well as read registers via I2C to AFE4404 with this setup. I want to use AFE4404 in internal clock mode of 4MHz and PRF of 100Hz. To do the same, I wrote the following register configuration.

AFE4404_disable_read();        // disable read before configuration
  AFE4404_Reg_Write(PRPCT, 39999,AFE4404); //AFE_PRPCOUNT
  AFE4404_Reg_Write(LED2LEDSTC, 0,AFE4404);      //AFE_LED2LEDSTC
  AFE4404_Reg_Write(LED2LEDENDC, 0,AFE4404);   //AFE_LED2LEDENDC
  AFE4404_Reg_Write(LED2STC, 0,AFE4404);     //AFE_LED2STC
  AFE4404_Reg_Write(LED2ENDC, 0,AFE4404);    //AFE_LED2ENDC
  AFE4404_Reg_Write(ADCRSTSTCT0, 0,AFE4404);   //AFE_ADCRSTSTCT0
  AFE4404_Reg_Write(ADCRSTENDCT0, 6,AFE4404);   //AFE_ADCRSTENDCT0
  AFE4404_Reg_Write(LED2CONVST, 7,AFE4404);   //AFE_LED2CONVST
  AFE4404_Reg_Write(LED2CONVEND, 7,AFE4404);  //AFE_LED2CONVEND
  AFE4404_Reg_Write(LED3LEDSTC, 0,AFE4404);   //AFE_LED3LEDSTC
  AFE4404_Reg_Write(LED3LEDSTC, 0,AFE4404);   //AFE_LED3LEDENDC
  AFE4404_Reg_Write(ALED2STC, 0,AFE4404);  //ALED2STC
  AFE4404_Reg_Write(ALED2ENDC, 0,AFE4404);  //ALED2ENDC
  AFE4404_Reg_Write(ADCRSTSTCT1, 8,AFE4404);  //ADCRSTSTCT1
  AFE4404_Reg_Write(ADCRSTENDCT1, 14,AFE4404);  //ADCRSTENDCT1
  AFE4404_Reg_Write(ALED2CONVST, 15,AFE4404);    //ALED2CONVST
  AFE4404_Reg_Write(ALED2CONVEND, 15,AFE4404);   //ALED2CONVEND
  AFE4404_Reg_Write(LED1LEDSTC, 14,AFE4404);    //LED1LEDSTC
  AFE4404_Reg_Write(LED1LEDENDC, 413,AFE4404);   //LED1LEDENDC
  AFE4404_Reg_Write(LED1STC, 94,AFE4404);  //LED1STC
  AFE4404_Reg_Write(LED1ENDC, 413,AFE4404);  //LED1ENDC
  AFE4404_Reg_Write(ADCRSTSTCT2, 415,AFE4404);  //ADCRSTSTCT2
  AFE4404_Reg_Write(ADCRSTENDCT2, 421,AFE4404);  //ADCRSTENDCT2
  AFE4404_Reg_Write(LED1CONVST, 422,AFE4404);  //LED1CONVST
  AFE4404_Reg_Write(LED1CONVEND, 881,AFE4404);  //LED1CONVEND
  AFE4404_Reg_Write(ALED1STC, 493,AFE4404);  //ALED1STC
  AFE4404_Reg_Write(ALED1ENDC, 812,AFE4404);  //AFE_ADCRSTENDCT3
  AFE4404_Reg_Write(ADCRSTSTCT3, 883,AFE4404);  //ADCRSTSTCT3
  AFE4404_Reg_Write(ADCRSTENDCT3, 889,AFE4404);  //ADCRSTENDCT3
  AFE4404_Reg_Write(ALED1CONVST, 890,AFE4404);  //ALED1CONVST
  AFE4404_Reg_Write(ALED1CONVEND, 1349,AFE4404);  //ALED1CONVEND
  AFE4404_Reg_Write(PDNCYCLESTC, 2149,AFE4404);  //PDNCYCLESTC
  AFE4404_Reg_Write(PDNCYCLEENDC, 39199,AFE4404);  //PDNCYCLEENDC
    
  AFE4404_Reg_Write(TIMER_ENABLE, 0x000003,AFE4404);       //AFE_CONTROL1 TimerEN = 1; NUMAV =3
  AFE4404_Reg_Write(TIA_GAIN_ADJUSTMENT, 00,AFE4404);      //AFE_TIA_SEP_GAIN (LED2) ENSEPGAIN = 1; LED2/LED3 gain = 50K
  AFE4404_Reg_Write(PROG_TIME_GENERATOR, 3,AFE4404);       //PROG_TIME_GENERATOR
  AFE4404_Reg_Write(ILED_ADJUSTMENT, 0x3FFFF,AFE4404);     //ILED_ADJUSTMENT
  AFE4404_Reg_Write(PDN_AFE, 0x20200,AFE4404);  //DYN1, LEDCurr, DYN2, OSC, DYN3, DYN4 //0x000200); - 0x200 Osc mode //AFE_CONTROL2
 
  AFE4404_Reg_Write(LED2VAL, 0,AFE4404);   //LED2VAL
  AFE4404_Reg_Write(ALED2VAL, 0,AFE4404);   //ALED2VAL
  AFE4404_Reg_Write(LED1VAL, 0,AFE4404);   //LED1VAL
  AFE4404_Reg_Write(ALED1VAL, 0,AFE4404);   //ALED1VAL
  AFE4404_Reg_Write(LED2_ALED2VAL , 0,AFE4404);   //LED2-ALED2VAL
  AFE4404_Reg_Write(LED1_ALED1VAL, 0,AFE4404);   // LED1-ALED1VAL 

I want to acquire ppg data from chest, finger and wrist using AFE4404 and sensor board. Kindly help me with the configuration and let me know where I am going wrong.
 Till now I have tried the configurations mentioned in pages 26,27 of AFE4404 data sheet as well as the one led configuration mentioned in https://e2e.ti.com/support/applications/medical/f/30/p/546473/1994236#1994236.

  1. No ADC_RDY interrupt happens, when I try reading registers from 2A to 2F, it comes as 0x0, I can read back all other registers
  2.  Is there anything else which needs to be done while using internal clock mode?
  3. Do we have to give 2-5us pulse at AFE_RSTZ after register configuration?

  • Hi Annamol,

    You are missing the TIMEREN bit, here is the correct one.

    AFE4404_Reg_Write(TIMER_ENABLE, 0x000103,AFE4404);       //AFE_CONTROL1 TimerEN = 1; NUMAV =3

    Also, you shouldn't write the output registers (i.e. 0x2A to 0x2F).

    No, you don't need pulse at AFE_RSTZ pin after register configuration.

     

    Regards,

    Prabin.

  • Hi,

    Thanks for pointing it out.  I am waiting for ADC_RDY interrupt to happen in a while(1) loop and trying to read registers from 0x2A to 0x2F. It comes as 0x00 and interrupt doesn't get fired.

      
        while(1)
        {
          
          memset(AFE44xx_SPO2_Data_buf,0x00,sizeof(AFE44xx_SPO2_Data_buf));          
        
         if(adc_read_flag)
          {
            adc_read_flag =0;
            AFE44xx_SPO2_Data_buf[2]= AFE4404_Reg_Read(42,AFE4404,3);
            AFE44xx_SPO2_Data_buf[3]=AFE4404_Reg_Read(43,AFE4404,3);

           AFE44xx_SPO2_Data_buf[0]=AFE4404_Reg_Read(45,AFE4404,3);

           AFE44xx_SPO2_Data_buf[1]=AFE4404_Reg_Read(44,AFE4404,3);
           AFE44xx_SPO2_Data_buf[4]= AFE4404_Reg_Read(46,AFE4404,3);
         }
          
        }

    void adc_ready_isr(void *pin)
    {
        lwgpio_int_clear_flag((LWGPIO_STRUCT_PTR) pin);
        adc_read_flag = 1;  
    }

  • Hi Annamol,

    Following are the points I could think for no ADC_RDY interrupt.
    1) AFE4404 might not be generating the ADC_RDY because of bad register settings. To rule out this cause, remove the connection of ADC_RDY to MCU and write all you setting then probe the ADC_RDY. You should see the pulse wave.
    2) MCU might not detect the ADC_RDY because of different logic level of AFE4404 and MCU. Check IO_SUP of AF4404 and supply of MCU.
    3) MCU might be driving the pin where ADC_RDY is connected. Make that pin as input pin.

    Let us know if this helps.

    Regards,
    Prabin
  • Hi,

    I have already probed ADC_RDY with the same register settings after removing connection with MCU, but there is no pulse.
    MCU pin where ADC_RDY is connected, is configured as INPUT


    I will change register configurations again to see if there is any change
  • Hi,

    Yes, you can try the register settings given in the datasheet.

    Regards
    Prabin