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.

TMS320F280025C: Trigger Ouput XBAR from Input?

Part Number: TMS320F280025C
Other Parts Discussed in Thread: C2000WARE

Hi

I'm tripping the ePWM modul from an input XBAR (TZ1 or TZ2) and would like to connect a output XBAR GPIO pin, that gives out the tripping state (OR logic of the two inputs) without any CPU interaction.

For this, I decided to use GPIO24, but I'm stuck on what is necessary for the configuration to just give out the tripping state directly from the inputs. I found the example in C:\ti\c2000\C2000Ware_4_00_00_00\driverlib\f28002x\examples\cmpss and there, the comparator submodule is configured with ramp generator and everything. Is this really necessary for just OR the inputs?

Here is my code so far, but it does not work yet:

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Select the value for CMPHNMXSEL.
ASysCtl_selectCMPHNMux(ASYSCTL_CMPHNMUX_SELECT_1);
// Select the value for CMPLNMXSEL.
ASysCtl_selectCMPLNMux(ASYSCTL_CMPLNMUX_SELECT_1);
// Select the value for CMPHPM[object Object]SEL.
ASysCtl_selectCMPHPMux(ASYSCTL_CMPHPMUX_SELECT_1,0U);
// Select the value for CMPLPM[object Object]SEL.
ASysCtl_selectCMPLPMux(ASYSCTL_CMPLPMUX_SELECT_1,0U);
//myCMPSS0 initialization
// Sets the configuration for the high comparator.
CMPSS_configHighComparator(CMPSS1_BASE,(CMPSS_INSRC_DAC));
// Sets the configuration for the high comparator.
CMPSS_configLowComparator(CMPSS1_BASE,(CMPSS_INSRC_DAC));
// Sets the configuration for the internal comparator DACs.
CMPSS_configDAC(CMPSS1_BASE,(CMPSS_DACVAL_SYSCLK | CMPSS_DACREF_VDDA | CMPSS_DACSRC_SHDW));
// Sets the value of the internal DAC of the high comparator.
CMPSS_setDACValueHigh(CMPSS1_BASE,2048U);
// Sets the value of the internal DAC of the low comparator.
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

  • Hello,

    If you're using the Input XBAR (TZ1 or TZ2) as your trip inputs then you are using only GPIO inputs. If that is true than your CMPSS peripheral configuration is redundant since this uses different ADC/CMPSS pins.

    As far as I know, you can't OR together INPUT1 (TZ1) and INPUT2 (TZ2) in the OUTPUT XBAR.

    Please clarify your input pins because I'm confused why you mention the CMPSS module at all.

  • Hi Kier, ok, but then I can map the GPIO triggers into the OUTPUT XBAR separately? It was not clear for me, that the CMPSS is not necessary for the Output XBAR. 

    I solved it:

    Fullscreen
    1
    2
    3
    4
    XBAR_setOutputLatchMode(OUTPUTXBAR_BASE, XBAR_OUTPUT1, false);
    XBAR_invertOutputSignal(OUTPUTXBAR_BASE, XBAR_OUTPUT1, false);
    XBAR_setOutputMuxConfig(OUTPUTXBAR_BASE, XBAR_OUTPUT1, XBAR_OUT_MUX01_INPUTXBAR1);
    XBAR_enableOutputMux(OUTPUTXBAR_BASE, XBAR_OUTPUT1, XBAR_MUX01);
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

  • Hi Sebastian,

    I think your DriverLib is different to my micro (F2837xD) so I can't check your code directly. However my previous statement was incorrect: You can OR together two different inputs if they are selected in two different MUXes as this diagram shows.

    For my micro the code would be:

    Fullscreen
    1
    2
    3
    XBAR_setOutputMuxConfig(XBAR_OUTPUT1, XBAR_OUT_MUX01_INPUTXBAR1);
    XBAR_setOutputMuxConfig(XBAR_OUTPUT1, XBAR_OUT_MUX03_INPUTXBAR2);
    XBAR_enableOutputMux(XBAR_OUTPUT1, XBAR_MUX01 | XBAR_MUX03);
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    Hope it helps.