UART communication issue (ATmega1284P)

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

Hi Guys,

 

This is a continuation of this thread: https://www.avrfreaks.net/forum/u...

 

So today I bought a MAX3232 connected to my AT and it seems to be working well. I can see the 'c' coming at the PC side.

 

However I realized that right after when I connect the battery to the circuit, the AT sends a few '0's rather than 99 (aka 'c').

Is that because the MCU has not yet 'booted' / initialised yet ? Or why this happens ?

 

Here is the output:

* Better historically to paste your image into the thread unless you guarantee to keep your personal website link alive FOREVER! Moderator. *

 

Thanks,

Mitya

This topic has a solution.
Last Edited: Sat. Mar 3, 2018 - 12:00 PM
This reply has been marked as the solution. 
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

It is very common - even normal - to get glitches at startup.

 

On a serial line, these can easily be interpreted as "junk" characters.

 

So this is pretty much "normal behaviour"

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...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Ok, thanks awneil, I am happy then...

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

Async serial lines idle High or Mark, so before the device is power up and initialized, the line is most likely floating or LOW, which is mistaken as possible data.

Just to answer the why in the above question.

 

Jim

 

 

 

 

(Possum Lodge oath) Quando omni flunkus, moritati.

"I thought growing old would take longer"

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

A 10K pull up resistor on the TX line helps.

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly