Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

XMC™ Forum Discussions

User18262
Level 1
Level 1
I'm trying to connect USIC0_CH0 DX2INS to CCU40 IN0 to trigger an interrupt when DX2 does not change for a certain time. Hardware is a XMC1400 Boot Kit
USIC is set to SPI slave and data can be received/sent in all test cases.

Using P0.0 as DX2 and setting CCU40.IN0AL works perfectly fine.
P0.12 with CCU40.IN0AL configuration does not start the timer, switching to CCU40.IN0AA (uses P0.12 directly) works fine again.
I want to use P2.3 as DX2 (connected through DX5) which can not be connected directly to any CCU4 event input. CCU40.IN0AL setting is also not starting the timer.

Did I miss anything or does anyone know how to make it work?
0 Likes
2 Replies
jferreira
Employee
Employee
First like received 750 replies posted 500 replies posted
Hi,

I think you are missing the configuration of the DX2 multiplexer. (and DX5 in case of P2.3)
The P0.0 is on input A which is the default configuration and therefore works.

The P0.12 is on input E, therefore you need
XMC_USIC_CH_SetInputSource(USIC0_CH0, XMC_USIC_CH_INPUT_DX2, USIC0_C0_DX2_P0_12);

To connect P2.3 to DX2INS you will need
XMC_USIC_CH_SetInputSource(USIC0_CH0, XMC_USIC_CH_INPUT_DX2, USIC0_C0_DX2_DX5INS);
XMC_USIC_CH_SetInputSource(USIC0_CH0, XMC_USIC_CH_INPUT_DX5, USIC0_C0_DX5_P2_3);


Regards,
Jesus
0 Likes
User18262
Level 1
Level 1
For validation I added those LEDs:
if (XMC_USIC0_CH0->DXCR[2]&USIC_CH_DX0CR_DXS_Msk)
{
XMC_GPIO_SetOutputHigh(XMC_GPIO_PORT4, 2);
}
else
{
XMC_GPIO_SetOutputLow(XMC_GPIO_PORT4, 2);
}

if (XMC_CCU4_SLICE_IsTimerRunning(CCU40_CC41))
{
XMC_GPIO_SetOutputHigh(XMC_GPIO_PORT4, 3);
}
else
{
XMC_GPIO_SetOutputLow(XMC_GPIO_PORT4, 3);
}

With this CCU setting
static const XMC_CCU4_SLICE_EVENT_CONFIG_t scCcu4SliceEventConfig =
{
.mapped_input = XMC_CCU4_SLICE_INPUT_AL,
.edge = XMC_CCU4_SLICE_EVENT_EDGE_SENSITIVITY_FALLING_EDGE,
.level = XMC_CCU4_SLICE_EVENT_LEVEL_SENSITIVITY_ACTIVE_HIGH,
.duration = XMC_CCU4_SLICE_EVENT_FILTER_5_CYCLES
};

The input level of DX2 is changed without real SPI communication:
Test 1
XMC_SPI_CH_SetInputSource(XMC_SPI0_CH0, XMC_SPI_CH_INPUT_SLAVE_SELIN, USIC0_C0_DX2_P0_0); // P0.0
Result: triggers both LEDs

Test 2
XMC_SPI_CH_SetInputSource(XMC_SPI0_CH0, XMC_SPI_CH_INPUT_SLAVE_SELIN, USIC0_C0_DX2_P0_12); // P0.12
Result: only triggers P4.2 (DX2 state)

Test 3
XMC_SPI_CH_SetInputSource(XMC_SPI0_CH0, XMC_SPI_CH_INPUT_SLAVE_SELIN, USIC0_C0_DX2_P0_12); // P0.12
.mapped_input = XMC_CCU4_SLICE_INPUT_AA,
Result: triggers both LEDs

I don't understand why there's a difference. Isn't DXCR[2].DXS the same as DX2INS?
0 Likes