CP2102 does not worked with Atmega328p programmed through of avrdude

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

Hi,

I need help about CP2102.

I am trying burn hex in my Atmega328p using avrdude, but does not worked.

I think that atmega was burned with the Arduino's bootloader, then I tried erase the mcu, but also not worked :D

If I use Arduino IDE to burn the code, the CP2102 works, but using avrdude does not

 

 

Show this message:

 

[mutchuloko@mutchuloko Debug]$ avrdude -p m328p -P /dev/ttyUSB1 -c avrispmkII -u -U flash:w:Aula-1.hex
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_getsync(): timeout communicating with programmer

 

If I use programmer as avrisp instead avrispmkII show this message:

 

[mutchuloko@mutchuloko Debug]$ avrdude -p m328p -P /dev/ttyUSB0 -c avrisp -u -U flash:w:Aula-1.hex

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.00s

avrdude: Device signature = 0x000000 (retrying)

Reading | ################################################## | 100% 0.00s

avrdude: Device signature = 0x000000 (retrying)

Reading | ################################################## | 100% 0.00s

avrdude: Device signature = 0x000000
avrdude: Yikes!  Invalid device signature.
         Double check connections and try again, or use -F to override
         this check.

avrdude done.  Thank you.

 

Someone may I help me, please :D ????

 

MOD: 1083 empty lines removed. Please don't do this again.

Last Edited: Wed. Jul 22, 2015 - 06:03 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

Why would it work? Your CP2102 is connected to a serial port of the MCU, avrdude will have no idea what to do with that. avrdude does not work with bootloaders, it works with a micro programming pins directly.

NOTE: I no longer actively read this forum. Please ask your question on www.eevblog.com/forum if you want my answer.

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

Of course avrdude will work with bootloaders.

 

Arduino boards come out of the box with a bootloader already installed.   If you want to install a bootloader onto a bare chip or non-Arduino board,   use the Arduino IDE.   This will program the Flash and set the correct fuses and lockbits.

 

Optiboot is the most common ATmega328 bootloader.   To talk to it:

Use avrdude -c arduino if you have a DTR capacitor.

Use avrdude -c stk500v1 if you press the reset button manually

 

Obviously you have to use the correct COM port and BAUD rate.

The CP2102 will work just fine.

 

David.

 

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

Well, apparently I'm not up to date on avrdude. The last time I used it (many years ago, actually) it did not support bootloaders. My bad here.

NOTE: I no longer actively read this forum. Please ask your question on www.eevblog.com/forum if you want my answer.

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

Avrdude has always worked with many protocols and different hardware.

 

Many bootloaders use the regular stk500v1 or stk500v2 protocols.    So it just thinks it is talking to a hardware programmer.

 

The only concession to "bootloader" is the "-c arduino" programmer.    This is just the normal "-c stk500v1" protocol with a "wobble" on the DTR pin.    This wobble resets an Arduino via its DTR capacitor.    Much easier than pressing reset buttons at high speed.

 

David.

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

If I use stk500v1 or avrispmkII I need keep press the reset button, or need press many times the button?

i don't know if my mcu has arduino bootloader, but I want erase the bootloader using avrdude -e -c (stk500v1/avrispmkII). It's right?

I dont wanna use Arduino, I'd to like burn my codes in C

I connected a capacitor on same pin that is DTR connected. Iill try press reset button.

 

Tks, when get a result I post here

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

Sit down with a nice cup of tea.

 

Then think carefully what you would like to do.

 

If you want help,   explain your requirement in good English.

 

It would also help if you said what hardware programmer that you own.  e.g. an Ebay photo.  (or ArduinoISP)

 

David.

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

Hey David, I am a beginner in the bootloading process. Could you care to explain how I carry out the bootloading if I use the reset button?

JJSuriyaPrakash

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

AtomicFlea69 wrote:

Hey David, I am a beginner in the bootloading process. Could you care to explain how I carry out the bootloading if I use the reset button?

Why not stick to your own thread, instead of reviving a 7 year old thread, were there is a big chance the OP has already left a long time ago.

You first need to program the bootloader using a external programmer. Only then you can use the bootloader and a PC program to update the code in the processor.

The only other way is buy chips with a bootloader already programmed.

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

AtomicFlea69 wrote:

Hey David, I am a beginner in the bootloading process. Could you care to explain how I carry out the bootloading if I use the reset button?

Hi, what do you wanna bootload? Atmega328P?

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

I am trying to bootload an Atmega328P using the optiLoader program which I took from this github,

https://github.com/WestfW/OptiLo...

I tried the bootloaded chip on a Arduino Nano and it successfully uploaded the blink program, but when I tried it on my custom board it won't happen.

 

PFA of my schematic below,

Attachment(s): 

JJSuriyaPrakash

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

AtomicFlea69 wrote:
I tried the bootloaded chip on a Arduino Nano and it successfully uploaded the blink program, but when I tried it on my custom board it won't happen.

read the previous comments, also in your other thread.........

a new blanc chip does NOT have a bootloader. You first need to load the bootloader into the new blanc chip.......

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

Your schematic shows the symbol for a resonator as the oscillator, but the text next to it says crystal. Which is it. And if it is a crystal, where are the required capacitors? 

#1 Hardware Problem? https://www.avrfreaks.net/forum/...

#2 Hardware Problem? Read AVR042.

#3 All grounds are not created equal

#4 Have you proved your chip is running at xxMHz?

#5 "If you think you need floating point to solve the problem then you don't understand the problem. If you really do need floating point then you have a problem you do not understand."

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

It is indeed a blank chip and I bootloaded it using the optLoader program and it gets uploaded successfully!

JJSuriyaPrakash

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

I forgot to include the capacitors for the crystal in the schematic, but I have given the 22pf from the crystal to the ground. 

JJSuriyaPrakash