ADPD144RI - SPO2 data read EXAMPLE

Please share an example code for ADPD144RI read data from ESP32 or Arduino

Parents
  • 0
    •  Analog Employees 
    on Jul 29, 2021 12:38 AM

    Hi there,

    Please check the thread at the link below:

    https://ez.analog.com/optical_sensing/f/q-a/165141/adpd144ri-software-code-example

    Regards,

    Glen B.

  • Dear Glen, 

    I am writing on behalf of Suresh. The github link contains drivers for ADPD10X. It does not contain specifically for ADPD144. Please let us know if there is any other location where specific files for ADPD10X is placed. 

    In the meantime, We have tried to test our PCB with ADPD144. 

    We have programmed the register Setting values as suggested in the datasheet and also in engineering Zone forum link: (https://ez.analog.com/optical_sensing/f/q-a/165141/adpd144ri-software-code-example) have been used to program.

    Initially, We tried to read the reset values of each register. The values read matched with the expected values provided in Table-13 (Register Listing) of datasheet.

    We are using Poling method to read the data. Although, We have used the same register values as suggested in datasheet or Forum, The data observed in the data registers 0x64 to 0x7F are 0x0000.

    We also placed the finger on the ADPD1443I, the LED did not turn on also, the data registers still sshowed 0x00000

    We have followed the startup sequence suggested in the datasheet. Initially, register 0x10 is written 0x0001 during writing all the registers and later after all the registers are written, register 0x10 is written 0x0002 to enter into normal operation mode.

    The register values that we programmed and the values we readout are shown below.

    Reg name

    Register Address

    Programmed Values

    Read out Values

    Mode

    0x10

    0x00000001

     

    Mode read

    0x10

     

    0x00000001

    STATUS

    0x00

    0x00008000

     

    int mask

    0x1                                

    0x000000ff

     

    int io ctl

    0x2                                

    0x00000005

     

    fifo thresh

    0x6                                

    0x00000000

     

    STATUS

    0x00                         

    0x0000ff60

     

    ID

    0x08            

     

    0x00000416

    slot

    0x11                           

    0x000030a9

     

    fsample

    0x12                        

    0x0000000a

     

    led select

    0x14             

    0x00000116

     

    num avg

    0x15                    

    0x00000330

     

    ach1 0ff                      

    0x18

    0x00003fff

     

    ach2 0ff                      

    0x19

    0x00003fff

     

    ach3 0ff                      

    0x1a

    0x00001ff0

     

     ach4 0ff   

    0x1b                  

    0x00001ff0

     

     bch1 0ff                      

    0x1e

    0x00003fff

     

     bch1 0ff                      

    0x1f

    0x00003fff

     

    bch1 0ff                      

    0x20

    0x00001ff0

     

    bch1 0ff                      

    0x21

    0x00001ff0

     

     

    0x22                               

    0x00003000

     

    1coarse                       

    0x23

    0x00003005

     

    2coarse                     

    0x24  

    0x00003007

     

    ledfine                       

    0x25

    0x00000207

     

    a_m0de                        

    0x30

    0x00000319

     

    a_pulse                       

    0x31

    0x00000813

     

    leddis                        

    0x34

    0x00000000

     

     b_m0de                        

    0x35

    0x00000319

     

    b_pulse                       

    0x36

    0x00000813

     

    ext sync startup

    0x38                               

    0x00000000

     

     a_afe                         

    0x39

    0x000021f3

     

     b_afe                         

    0x3b

    0x000021f3

     

     

    0x3c                               

    0x00003006

     

     a_gain                        

    0x42

    0x00001c36

     

     a_afe_con             

    0x43

    0x0000ada5

     

    a_gain                        

    0x44

    0x00001c36

     

     b_afe_con             

    0x45                               

    0x0000ada5

     

     clk written           

    0x4b

    0x00000080

     

    clk read                      

    0x4b

     

    0x00000080

    alk adjust

    0x4d                               

    0x0000425e

     

     adc_tim                       

    0x4e

    0x00000040

     

    ext sync sel

    0x4f                               

    0x00002090

     

    cal enb

    0x50                               

    0x00000000

     

     

    0x52                               

    0x00000040

     

     

    0x54                               

    0x00000020

     

    tia gain

    0x55                               

    0x00000000

     

     

    0x5a                               

    0x00000010

     

    dataacc_ctl   

    0x5f

    0x00000000

     

    dataacc_ctl   

    0x5f

    0x00000006

     

    mode written  

    0x10

    0x00000002

     

    mode read 

    0x10                   

     

    0x00000002

    SL0TA_PD1_16BIT read

    0x64

     

    0x00000000

    SL0TA_PD2_16BIT read

    0x65

     

    0x00000000

    SL0TA_PD3_16BIT read

    0x66

     

    0x00000000

     SL0TA_PD4_16BIT read

    0x67

     

    0x00000000

    SL0TB_PD1_16BIT read

    0x68

     

    0x00000000

    SL0TB_PD2_16BIT read

    0x69

     

    0x00000000

    SL0TB_PD3_16BIT read

    0x6a

     

    0x00000000

     SL0TB_PD4_16BIT read

    0x6b

     

    0x00000000

    We also have tried to verify with respect to hardware. 

    1. The 3V and 1.8V voltages are working fine.
    2. We are using internal LEDs. Datasheet mentions that the voltage appears on LEDX1 and LEDX2 Pin. The voltage we have observed was LEDX1=1.68V and LEDX2=2V.
    3. The Value of capacitor used on CVLED is 1uF. The current setting of LED1 (Register 0x23) is 100mA and LED2 (Register 0x24) is 130mA, LED Pulse Width is 3uSec. Can you confirm if the example formula in Page 19 of datasheet is correct. The minimum LED voltage is considered as 4V in the equation however, minimum LED voltage is 3V.
    4. The value of capacitor used on CVREF is 1uF. The Voltage measured on Cvref is 0V.

    The schematic we have used is shown below.

    Please let us know if you see any issues. We are unable to get any data (The data registers are reading 0x0000) and LED is also not turning ON when we keep the finger.

    Thanks

  • Dear Glen,

    Yes, We have set the register 0x10 to 0x0002 after the configuration is loaded. Although, We have done this, the LEDs are not glowing. I have measured the 3V, 1.8V supplies, They are fine. 

    Can you share the sample data that is expected when We load the suggested configuration both in open condition and when finger is placed over the device.

    What is the maximum value of pulse width that we can set..?

  • 0
    •  Analog Employees 
    on Aug 12, 2021 9:40 AM in reply to asacharya

    Hi there,

    I have updated the code and attached as main_v3.rft, can run this code to get the data from FIFO

    3821.main_v3.rtf

  • Satish, This started giving continuous data, but I still see the FIFO not getting cleared. Are there any more debugging points for me to debug? I have re-verified the init part again and please find attached the init code. Please do let me know, if this is correct.

    13821.main_v4.rtf

  • +1
    •  Analog Employees 
    on Aug 13, 2021 1:23 PM in reply to asacharya

    Hi,

    In the AdpdDrvInit() function AdpdDrvRegWrite(0x0010, 0x0002); sample mode register is set as running mode.

    Just remove that line in AdpdDrvInit() function, this sample mode setting will take care in AdpdDrvSetOperationMode() API.

    There is no need to clear the FIFO after putting device into sample mode, every FIFO read will clear the bytes which have read it out.

Reply
  • +1
    •  Analog Employees 
    on Aug 13, 2021 1:23 PM in reply to asacharya

    Hi,

    In the AdpdDrvInit() function AdpdDrvRegWrite(0x0010, 0x0002); sample mode register is set as running mode.

    Just remove that line in AdpdDrvInit() function, this sample mode setting will take care in AdpdDrvSetOperationMode() API.

    There is no need to clear the FIFO after putting device into sample mode, every FIFO read will clear the bytes which have read it out.

Children
No Data