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.

UCD3138064: Enable IRQ and FIQ of DCOMP (digital comparator) will cause UCD3138 brick

Part Number: UCD3138064
Other Parts Discussed in Thread: UCD3138

Hi experts,

 - I would like to use DCOMP for fast interrupt when FE0 exceeds a particular value, and I found when I try to enable the IRQ and FIQ, UCD3138 will be brick. (Can not search for the DEVICE_ID nor enter ROM mode.)

 - Is there anything wrong in the codes below? If I removed the red parts, then it is fine to run. I tried to get the FAULTMUXINTSTAT, it shows all zeros, so I don't think it is stuck in the infinite interrupt service routine.

 - Could you show me how to enable the DCOMP fast interrupt correctly? Or, is there any document (app note) is using DCOMP to trigger fast interrupt? Please help. Thank you.

static void Interrupt_Init(void)
{
    volatile U32 temp;

    //MiscAnalogRegs.CLKTRIM.bit.HFO_LN_FILTER_EN = 0;

    //Disable interrupts
    disable_interrupt();
    disable_fast_interrupt();
       
    /* Must clear interrupts befefore enable interrupts  */
    temp = FaultMuxRegs.FAULTMUXINTSTAT.all;   // Clear on read

    //Configure IRQ, PWM2 is 10Khz timer
    write_reqmask(CIMINT_ALL_PWM2_COMP | CIMINT_ALL_FAULT_MUX | CIMINT_ALL_DIGI_COMP);
    //Configure FIQ
    write_firqpr(CIMINT_ALL_FAULT_MUX | CIMINT_ALL_DIGI_COMP);
    //Enable interrupts
    enable_fast_interrupt();
    enable_interrupt();
}
Jack
  • Jack, the code we need to look at is not the enable code, but the code you have added to initialize the DCOMP and to process the interrupt.  

    First you need to never program the checksum whenever testing any code changes.  This especially applies to code which modifies the interrupt processing.  That way, even if you prevent the PMBus from running, you can just reset the part and go back to ROM mode.  A hardware backdoor which tries to clear the checksum before the interrupts are enabled may be useful, but even it can be messed up if I try hard enough.   

    If you are getting stuck in the interrupt, the two most important things are:

    1. Make sure you clear the interrupt cause - maybe this is reading from the fault status to clear the bit

    2. Disable the interrupt source - in this case the dcomp.  This is so that if the DCOMP stays active, the interrupt won't happen any more.  

  • Hi Ian,

     - Thanks for remind. However, usually I start programing firmware without checksum after I found that the code is failed to run the PMBus handler.. hahaha..

     - For the DCOMP, the weird thing is, even if I comment all the DCOMP codes, and only enable the IRQ and FIQ (using code above), the firmware still have the issue.

     - I also tried not to enable the IRQ and FIQ, and check the register values with memory debugger on open socket board. I can't see any INT STAT is "1". So, I don't think there is a real DCOMP interrupt that cause the issue. Is this the right way to check if DCOMP interrupt halt the firmware?

     - There are 2 files exported from memory debugger are attached. One with DCOMP initialized, while the other without. Both of them doesn't enable the IRQ and FIQ, and both of them will halt after enable the DCOMP IRQ and FIQ using the code above. Could you please help to the check the register values and suggest anything that I may missing? (Only the registers that I think is needed. DCOMPCTRLn, FIQVEC, FAULTMUXSTAT)

    a. DCOMP initialized.

    DC-DC PSFB Firmware v1.2.2.0 @ Address 60d Watchlist Memory (DCOMP initialized)(no DCOMP IRQ FIQ) .csv

    b. DCOMP not initialized.

    DC-DC PSFB Firmware v1.2.2.0 @ Address 60d Watchlist Memory (no DCOMP initial)(no DCOMP IRQ FIQ) .csv

     - Thanks for all the suggestions.

  • Jack, I dug into it a little bit more, which I should have done at the beginning. DIGI_COMP is for the digital comparators that are on the ADC-12, not the ones on the fault register.  You need the fault interrupt for the DCOMP registers, not the DIGI_COMP.  We really should have given a different name to the ADC Digital Comparators.  

  • Hi Ian,

     - Oh I see ! Thanks for the explain ! It's working now, thank you.