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.

UCD3138: Analog Comparator Issue

Part Number: UCD3138

Dear all,

I am trying to configure the analog comparators in order to implement over current protection but I have some problems. Here are the steps that I test.

1. I configured the FaultMux registers. I supplied voltage to the corresponding ADC pin with an external supply. When the voltage is below the threshold, PWMs are on and above the threshold, PWMs turn off. It means my configuration is OK.

Here is the configuration:

FaultMuxRegs.ACOMPCTRL0.bit.ACOMP_B_THRESH = 85;

FaultMuxRegs.ACOMPCTRL0.bit.ACOMP_EN = 1; //Enable analog comparators

FaultMuxRegs.ACOMPCTRL0.bit.ACOMP_B_SEL = 0; //Configures reference of analog comparator B to ACOMP_B_THRESH

FaultMuxRegs.ACOMPCTRL0.bit.ACOMP_B_POL = 1; //Polarity of comparator when an event is detected.FaultMuxRegs.DPWM0FLTABDET.bit.ACOMP_B_EN = 1;

FaultMuxRegs.DPWM0FLTABDET.bit.ACOMP_B_EN = 1;

Dpwm0Regs.DPWMFLTCTRL.bit.ALL_FAULT_EN = 1;

Dpwm0Regs.DPWMFLTCTRL.bit.AB_MAX_COUNT = 4;

2. I tested the bidirectional current sense amplifier. There was no connection between output of current sense amplifier and analog comparator. When my converter operates, I checked the output of the current sense amplifier and it works properly. I mean it gave 1.25 V offset when there is no current flowing. I tested it in both directions in terms of current and gave the proper output. So there is no problem here.

3. I connected the output of the current sense amplifier and analog comparator but I commented out the last two lines which are DPWM0Regs lines. Also is shown below. Again there was no problem. I got again 1.25 V offset and when I operated the converter, proper output values are taken.

FaultMuxRegs.ACOMPCTRL0.bit.ACOMP_B_THRESH = 85;

FaultMuxRegs.ACOMPCTRL0.bit.ACOMP_EN = 1; //Enable analog comparators

FaultMuxRegs.ACOMPCTRL0.bit.ACOMP_B_SEL = 0; //Configures reference of analog comparator B to ACOMP_B_THRESH

FaultMuxRegs.ACOMPCTRL0.bit.ACOMP_B_POL = 1; //Polarity of comparator when an event is detected.FaultMuxRegs.DPWM0FLTABDET.bit.ACOMP_B_EN = 1;

FaultMuxRegs.DPWM0FLTABDET.bit.ACOMP_B_EN = 1;

//Dpwm0Regs.DPWMFLTCTRL.bit.ALL_FAULT_EN = 1;

//Dpwm0Regs.DPWMFLTCTRL.bit.AB_MAX_COUNT = 4;

4. In the final step, the commented lines in the previous step are uncommented and the connection of current sense amplifier and analog comparator still exists. When I only supply power to current sense amplifier not to converter, output of the current sense amplifier suddenly jumps to 4 V and all PWMs are turned off. 

Is it a configuration problem or is it caused by current sense amplifier?

I would be appreciated if someone helps me. Thanks in advanced.

Kind Regards,

Merih

  • If you apply that high a voltage to the ADC pin - or any pin - results will be unpredictable and you may damage the UCD. The UCD is not going to put  out 4 volts, it must be caused by the current source amplifier.

  • In the datasheet, it's written as 4 V is the maximum rating actually, but luckily UCD still works.

    I solved the problem. I don't know exactly the reason of 4 V but I realized that 4 V exists when I don't download the firmware. I supplied power and got 4 V but when I download the firmware, it drops back to my current sense amplifier offset.

    Regards,
    Merih
  • Don't count on all parts working reliably at 4 volts.  Certainly over lot by lot variation, not to mention over time and temperature, it's certainly not guaranteed.