ATMega328p: Strange behaviour sending bytes through USART


  • Newbie
  • *
    • Posts: 1
    • View Profile
I have an ATMega328p (MCU) connected to my computer via a USB to seal converter (BUB) from The MCU is connected to the BUB by TX, RX and GND lines. Here is the datesheet of atmega328p

To send data using the U(S)ART, I use this library, written based on many solutions that can be found on the internet, and adapted to my needs:

So, after all this introduction, the problem is that when I connect to the MCU and send a byte, I only get some ASCII answer on my terminal when TEST 2 and TEST 4 are executed (method Echo, on COM.cpp). Every time I access a char array, or a string array, inside a loop, to send the array characters, I get trash in the desktop terminal.

Do you have a guess on what can be wrong?


SMF spam blocked by CleanTalk