SAMR21: UART0 can only transmit two bytes to the PC

Go To Last Post
2 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I use UART0 to transmit a string to the PC. However, at the PC, only two bytes of the beginning of string can be read. 

 

can anyone advise me how to fix this problem?

 

Thank you!

Last Edited: Fri. Aug 24, 2018 - 07:34 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

zongyan wrote:
can anyone advise me how to fix this problem?

Not from the very scant information you've provided!

 

  • How do you know that >2 characters are actually being transmitted?
  • How are you receivign & viewing the characters on the PC?
  • etc, etc ?

 

Learn to debug: https://www.avrfreaks.net/commen...

 

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...