Mar 03, 2020
08:06 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Mar 03, 2020
08:06 AM
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.
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.
- Tags:
- IFX
2 Replies
Mar 03, 2020
10:07 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Mar 03, 2020
10:07 AM
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
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
Mar 04, 2020
01:45 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Mar 04, 2020
01:45 AM
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.