Post Go back to editing

AD5940 High Speed Loop

Thread Summary

The user inquired about the possibility of switching the excitation DAC to D5 and D6 to generate counter electrodes on CE0 and AFE1 at different times. The final answer confirms this is achievable within the measurement sequence, providing example code that configures the switch matrix and ADC for each electrode, including specific wait times and control settings for the AD5940.
AI Generated Content

1) Is it possible to switch the excitation DAC to D5 and D6 at different times to generate two counter electrodes one on CE0 and one on AFE1?

2) Can you share an example code with us to see how the switching between these two main loops should be?

Thread Notes

Parents
  • Hi,

    Yes. It can be done inside measurement sequence as in example below:

    /* Start sequence generator here */
      AD5940_SEQGenCtrl(bTRUE);
      
      AD5940_SEQGpioCtrlS(AGPIO_Pin6);
      
      AD5940_SEQGenInsert(SEQ_WAIT(16*250));  /* @todo wait 250us?? */
      sw_cfg.Dswitch = SWD_CE0;
      sw_cfg.Pswitch = SWP_CE0;
      sw_cfg.Nswitch = SWN_AIN1;
      sw_cfg.Tswitch = SWT_AIN1|SWT_TRTIA;
      AD5940_SWMatrixCfgS(&sw_cfg);
      
      AD5940_ADCMuxCfgS(ADCMUXP_HSTIA_P, ADCMUXN_HSTIA_N);
      AD5940_AFECtrlS(AFECTRL_WG|AFECTRL_ADCPWR, bTRUE);  /* Enable Waveform generator, ADC power */
      AD5940_SEQGenInsert(SEQ_WAIT(16*50));
      AD5940_AFECtrlS(AFECTRL_ADCCNV|AFECTRL_DFT, bTRUE);  /* Start ADC convert and DFT */
      AD5940_SEQGenInsert(SEQ_WAIT(WaitClks));  /* wait for first data ready */  
      AD5940_AFECtrlS(AFECTRL_ADCCNV|AFECTRL_DFT|AFECTRL_WG|AFECTRL_ADCPWR, bFALSE);  /* Stop ADC convert and DFT */
    
      sw_cfg.Dswitch = SWD_AFE1;
      sw_cfg.Pswitch = SWP_AFE1;
      sw_cfg.Nswitch = SWN_AIN1;
      sw_cfg.Tswitch = SWT_AIN1|SWT_TRTIA;
      AD5940_SWMatrixCfgS(&sw_cfg);
      
      AD5940_ADCMuxCfgS(ADCMUXP_HSTIA_P, ADCMUXN_HSTIA_N);
      AD5940_AFECtrlS(AFECTRL_WG|AFECTRL_ADCPWR, bTRUE);  /* Enable Waveform generator, ADC power */
      AD5940_SEQGenInsert(SEQ_WAIT(16*50));
      AD5940_AFECtrlS(AFECTRL_ADCCNV|AFECTRL_DFT, bTRUE);  /* Start ADC convert and DFT */
      AD5940_SEQGenInsert(SEQ_WAIT(WaitClks));  /* wait for first data ready */  
      AD5940_AFECtrlS(AFECTRL_ADCCNV|AFECTRL_DFT|AFECTRL_WG|AFECTRL_ADCPWR, bFALSE);  /* Stop ADC convert and DFT */
      
      sw_cfg.Dswitch = SWD_OPEN;
      sw_cfg.Pswitch = SWP_PL|SWP_PL2;
      sw_cfg.Nswitch = SWN_NL|SWN_NL2;
      sw_cfg.Tswitch = SWT_TRTIA;
      AD5940_SWMatrixCfgS(&sw_cfg); /* Float switches */
    
      AD5940_SEQGpioCtrlS(0);        
      AD5940_EnterSleepS();/* Goto hibernate */
      /* Sequence end. */
      error = AD5940_SEQGenFetchSeq(&pSeqCmd, &SeqLen);
      AD5940_SEQGenCtrl(bFALSE); /* Stop sequencer generator */

  • Dear Akila,

    Thank you for your response to our inquiry.

    We tried your code. I am afraid it did not work for us. Here is our follow up questions:

    1) Why did you connect the P switch to CE0 on your line 8?

    2) We want to have a separate reference electrode than the counter electrode. How do we set up the P switches to have access to a separate reference electrode?

    3) Is there a more comprehensive schematic about the DAC for the high speed loop that you can share? There are inputs from the function generator to the DAC. At the same time, there are inputs from N and P switches to the DAC. We want to have a better understanding of what the relationship is between the inputs of the DAC and N and P switches.

    4) What is the purpose of N switch that connects the input of the DAC to the input of the TIA?

    5) Just to reiterate, we want to have a separate Counter and reference electrodes. Can you advise how the N and P switches need to be set up?

    Thank you very much.

    Payam

