Program uploading problem in atmega328

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

Can i upload program in atmega 328 directly through rs233 usb to ttl converter after uploading the boatloading program in it

This topic has a solution.

<p>Kunal Gupta</p>

Last Edited: Tue. Jan 7, 2020 - 06:03 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

YOu first have to use an ISP programmer to flash the bootloader, but then yes, you can use a serial usb to ttl cable connected to the usart pins to upload new programs.

See Arduino! In fact why not use an arduino hardware platform, so much easier then bare chips and most likely cheaper too!

Uno or for bread board use, a Nano or pro-micro (sometimes called Leonardo) works well.

 

Jim

 

Click Link: Get Free Stock: Retire early! PM for strategy

share.robinhood.com/jamesc3274
get $5 free gold/silver https://www.onegold.com/join/713...

 

 

 

 

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

Yes so i have uploaded bootloader program in ic from usbasp by connecting MOSI - MISO pins .
Then i want to use ftdi rs232 usb to ttl converter which uses serial communication pins (Rx and Tx pins) for programming my atmega 328 ...
So should it work.

Saying for Arduino platform i know about it and have worked on it now i want to use atmega 328 using embedded c

Also another question can we say that when we are uploading program in Arduino we use serial communication that is we connect rx tx pins of Arduino to laptop rx tx pins through usb cable????????

<p>Kunal Gupta</p>

Last Edited: Thu. Dec 5, 2019 - 03:13 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Kunalgupta wrote:
should it work

YEs - that is the whole point of a bootloader!

 

Your code will, of course, have to be written to be compatible with any specific requirements of the chosen bootloader.

 

And you will need to follow the correct procedure to get the bootloader in "loader" mode ...

 

Kunalgupta wrote:
Also another question can we say that when we are uploading program in Arduino

I know Arduino call it "UPloading", it should really be called downloading - going from the (usually more powerful) "Host" to the "Target" is conventionally called "down"

 

Kunalgupta wrote:
we use serial communication that is we connect rx tx pins of Arduino to laptop rx tx pins through usb cable

Essentially, yes.

 

Physically, the microcontroller's Tx & Rx pins connect to the Rx & Tx pins of the USB-to-UART converter; the laptop itself does not have real Rx & Tx pins - they are "virtual".

 

EDIT

 

If you did have a real COM port on the laptop - with real Rx & Tx pins - you should not connect them direct to a microcontroller!

 

A real COM port works at RS232 voltage levels - around +/-12V - which are not compatible with microcontroller pins!

 

Same applies to a USB-to-RS232 converter.

 

In that case, you would need an RS232 Transceiver - traditionally a MAX232 - to convert the voltage levels (among other things).

 

https://www.maximintegrated.com/en/design/technical-documents/tutorials/2/2020.html

 

https://learn.sparkfun.com/tutorials/serial-communication

 

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...
Last Edited: Thu. Dec 5, 2019 - 09:54 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Kunalgupta wrote:
another question can we say that when we are uploading program in Arduino we use serial communication that is we connect rx tx pins of Arduino to laptop rx tx pins through usb cable????????

When discussing hardware connections, it is BEST to show a schematic rather then try to explain the connections in words (1 picture is worth a thousand words), it is much faster to show a schematic as it does not suffer from language translation errors!!!   

See Andy's tip #1 for how to post code and pictures.

When you say things like " rs233 usb to ttl converter " that makes no sense, as RS232, USB and TTL are three different things.

There are USB serial to RS232 converters, there are USB serial to TTL converters, there are RS232 to TTL converters, which of these three are you actually talking about?

 

Jim

 

 

 

Click Link: Get Free Stock: Retire early! PM for strategy

share.robinhood.com/jamesc3274
get $5 free gold/silver https://www.onegold.com/join/713...

 

 

 

 

Last Edited: Thu. Dec 5, 2019 - 02:38 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

ki0bk wrote:
When discussing hardware connections, it is BEST to show a schematic rather then try to explain the connections in words

Absolutely!

 

 

 

 it is much faster to show a schematic as it does not suffer from language translation errors!!!   

Indeed.

 

See Andy's tip #1 for how to post code and pictures.

laugh

 

When you say things like " rs233 usb to ttl converter " that makes no sense, as RS232, USB and TTL are three different things.

Indeed.

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...
Last Edited: Thu. Dec 5, 2019 - 02:53 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

i am using rs232 usb to uart programer ...the screenshot of the programmer i have uploaded screenshot(118).

 

and i am getting this error when i am using this.(another screenshot(90)).

 

 

Attachment(s): 

<p>Kunal Gupta</p>

This reply has been marked as the solution. 
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The board you are using is not a ‘programmer’ it is simply a usb to serial board. Avrdude is obviously not happy, so where did you get your Avrdude from? And why are you choosing ttl232 as a programmer?

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

Kunalgupta wrote:

i am using rs232 usb to uart programer ...the screenshot of the programmer i have uploaded screenshot(118).

 

and i am getting this error when i am using this.(another screenshot(90)).

 

 

Use a USBASP, for instance from extremeelectronics, (good product).

I use the Arduino IDE with MCUDUDE's mighty/minicore to program bare Atmega8/328/16 or 32. Code can be uploaded using CTRL+Shift+U.