Go Down

Topic: How can I communicate Serially with an Atmega328 (Read 721 times) previous topic - next topic

L. DaVinci

I have set an Atmega328 on a board and programmed it with avrdude and a R3 UNO board as shown in the image


the code that is uploaded on it contains some Serial communications
Serial.print("....");
How can I see what it sends , without the need of any extra hardware  ?
Thanks in advance.

strykeroz

Hi,

What were you hoping to view it on? If it's your PC then you're going to need something to convert that RX/TX signal to USB (say) that a serial terminal program can interpret on the PC.  If you have a serial display of some kind (I2C character LCD for example) you could change the Serial.print calls to lcd.print and see it that way.  Otherwise if you're debugging a standalone ATMega board, using LEDs to indicate program states is a simple alternative also.

What kind of information are you needing to see from your sketch?

Cheers ! Geoff
"There is no problem so bad you can't make it worse"
- retired astronaut Chris Hadfield

afremont

I believe that if you connect the serial output pin of the other chip to pin 0 (RX) you will be able to see it on the serial monitor as long as the baud rate is correct.
Experience, it's what you get when you were expecting something else.

L. DaVinci

I want to view it on my PC and it is basically Strings..
The problem is that , everything now is soldered so connecting it to an LCD would need a lot of time.
What If I removed the Atmega328 from the UNO board then connected the TX , RX pins from the Atmega328 to the UNO board , will that work ?

strykeroz


What If I removed the Atmega328 from the UNO board then connected the TX , RX pins from the Atmega328 to the UNO board , will that work ?
Yes, that sounds like a good option for the gear you have on hand.  With the Uno powered up the USB functionality will be provided that you need to view the strings on the Arduino IDE's serial monitor.
"There is no problem so bad you can't make it worse"
- retired astronaut Chris Hadfield

Go Up