Reply
  • Dear Akila,

    Thank you for your response to our inquiry.

    We tried your code. I am afraid it did not work for us. Here is our follow up questions:

    1) Why did you connect the P switch to CE0 on your line 8?

    2) We want to have a separate reference electrode than the counter electrode. How do we set up the P switches to have access to a separate reference electrode?

    3) Is there a more comprehensive schematic about the DAC for the high speed loop that you can share? There are inputs from the function generator to the DAC. At the same time, there are inputs from N and P switches to the DAC. We want to have a better understanding of what the relationship is between the inputs of the DAC and N and P switches.

    4) What is the purpose of N switch that connects the input of the DAC to the input of the TIA?

    5) Just to reiterate, we want to have a separate Counter and reference electrodes. Can you advise how the N and P switches need to be set up?

    Thank you very much.

    Payam

Children
  • 1) P is connected to CE0 for doing a 2 electrode measurement. If you want to do 3-electrode measurement, P may be connected to RE0.

    sw_cfg.Pswitch = SWP_RE0;

    3) P and N are +ve and -ve feedback to excitation amplifier. 

    4) N switch only connects to -ve feedback input of DAC. T switch connects pin to input of TIA, where input current is measured by TIA. 

    5) For separate reference electrode,

    sw_cfg.Dswitch = SWD_CE0;
    sw_cfg.Pswitch = SWP_RE0;
    sw_cfg.Nswitch = SWN_AIN1;
    sw_cfg.Tswitch = SWT_AIN1|SWT_TRTIA;

  • Thanks for your response. I will try your code. But the schematic shows the N switch is connected to +ve and P switch is connected to -ve. Can you explain why you said the N switch connects to -ve?

    Another question that I have is related to the low speed loop.
    Is it possible to use the switch matrix with the low speed loop?
    Can the low speed loop be used with multiple working electrodes and at least 2 counter electrodes? The reference electrode can be one.

    If yes, which pins can be used for working electrodes and which pins can be used for counter electrodes? Could you post some sample code for this pupose?

    Please let me know. Thank you very much for your help.

  • Hi,

    It is an inverting amplifier. Hence the sign reversal.

    Inputs to LPTIA can be SE0 (via switch S7) or RE0 (by shorting it to SE0 via switch SW11) only.

    Counter electrode (output of LPDAC) can be CE0(SW2) or RE0 (SW15).

  • Also. in the above code, AppIMPDataProcess() function must be updated, since you are reading two samples instead of one now.

    Only then, the code works with proper result process and display.

  • Hi,

    I couldn't find AppIMPDataProcess()  function that needs to be updated. 

    Could you point me to where it is?

    Thanks. 

  • If you are measuring impedance, above modifications can be done on AD5940_Impedance example.

    AppIMPDataProcess() is availbale in this example.

  • We are not measuring impedance. We are performing Square Wave Voltammetry, Chronoamperometry, and open circuit potentiometry, all by the high speed loop. 
    Could you share an example code for Square Wave Voltammetry by the high speed loop?

  • I don't have these examples in high speed loop as of now. Kindly refer to the high speed loop examples in Github to update as per your application. 

  • Our main question is how to achieve independent voltage control of CE0 and AFE1? We are unable to independently control the CE0 and AFE1 voltages via HSDAC in MMR (DC) mode. The voltages are determined by RE0 (LPDAC output) rather than HSDAC code.

    We noticed internal coupling prevents independent control of CE0 from RE0. We also noticed  AFE1 voltage doesn't change regardless of code value written to REG_AFE_HSDACDAT, although the sequencer correctly calculates and writes HSDAC code.

    Our Test Conditions
    2-channel Amperometry with the following switch configuration: 

    Amperometry #1: AIN1/CE0
    sw_cfg.Dswitch = SWD_CE0;
    sw_cfg.Pswitch = SWP_RE0;
    sw_cfg.Nswitch = SWN_AIN1;
    sw_cfg.Tswitch = SWT_AIN1|SWT_TRTIA;
    Amperometry #2: AIN2/AFE1
    sw_cfg.Dswitch = SWD_AFE1;
    sw_cfg.Pswitch = SWP_RE0;
    sw_cfg.Nswitch = SWN_AIN2;
    sw_cfg.Tswitch = SWT_AIN2|SWT_TRTIA;
    We have verified that
    1) Sequencer writes correct HSDAC codes (confirmed in debug logs)  
    2) WGCON is set to MMR mode with calibration enabled  
    3) HSDAC calibration has been performed  
    4) Switch matrix configuration is correct  
    5) AFE power blocks are enabled correctly
    Thanks,