infineon4engi@twitter infineon4engineers infineon@linkedin infineon@youtube
twitter Facebook Linkedin Youtube

+ Reply to Thread
Results 1 to 7 of 7

Thread: UART Receive Problem with Dave and the XMC1300

  1. #1

    UART Receive Problem with Dave and the XMC1300

    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_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.

  2. #2
    Hi toxico,

    You can choose to use Standard Receive Interrupt where the interrupt will trigger when every data word received.

  3. #3
    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
    Click image for larger version

Name:	EndOfReceive.PNG
Views:	8
Size:	20.9 KB
ID:	1395

    If I use a normal Interrupt App I can not connect it with the Uart-App. Of course UART does not have a pin.
    Click image for larger version

Name:	Net.PNG
Views:	30
Size:	13.3 KB
ID:	1396

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



  4. #4
    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.

  5. #5
    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.

    Click image for larger version

Name:	UART1.jpg
Views:	116
Size:	150.1 KB
ID:	1424Click image for larger version

Name:	UART2.jpg
Views:	99
Size:	114.5 KB
ID:	1425

  6. #6
    New Member New Member maxd is on a distinguished road
    Join Date
    Sep 2019

    Same Boat Different Lake

    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

  7. #7

    Infineon Employee
    Infineon Employee
    jferreira will become famous soon enough
    Join Date
    Oct 2012

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

    The views expressed here are my personal opinions, have not been reviewed or authorized by Infineon and do not necessarily represent the views of Infineon.

+ Reply to Thread

All content and materials on this site are provided “as is“. Infineon makes no warranties or representations with regard to this content and these materials of any kind, whether express or implied, including without limitation, warranties or representations of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. No license, whether express or implied, is granted by Infineon. Use of the information on this site may require a license from a third party, or a license from Infineon.

Infineon accepts no liability for the content and materials on this site being accurate, complete or up- to-date or for the contents of external links. Infineon distances itself expressly from the contents of the linked pages, over the structure of which Infineon has no control.

Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Usage Terms of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Usage Terms of this site. Infineon reserves the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.