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.

TMS320F28P650DK: CLB reset

Part Number: TMS320F28P650DK

Hi,

I want to reset my clb when a HLC interrupt happens to start again from the beginning, how I can do this reset? If I do this that set global load register 0 and then enable again the CLB, is it right?
EALLOW;
HWREG(CLB1_BASE + CLB_LOGICCTL + CLB_O_LOAD_EN) = 0;
EDIS;

CLB_enableCLB(CLB1_BASE);

thanks.

  • Hello Hamidreza,

    I want to reset my clb when a HLC interrupt happens to start again from the beginning, how I can do this reset?

    Why do you want to reset the entire CLB during a CLB interrupt? I'll warn you, it's not a good idea to reset a peripheral in an ISR which is a handling an interrupt from that same peripheral. This could produce unexpected behavior if not done correctly. The best practice is to use some other trigger or some condition in the main routine to disable and reset the CLB while it's not being used by anything else.

    If I do this that set global load register 0 and then enable again the CLB, is it right?

    Please read the registers in the reference manual for the CLB, the LOAD_EN signal you're clearing doesn't disable the CLB:

    You're using a driverlib function to enable the CLB, if you use the disable CLB function before calling the enable CLB this will essentially reset the peripheral, but again why do you need to reset the entire CLB? I'm curious on the use-case for something like this.

  • Thanks for the response.

    I want to read from Bissc encoder, I'm using CLB to generate the clock and I want when read the whole data from sensor, reset counters and state to start a new cycle.

  • Hello Hamidreza,

    I want to read from Bissc encoder, I'm using CLB to generate the clock and I want when read the whole data from sensor, reset counters and state to start a new cycle.

    I believe using the CLB_disableCLB function call followed by the CLB_enableCLB function will not fit your needs then. If you're trying to reset the counters of the CLB, these are not reset by the GLOBAL_EN bit. The best way to do this is to have an additional input (if possible), which can be used as the reset signal for all used counters. I recommend using a GPREG bit, that way you can just write to the register in software within your ISR. Let me know if you're able to do this, or if you don't have any other inputs available for your CLB.

  • Actually the most important one for me to reset is the reset of the states in FSM I want to set all of them to 0 at the end of the cycle. Do you have any idea for this one?

  • The enable/disable functions will reset the FSM, please read through the description of the GLOBAL_EN bit in the CLB_LOAD_EN register; the cell logic, FSM, and AOC will be reset, the counter and HLC will be halted, and the outputs will be gated when the bit is cleared. If you plan to use the enable/disable functions, it may be good to re-initialize the CLB tile to make sure none of the configurations are altered from what they're supposed to be originally.