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: Programmable Timing Engine (PROG_TG)

Part Number: AFE4404


Tool/software:

Hi,

My setup consists of the AFE4404, the Osram SFH7072 biosensor, and a photodiode switching circuit for the SFH7072.

The SFH7072 biosensor includes two photodiodes: IR-CUT and BB.

I would like to use:
- The IR-CUT photodiode for heart rate (HR) and heart rate variability (HRV) measurements.
- The BB photodiode for SpO₂ measurements.

For the AFE's LED1 active and sampling phases, I would like to configure the AFE to measure the IR-CUT photodiode current, in order to minimize the influence of ambient light.
For the LED2 and LED3 active and sampling phases, the AFE should measure the BB photodiode current.

I’ve already implemented a driver that dynamically calculates timing engine values for each phase, with the pulse repetition frequency (PRF) as a constraint during initialization.
The timing values follow the datasheet recommendations (Table 12: *Sample Register Settings for Low Interference Across Phases*) to avoid phase overlaps.
It’s worth noting that I provide the AFE with an external clock signal (CLK_EXT), not the other way around.

My initial idea was to measure HR, HRV, and SpO₂ (using LED1, LED2, and LED3) during a single AFE pulse repetition cycle, as I believe this would simplify future calibration routines.

To accomplish this, I need to switch the photodiode circuit (by setting a control pin LOW or HIGH) immediately after the LED3 active + sampling phase.
Then I need to switch it back after LED1 is done, to prepare the BB photodiode for LED2 and LED3 in the next cycle.

To handle this correctly, I require two interrupts:
1. One right after LED3 is finished.
2. Another when data is ready (`ADC_RDY`).

While reviewing the datasheet, I came across the `PROG_TG_*` registers.
I successfully replaced the `ADC_RDY` interrupt with a `PROG_TG` signal.

However, I haven’t been able to generate a `PROG_TG` signal between the LED active phases.

My Questions:
1. Is it possible to generate a `PROG_TG` signal between LED phases, or can it only be used as a replacement for `ADC_RDY`?
2. If the above is possible, can the `PROG_TG_STC` and `PROG_TG_ENDC` registers be modified after the first `PROG_TG` signal?
In other words, is it possible to generate multiple `PROG_TG` signals within a single PRF cycle by updating these register values on the fly?
3. Does my approach make sense? Is this how such a setup is typically implemented?
If not, could you suggest a better alternative?

Looking forward to hearing from you!

  • Hello Pawel,

    Thank you for reaching out. Give me some time to investigate the PROG_TG signal, and I'll get back to you as soon as I can.

    Regards,

    Payton

  • Hello Pawel,

    Thank you for your patience.

    1. While it should be theoretically possible to program PROG_TG* between the LED active phases, doing this comes at the cost of the ADC_RDY signal, which is essential to reading out the AFE4404 data. Without the ADC_RDY signal, there is a very high likelihood of overwriting data between cycles or reading the data in the middle of a cycle, which will lead to data corruption.

    2. The register values that program the position of PROG_TG* cannot be changed mid-cycle.

    3. The AFE4404 is only designed to support a single photodiode input. There is not an efficient way to switch between photodiode inputs using the AFE4404. You can either choose to design your algorithms under this constraint, and figure out how to measure HR, HRV, and SpO2 with one photodiode, or migrate to a different AFE that can support more photodiode inputs. You can email biosensing_afe-support@list.ti.com with any additional questions.

    Regards,

    Payton

  • Hi Payton, 

    Thank you for fast response.

    I am going to keep the current AFE and biosensor and manually switch the photodiodes. 
    I have to use 3-LED mode, so each LED emitter will be driven. (GREEN, RED, IR).

    1. When measuring the HR/HRV (meaning that I am configured for IR-CUT photodiode) could I set the LED2, LED3 related timing registers to 0? 
    2. When measuring the SPO2 (meaning that I am configured for BB photodiode), could I set the LED1 related timing registers to 0? 

    Regards, 

    Pawel

  • Hello Pawel,

    To ensure that the internal state machine continues to function, please allocate at least one clock cycle for each LED phase, even the ones you do not plan on using during that cycle.

    However, you should not need to allocate more than one clock cycle for LED phases that you are not reading data from during that cycle. Additionally, since the LED current is individually programmable for each LED, I would recommend driving 0mA of current to unutilized LEDs during said cycle.

    Regards,

    Payton

  • Hi Payton, 

    Thank you for your help. 
    I will implement these suggestions into my code. 

    Do you think that the ambient phase can be omitted when measuring SPO2 (BB photo-diode configured)?

    Regards,

    Pawel

  • Hello Pawel,

    When measuring the LED phase of the data, you are really measuring both the LED data and the ambient data at the same time. Therefore, it is recommended to measure the ambient data directly and subtract it from the data measured during the LED phase. More information can be found here.

    Regards,
    Payton