cancel
Showing results for 
Search instead for 
Did you mean: 

Unexpected OPAMP Output Voltage When Enabling OPAMP on EVSPIN32G4 DUAL

pelino
Associate III

I am using EVSPIN32G4 DUAL and observed the following behavior.

When calling:

LL_OPAMP_Enable(OPAMPx);

pelino_3-1770600480815.png

 

 

the OPAMP output immediately shows about 208 mV.

I measured this voltage at TP25.

pelino_0-1770600116378.png

This behavior occurs even though DAC3 is completely disabled.
After calling LL_OPAMP_Enable(), I checked the DAC3 registers and confirmed that:

pelino_4-1770600731443.png

 

All related DAC_CR and DAC_DHR12R registers remain set to zero.

 

I checked these registers because DAC3 Channel 2 is configured as the OPAMP minus (−) input, as shown in the configuration below.

pelino_2-1770600303038.png

 

My questions are:

1. Why does the OPAMP output show approximately 208 mV when the OPAMP is enabled ,even though DAC3 has no value configured and is fully disabled?

Thank you.

Best regards,

Pelino

9 REPLIES 9
TDK
Super User

Op amps still do their thing even if their inputs are floating. What are you expecting to happen? It's best not to let input float or you end up with undefined behavior on the output.

If you measure TP18/TP19/TP25, it should be consistent with the op-amp behavior.

If you feel a post has answered your question, please click "Accept as Solution".
pelino
Associate III

According to UM2896, the comparator negative input (Vth) can be connected to the DAC or an internal reference.

pelino_0-1770632959700.png

 

On the EVSPIN32G4-DUAL board, when DAC3 is enabled but no DAC value is written,

the OPAMP output at TP25 stays at 208 mV.

My question is simply:

What is the actual default Vth voltage on the EVSPIN32G4-DUAL board in this condition, and where is it defined (hardware or firmware)?

Best regards,

Pelino

> DAC3 is completely disabled.

> DAC3 is enabled but no DAC value is written,

Which is it? Your register values above suggest it's disabled.

If the input is floating, the state will depend on what is connected to m1_shunt, but it doesn't seem very useful to me.

If you feel a post has answered your question, please click "Accept as Solution".
pelino
Associate III

I am not trying to analyze the floating behavior itself.
My question is based on UM2896, where Vth is defined and used in the overcurrent (Ioc) calculation.

On the EVSPIN32G4-DUAL board, where is this Vth actually defined and what value is expected by default, if no firmware explicitly programs the DAC?

pelino
Associate III

After reviewing the code more carefully, I noticed a potential inconsistency:

  • COMP2 is configured to use DAC3_CH2 as the negative input
    (COMP_INPUT_MINUS_DAC3_CH2 in MX_COMP2_Init)

  • However, the code that programs the DAC reference checks for
    LL_COMP_INPUT_MINUS_DAC1_CH2

As a result, when COMP2 is used, the DAC reference may never be written, leaving the comparator negative input effectively floating.

This could explain why a stable ~208 mV is observed at TP25 even though no explicit Vth is configured.

Could you please confirm whether this is expected, or if the DAC channel selection in the code should be updated to match DAC3_CH2 for COMP2?

pelino_0-1770676514914.png

 

pelino_1-1770676578135.png

 

Best regards,

Pelino

Hello @pelino,

Thank you for your report.
For the moment, can you select the DAC1OUT2 DAC signal and replace OCP handling by:

  /********************************************************************************************/
  /*                                      COMP Initialization                                 */
  /********************************************************************************************/
    /* Over current protection */
    if (COMP_OCPx)
    {
      /* Inverting input*/
      if (pHandle->pParams_str->CompOCPInvInput_MODE == DAC_MODE)
      {
        if (LL_COMP_INPUT_MINUS_DAC1_CH2 == LL_COMP_GetInputMinus(COMP_OCPx))
        {
          R1_SetAOReferenceVoltage(LL_DAC_CHANNEL_2, (uint16_t)(pHandle->pParams_str->DAC_OCP_Threshold));
        }

This point will be corrected for next deliveries.

If you agree with the answer, please accept it by clicking on 'Accept as solution'.
Best regards.
GMA
pelino
Associate III

Hello @GMA 

As shown in the figure below, after disabling DAC3 OUT2,

pelino_0-1770720240954.png

and then enabling DAC1 OUT2 mode as shown in the next figure,

pelino_1-1770720256551.png

would it be correct to change COMP2 Input[-] to DAC1 OUT2?

pelino_2-1770720272476.png

Best Regards

Pelino

I'm assuming you've dug deep into this trying to find a way to adjust the DAC referenced Protection Thresholds
Look for "DAC Settings"
in mc_parameters.c 
or file search , DAC_OCP_Threshold or DAC_OVP_Threshold

This is an important parameter in my application but I didn't find enough documentation for this.

Give me a thumbs up if this is what you were looking for.
All the best.

Hello @pelino,

I am referring to select the DAC output from workbench interface:

GMA_0-1770909397557.png

 

If you agree with the answer, please accept it by clicking on 'Accept as solution'.
Best regards.
GMA