Dear Team,
I use the CV-CI-CP module of my UCD3138.
Configuration is ok, cause my power source behaves correct, I vary the load resistor over a wide range and I clearly see CV and CI behavior just as expected.
I have two Independent control Loops, Filter0 do the voltage Loop and Filter1 the current Loop.
Now I want to get informed, in which mode the source actually works.
First I tried:
if ( LoopMuxRegs.CPSTAT.bit.CONSTANT_CUR == 1 ) { Dpwm3Regs.DPWMCTRL1.bit.GPIO_B_VAL = 1; power_source_mode = CONST_CURR_MODE;} // Check for constant current mode
if ( LoopMuxRegs.CPSTAT.bit.CONSTANT_VOLT == 1 ) { Dpwm3Regs.DPWMCTRL1.bit.GPIO_B_VAL = 0; power_source_mode = CONST_VOLT_MODE;} // Check for constant voltage mode
But there wasn't any Change to see on that pin.
Later on I tried:
if ( LoopMuxRegs.CPSTAT.bit.CV_TO_CC_INT == 1 ) { Dpwm3Regs.DPWMCTRL1.bit.GPIO_B_VAL = 1; power_source_mode = CONST_CURR_MODE;} // Check for constant current mode
if ( LoopMuxRegs.CPSTAT.bit.CC_TO_CV_INT == 1 ) { Dpwm3Regs.DPWMCTRL1.bit.GPIO_B_VAL = 0; power_source_mode = CONST_VOLT_MODE;} // Check for constant voltage mode
This code sits in my Interrupt handler. Other code there works, so the Interrupt basically works. But no Change to detect.
And of course the Setting of the GPIO pin is correct, cause I just toggles the pin in the Interrupt and I get nice pulses.
I am pretty shure now, that the CV-CI-CP module works, but notification, which mode is currently selected Fails.
Any ideas?
Here the init of that module:
void init_CV_CC_CP_module(void)
{
LoopMuxRegs.CPCTRL.bit.VLOOP_SEL = 0; // Filter 0 is voltage loop input
LoopMuxRegs.CPCTRL.bit.CLOOP_SEL = 1; // Filter 1 is current loop input
LoopMuxRegs.CPCTRL.bit.LOWER_COMP_EN = 1; // output is min(VLOOP, CLOOP)
LoopMuxRegs.CPCTRL.bit.CPCC_CONFIG = 1; // Constant Power Module controls selection of voltage/current loop
LoopMuxRegs.CPCTRL.bit.CPCC_INT_EN = 1; // Interrupts on
LoopMuxRegs.CPCTRL.bit.CPCC_EN = 1; // enable that module
}
Thanks for helping
With best regards
Gerhard