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.

LAUNCHXL-F28379D: How to interconnect different CLB tiles on board?

Part Number: LAUNCHXL-F28379D

Hi,

I am a newbie in the world of C2000 family. I am trying to implement something in my F28379D MCU by using the module CLB on it. I tried to connect several outputs of Tile1 to the boundary input of tile2, but as the global mux of CLB on this MCU can only have access of CLBx_OUT4/5, the number of output of each tile is limited to 2(if I clearly understood). And for other output of the tile like CLB1_OUT1, is connected to an intern signal like PWMA according to the TRM document. As I need more than 2 outputs of one CLB tile to be connected to the inputs of another CLB tile, I was wondering how I can achieve this. For instance, like this:

Here is my idea:

I enabled the output0 of Tile1 and configured the input0 of tile2 to the global input mux of CLB, as I see that I have access to epwmxA/B signals by routing to the global mux, and the output0 of Tile1 can override the epwm1A so I thought it can connected each other but in fact I tested but it didn't work. Here is my configuration code in main.c:

void main(void)
{
    Device_init();
    Device_initGPIO();

    Interrupt_initModule();
    Interrupt_initVectorTable();
    
    //enable the interrupt
    Interrupt_register(INT_CLB1, &clb1ISR);
    Interrupt_enable(INT_CLB1);

    Interrupt_register(INT_CLB2, &clb2ISR);
    Interrupt_enable(INT_CLB2);

    //
    // Enabling EPWM1/2 to enable CLB1/2
    //
    SysCtl_enablePeripheral(SYSCTL_PERIPH_CLK_EPWM1);
    SysCtl_enablePeripheral(SYSCTL_PERIPH_CLK_EPWM2);
    
    //init of clbs
    
    CLB_enableCLB(CLB1_BASE);
    initTILE1(CLB1_BASE);
    CLB_enableCLB(CLB2_BASE);
    initTILE2(CLB2_BASE);

    //
    // Select Global input instead of local input for all CLB IN
    //CLB2 tile2
    CLB_configLocalInputMux(CLB2_BASE, CLB_IN0, CLB_LOCAL_IN_MUX_GLOBAL_IN);

    //CLB2
    CLB_configGlobalInputMux(CLB2_BASE, CLB_IN0, CLB_GLOBAL_IN_MUX_EPWM1A);

     //CLB2 laisse les connections internes
    CLB_configGPInputMux(CLB2_BASE, CLB_IN0, CLB_GP_IN_MUX_EXTERNAL);

    //Config for GPIO0 for CLB1_OUT_0
    GPIO_setPinConfig(GPIO_0_EPWM1A);
    GPIO_setDirectionMode(0, GPIO_DIR_MODE_OUT);
    GPIO_setPadConfig(0, GPIO_PIN_TYPE_STD);
    
    //enable the override mask
    CLB_setOutputMask(CLB1_BASE, 1 << 0, true);
    
    //clear the flag
    CLB_clearInterruptTag(CLB1_BASE);
    CLB_clearInterruptTag(CLB2_BASE);
    
    ...
    

I didn't include all the code because it is a bit long, but my idea is clear. By enabling the output0 of tile1 and creating a corresponding GPIO, I activated the ePWM1A signal and then configured the input0 of tile2 in order to interconnect the two tiles. I tested it by using one event in HLC of tile 2 with a flag to toggle one led onboard(the output0 of tile can generate a pulse to trigger the event), but it seemed that it didn't work. I am wondering that is this due to the signal specification that we can't just put a random signal to pwm output? Or I didn't do the correct configuration. Thank you in advance for your help!

  • Hi Changzi,

    This is an interesting approach and we have not extensively explored this approach to expand the number of outputs on CLB tiles. I believe instead of grabbing the EPWM1A signal directly from the global mux, you need to grab it from the GPIO pin by using an INPUTXBAR and CLBXBAR to feed it back into CLB tile. For example, if you're overriding GPIO0, then you can use an INPUTXBAR to directly input GPIO0 into the CLB tile.

    We usually don't recommend this since it uses a lot of peripheral resources: you would need to use GPIOs, INPUTXBARs, CLBXBARs, and it would require using up some EPWM resources. But depending on how many extra CLB outputs you need, this could be a viable solution

    Regards,

    Peter

  • Hi Peter,

    I appreciate your fast reply! I tried to reserve a GPIO0 for the signal ePWM1A and selected it to my INPUTXBAR2 and then connected the CLB_XBAR to it, but it didn't work. Here is my code:

    //local to global
    CLB_configLocalInputMux(CLB2_BASE, CLB_IN0, CLB_LOCAL_IN_MUX_GLOBAL_IN);
    
    //global input selected to CLB_XBAR 1
    CLB_configGlobalInputMux(CLB2_BASE, CLB_IN0, CLB_GLOBAL_IN_MUX_CLB_AUXSIG1);
    
    //Dont use GPreg
    CLB_configGPInputMux(CLB2_BASE, CLB_IN0, CLB_GP_IN_MUX_EXTERNAL);
    
    //Connect INPUTXBAR2 to CLBXBAR 1
    XBAR_setCLBMuxConfig(XBAR_AUXSIG1, XBAR_CLB_MUX03_INPUTXBAR2);
    XBAR_enableCLBMux(XBAR_AUXSIG1, XBAR_MUX03);
    
    //Set up GPIO0 to EPWM1A and connect it to XBARINPUT2
    GPIO_setPinConfig(GPIO_0_EPWM1A);
    GPIO_setDirectionMode(0, GPIO_DIR_MODE_OUT);
    GPIO_setPadConfig(0, GPIO_PIN_TYPE_STD);
    XBAR_setInputPin(XBAR_INPUT2, 0);
    
    //enable the output0 of Tile1
    CLB_setOutputMask(CLB1_BASE, 1 << 0, true);
    
    

    Just to be clear, I tried to generate a pulse signal when I detected descendant front of an input GPIO(code not included below but done), the input GPIO is connected to tile1 and the generated pulse signal is connected to the output0 of tile1, then the the output0 of tile1 is connected to the input0 of tile2. I made one interrupt in each tile: if I see the pulse signal, I will put my flag to 1 and toggle one led onboard.(so for tile2, the interrupt is based on the input0 which the same one of ouput0 of tile1) So for tile1 it works, the red led toggled, but for tile2, it didn't work.(the blue led) I checked the interrupt with the output4 of tile1 which can be connected directly to CLBXBAR, and it did work. So it means my interrupt feature is correct. So now I can't understand why even I reserved a GPIO and override it by CLB then connected it to all XBARs but finally it didn't work. Is there any initialization and configuration for the epwm signal to be done? Because what I generate is just a pulse so not sure if it reach the rules of a epwm signal. Or is it just not supported? Again thank you in advance for your advice!

  • Hi Changzi,

    There should not be any restriction on the output of the on the epwm GPIO if you are overriding it with the CLB. Can you try doing a simpler example to showcase outputting on GPIO0 and bringing that signal into tile2? You say that you can see the output through output4, are you seeing a similar output even when overriding on GPIO0. Could you tell me what output you are seeing on the GPIO0

    Regards,

    Peter

  • Hi Peter,

    I quickly retry a test for this issue, now I can connect two tiles by grabbing one GPIO epwm1a, it did work.(so I think I had something wrong in the tile configuration) Thank you for all this! But I still can't use the GLOBAL_EPWM1A directly(without passing a GPIO then INPUTXBAR and CLBXBAR) to interconnect the two tiles. I think there is something that I don't understand yet, if you or anyone have ever tested this feature then I am very excited to hear!

    Regards,

    Changzi

  • Hi Changzi,

    Glad to hear that you were able to get this method working using the INPUTXBAR. Yes I believe that it's not possible to directly connect the tiles using the GLOBAL_EPWM1A signal. I would have to consult with design for confirmation but the reason that this wouldn't work is that the GLOBAL_EPWM1A comes from the actual EPWM module whereas the CLB signal that overwrites the EPWM1A output occurs at a later point in the chain. You can see the below diagram as an example, note the mux that determines what gets output to the GPIO

    When you use the GLOBAL_EPWM1A, it would be coming from the purple EPWM box. But you are actually looking for the output of the Peripheral Signal Mux to bring it to another tile. That mux output gets sent to the GPIO, which is why you must use an INPUTXBAR to route that GPIO signal back into another CLB tile. Let me know if this makes sense or if you need more clarification

    Regards,

    Peter

  • Hi Peter,

    Thank you again for your admirable reply! That was exactly the same reason I thought, you confirmed this for me. Thank you so much for your help! 

    Regards,

    Changzi LU