XMC4800 receive interrupt

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

cross mob
User14248
Level 1
Level 1
First like received
Hello,

I am working on the XMC4800 and implementing a receive interrupt. Somehow the interrupt is not working but the data can be readout using function UART_GetReceivedWord
the call back function is
void IRQ_Hdlr_90(){
volatile uint8_t aaa = 8;
bms_uart_flag = 1;
}

interrupts are set in the uart_conf.c

/*Set service request for UART protocol events*/
XMC_USIC_CH_SetInterruptNodePointer(XMC_UART1_CH0, XMC_USIC_CH_INTERRUPT_NODE_POINTER_PROTOCOL,
1U);
/*Set service request for rx FIFO receive interrupt*/
XMC_USIC_CH_RXFIFO_SetInterruptNodePointer(XMC_UART1_CH0, XMC_USIC_CH_RXFIFO_INTERRUPT_NODE_POINTER_STANDARD,
0x0U);
XMC_USIC_CH_RXFIFO_SetInterruptNodePointer(XMC_UART1_CH0, XMC_USIC_CH_RXFIFO_INTERRUPT_NODE_POINTER_ALTERNATE,
0x0U);
/*Set priority and enable NVIC node for receive interrupt*/
NVIC_SetPriority((IRQn_Type)90, NVIC_EncodePriority(NVIC_GetPriorityGrouping(),
15U, 0U));
NVIC_EnableIRQ((IRQn_Type)90);

the interrupt is also enabled in the main funciton. What could be the problem? Where did I miss?
Thank you.
0 Likes
2 Replies
User18552
Level 1
Level 1
Hi,

You need to enable the USIC channel to generate interrupts.

If you're using the Infineon UART app code, you can call the UART_StartReceiveIRQ() routine.

If you want to handle all the buffering on your own, you can simply call:

XMC_USIC_CH_EnableEvent(handle->channel, (uint32_t)((uint32_t)XMC_USIC_CH_EVENT_STANDARD_RECEIVE | (uint32_t)XMC_USIC_CH_EVENT_ALTERNATIVE_RECEIVE));

Note that the call above does not use the USIC FIFO If you want to use the USIC FIFO, see the code inside UART_StartReceiveIRQ() for how to handle the FIFO.

rgds,

Gary
0 Likes
User14248
Level 1
Level 1
First like received
GaryKercheck wrote:
Hi,

You need to enable the USIC channel to generate interrupts.

If you're using the Infineon UART app code, you can call the UART_StartReceiveIRQ() routine.

If you want to handle all the buffering on your own, you can simply call:

XMC_USIC_CH_EnableEvent(handle->channel, (uint32_t)((uint32_t)XMC_USIC_CH_EVENT_STANDARD_RECEIVE | (uint32_t)XMC_USIC_CH_EVENT_ALTERNATIVE_RECEIVE));

Note that the call above does not use the USIC FIFO If you want to use the USIC FIFO, see the code inside UART_StartReceiveIRQ() for how to handle the FIFO.

rgds,

Gary


Thank you for your help! it is very useful. It works now.