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-F280039C: How to detect falling edge using CLB configuration

Part Number: LAUNCHXL-F280039C
Other Parts Discussed in Thread: SYSCONFIG

Tool/software:

I would Like to detect ewpm falling edge using CLB configuration and once falling edge is detected need to create pulse on gpio

  • Hi Deven,

    The CLB module has an input qualification mechanism that can filter the inputs into the CLB to only detect edges instead of the current state of the input. I would recommend using the CLB tool to do this. The detected edge can then be used as a CLB output which can then be connected to the GPIO via the CLB Output XBAR.

    Thank you,

    Luke

  • Hello Luke, 

    Thank you for response.  
    Do you have any example how I can detect failing edge of ePWM , I was not able to configure CLB to detect that, In CLB examples there is example to detect rising edge unfortunately i could not able to modify that to detect falling edge, It will be helpful if you share exact CLB configuration /reference example which will help me to detect falling edge of pwm    

  • Hi Deven,

    You can select falling edge detection in SysConfig:

    Is this drop down option available for you in SysConfig?

    Thank you,

    Luke

  • /**
     * These arguments were used when this file was generated. They will be automatically applied on subsequent loads
     * via the GUI or CLI. Run CLI with '--help' for additional information on how to override these arguments.
     * @cliArgs --device "F28003x" --package "100PZ" --part "F28003x_100PZ" --context "system" --product "C2000WARE@5.02.00.00"
     * @versions {"tool":"1.20.0+3600"}
     */
    
    /**
     * Import the modules used in this configuration.
     */
    const clb             = scripting.addModule("/driverlib/clb.js", {}, false);
    const clb1            = clb.addInstance();
    const clb_outputxbar  = scripting.addModule("/driverlib/clb_outputxbar.js", {}, false);
    const clb_outputxbar1 = clb_outputxbar.addInstance();
    const TILE            = scripting.addModule("/utilities/clb_tool/clb_syscfg/source/TILE", {}, false);
    const TILE1           = TILE.addInstance();
    
    /**
     * Write custom configuration values to the imported modules.
     */
    clb1.$name               = "myCLB0";
    clb1.attachTile          = true;
    clb1.enableCLB           = true;
    clb1.initTile            = true;
    clb1.inputsUsed          = ["CLB_IN0"];
    clb1.inputTypeCLB_IN0    = "GLOBAL";
    clb1.filterConfigCLB_IN0 = "CLB_FILTER_FALLING_EDGE";
    
    clb_outputxbar1.$name                                    = "myCLB_OUTPUTXBAR0";
    clb_outputxbar1.useSourceSelect                          = true;
    clb_outputxbar1.sourceSignals                            = ["CLB1_OUT4"];
    clb_outputxbar1.clb_outputxbar.clb_outputxbarPin.$assign = "GPIO0";
    
    TILE1.$name              = "TILE0";
    clb1.tile                = TILE1;
    TILE1.BOUNDARY.$name     = "BOUNDARY0";
    TILE1.LUT_0.$name        = "LUT_0";
    TILE1.LUT_1.$name        = "LUT_1";
    TILE1.LUT_2.$name        = "LUT_2";
    TILE1.FSM_0.$name        = "FSM_0";
    TILE1.FSM_1.$name        = "FSM_1";
    TILE1.FSM_2.$name        = "FSM_2";
    TILE1.COUNTER_0.$name    = "COUNTER_0";
    TILE1.COUNTER_1.$name    = "COUNTER_1";
    TILE1.COUNTER_2.$name    = "COUNTER_2";
    TILE1.OUTLUT_0.$name     = "OUTLUT_0";
    TILE1.OUTLUT_1.$name     = "OUTLUT_1";
    TILE1.OUTLUT_2.$name     = "OUTLUT_2";
    TILE1.OUTLUT_3.$name     = "OUTLUT_3";
    TILE1.OUTLUT_4.$name     = "OUTLUT_4";
    TILE1.OUTLUT_4.eqn       = "i0";
    TILE1.OUTLUT_4.i0        = "BOUNDARY.in0";
    TILE1.OUTLUT_5.$name     = "OUTLUT_5";
    TILE1.OUTLUT_6.$name     = "OUTLUT_6";
    TILE1.OUTLUT_7.$name     = "OUTLUT_7";
    TILE1.HLC.$name          = "HLC_0";
    TILE1.HLC.program0.$name = "HLCP_0";
    TILE1.HLC.program1.$name = "HLCP_1";
    TILE1.HLC.program2.$name = "HLCP_2";
    TILE1.HLC.program3.$name = "HLCP_3";
    TILE1.AOC_0.$name        = "AOC_0";
    TILE1.AOC_1.$name        = "AOC_1";
    TILE1.AOC_2.$name        = "AOC_2";
    TILE1.AOC_3.$name        = "AOC_3";
    TILE1.AOC_4.$name        = "AOC_4";
    TILE1.AOC_5.$name        = "AOC_5";
    TILE1.AOC_6.$name        = "AOC_6";
    TILE1.AOC_7.$name        = "AOC_7";
    
    /**
     * Pinmux solution for unlocked pins/peripherals. This ensures that minor changes to the automatic solver in a future
     * version of the tool will not impact the pinmux you originally saw.  These lines can be completely deleted in order to
     * re-solve from scratch.
     */
    clb_outputxbar1.clb_outputxbar.$suggestSolution = "CLB_OUTPUTXBAR8";
    

    I created an example .syscfg file that demonstrates this