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

XMC™ Forum Discussions

Not applicable
Hi Guys,

since the exhibition "embedded world" in Germany, Im totally new in the infineon world. I got a XMC1300 and the DAVE 4 IDE. I enjoyed working with it. Very easy to use, but with the "UART" App I have a problem. I configured the app:
General: Full Duplex, 19200, 8, 1, No Parity
Advanced: 16 Oversampling, Enable transmit FIFo 16, Enable Receive FIFO: 16
Interrupt Settings: End of transmit Callback: EndOfTransmit, End of Receive Callback: EndOfReceive

From the help I have the following code and copied it to my Receive ISR.

uint8_t data[] = "Command received";
uint8_t rec_data[10];

void EndOfReceive() //Callback function for "End of receive" event.
{
UART_Receive(&MyUart, rec_data, 15);
while(MyUart.dynamic->rx_data_index == 0);
if(MyUart.dynamic->rx_data[0] == 0x0D)
{
UART_Abort_Receive(&MyUart);
UART_Transmit(&MyUart, data, sizeof(data) - 1);
}
}


My goal is, that I can input any command that ends with an carriage return. As a second step I want to differ between different commands.
I expected, that the routine starts if something received. After that it starts the receiption which is aborted by receiving a carriage return.
But it doesnt work.

I also tried to disable the endoftransmit and endofreceive functions and copied everything to the while loop. But this does also not work.

How can I reach my goal.
The easiest way would be if I had an ISR if one character is received.
0 Likes
6 Replies
Not applicable
Hi toxico,

You can choose to use Standard Receive Interrupt where the interrupt will trigger when every data word received.
0 Likes
Not applicable
Hi Jackson,

thanks a lot for your support and sorry for asking further. I don't got it yet.
What do you mean with standard interrupt? In the uart App I can only select EndOfReceive
1221.attach

If I use a normal Interrupt App I can not connect it with the Uart-App. Of course UART does not have a pin.
1222.attach

So what exactly do you mean with "Standard Receive Interrupt"? I really don' have a clue.

thanks

toxico
0 Likes
Not applicable
Hi toxico,

Sorry to confuse you.
I'm referring to the interrupt that available on the product itself rather than the setting available on DAVE4.
Our USIC module does support the interrupt of receiving each byte and is called Standard Receive Interrupt.
Let me go though the APP on DAVE4 on how to do this setting.
0 Likes
Not applicable
Hi toxico,

After looking at the DAVE4 UART APP, it seems the use case only support FIFO.
So in this case, to receive one byte each time, you have to use the xmc_uart XMCLib for your application.
In the UART APP, disable the FIFO setting (uncheck the enable FIFO box) in 'Advance Setting' and don't set anything on the 'Interrupt Setting'.
After you have generated the code, go to the file uart_conf.c under UART folder.
Add your receive function declaration with extern (i.e.: extern void StandardReceived (void)) to that file and replace your function in UART_0_rx_handler().
Then in your main.c, add the enable interrupt for Standard receive with XMC_UART_CH_EnableEvent(XMC_UART0_CH1,XMC_UART_CH_EVENT_STANDARD_RECEIVE);
Then, add your receive function and use XMC_UART_CH_GetReceivedData to get your received data.

Note: With this workaround, should you need to regenerate your code again, you have to add back the code that you have made in uart_conf.c after code generation.

1250.attach1251.attach
0 Likes
User17973
Level 1
Level 1
Hi, I'm having a weird issue with the UART on XMC1300 as well.

I generated code through DAVE for ints and rx FIFO and get break ints and rx noise ints ok but I never see the rx FIFO int happen.

Is there some magic setup that DAVE doesn't do ie. has to be done manually or something?

Is there perhaps an int example somewhere that I can download?

I turn an LED on to prove that the break has occurred and have code to turn it off when rx bytes come in but that's in the callback doesn't get called.

I have greatly diminished my residual follicles on this exercise, Please help if you can
0 Likes
jferreira
Employee
Employee
First like received 750 replies posted 500 replies posted
Hi,

Normally the UART APP is straightforward to use. Did you check the Usage section in the UART APP documentation?
Could you share your project?

Regards,
Jesus
0 Likes