infineon4engineers Facebook

infineon@google+ Google+

infineon@linkedin linkedin

infineon4engi@twitter twitter

infineon@youtube youtube

+ Reply to Thread
Results 1 to 4 of 4

Thread: XMC 2Go UART receive problem

  1. #1
    chepz
    Guest

    XMC 2Go UART receive problem

    Hi,
    I'm trying to send hex data array from XMC 4500 relax lite to XMC 2Go, but i still found problem on receiver.

    The received data on XMC 2Go is different with data that i sent with XMC 4500

    this code on XMC 4500 relax lite
    Code:
     uint8_t init_data[11]={0xFF,0x01,0x1E,0x18,0x40,0xFF,0x06,0x99,0x00,0x0A,0x0A};
    
    int main(void)
    {
      DAVE_STATUS_t status;
    
      status = DAVE_Init();           /* Initialization of DAVE APPs  */
    
    
      UART_Transmit(&UART_0, init_data, sizeof(init_data));
    
      /* Placeholder for user application code. The while loop below can be replaced with user application code. */
      while(1U)
      {
      }
    }
    void end_transmit()
    {
    	delay(100000);
    	UART_Transmit(&UART_0, init_data, sizeof(init_data));
    
    }
    and this code on XMC 2Go
    Code:
    	void delay(long unsigned int z)
    	{
    		while(z--)
    		{
    			__NOP();
    		}
    	}
    
    int main(void)
    {
      DAVE_STATUS_t status;
      uint8_t a[11],rec_data[11];
      uint8_t i;
    
      status = DAVE_Init();           /* Initialization of DAVE APPs  */
    
    
      /* Placeholder for user application code. The while loop below can be replaced with user application code. */
      while(1U)
      {
    	  UART_Receive(&UART_0, rec_data,sizeof(rec_data));
    	  		for(i=0;i<11;i++)
    	  		{
    	  			a[i]=rec_data[i];
    	  		}
    
    
    	 UART_Transmit(&UART_1, a, sizeof(a));
    	 delay(100000);
    
    
      }
    }
    Data that receive by XMC 2Go i send to hyperterminal on PC to monitor data. And i got this
    Click image for larger version

Name:	term.JPG
Views:	1
Size:	59.5 KB
ID:	1938

    anybody can help me?

    How to make the first data received same with first data sent?
    whats wrong with my code?

    i use Dave 4.1.4, using baudrate 9600

    thanks

  2. #2
    chismo is on a distinguished road
    Join Date
    Apr 2013
    Posts
    267
    Points
    2451.25
    Hello,

    In your test setup, is the receiver ready when the first frame is sent by the transmitter? Otherwise, the UART could wrongly detect any 1 to 0 transition from within a frame as the start bit and subsequent data can become corrupted.

    If the above is okay, then I would expect that at least, the very first set of 11 frames is correct.
    Subsequent sets depends on whether the transmitter is able to wait till the XMC2Go has echoed the data to the hyperterminal, before repeating the transmit sequence.

    Regards,
    Min Wei

  3. #3
    chepz
    Guest
    Hai

    yes, i made the receiver's ready from the first frame.

    anyway, i have solved my problem, i disable RX Fifo on xmc 2go.

    but my next question, can i make my xmc 2go reset by an APP?
    because when i combine the receiver code with data process code, the next frame received doesn't match with sender frame data.

    If i can reset xmc 2go, i think the frame data will match.

    Thanks

  4. #4
    chismo is on a distinguished road
    Join Date
    Apr 2013
    Posts
    267
    Points
    2451.25
    Hello,

    To do a system reset in an XMC device is very simple and do not require an APP.
    You just need to call the CMSIS function NVIC_SystemReset with the line:

    Code:
    NVIC_SystemReset();
    Regards,
    Min Wei

+ Reply to Thread

Tags for this Thread

Disclaimer

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.