Error when trying to program an atmega328p with an Arduino Uno

Hello,

I am working with an Arduino UNO and an atmega328p, the problem is that the old chip, was used for a different project. When I bought a new one for a new project and put it in the Arduino (not a protoboard) I was not able to upload any code, not even blink, or Arduino ISP, I selected the Arduino as ISP option and searched on yt and forums. Still, the only results I found were people that put the chip in the protoboard, but I have none and I want to program it in the Arduino if this is not possible then I will try to find a protoboard and I will tell you if it works with it.

Error messages (I don't think you need it):

Arduino: 1.8.19 (Windows 10), Board: "Arduino Uno"

Sketch uses 4354 bytes (13%) of program storage space. Maximum is 32256 bytes.

Global variables use 482 bytes (23%) of dynamic memory, leaving 1566 bytes for local variables. Maximum is 2048 bytes.

avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x6c
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x6c
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0x6c
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0x6c
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0x6c
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0x6c
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0x6c
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0x6c
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0x6c
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x6c

Problem uploading to board.

By the way, I have no circuit I just have the Arduino and the chip, if I need a circuit please let me know. Thanks if you help me!

By default, the chips sold are programmed to use an internal generator, while the Uno board uses an external clock source. Therefore, you cannot just take and insert a new chip to replace the old one.
You must first change the FUSES to use an external oscillator. This can be done by flashing the Uno bootloader through Arduino as ISP sketch. It is necessary to flash the Arduino as ISP sketch not into this controller, but into another arduino. The chip can be inserted directly into the Uno board, no protoboard needed

1 Like

So I need two Arduino instead of a protoboard?

Yes, indeed

So I need another Arduino to program the chip but how? do I use the RX and TX pins or what?

Did you read tutorial at the link above? It contains detailed explanation how to use Arduino as ISP code, how to connect arduinos.... etc

But is there a way to use the Arduino only? I mean, just the Arduino and the chip in it

No, you need either two arduinos, or one arduino and programmer like USBasp

I have non of them right now, what shall I do?

A few components are required for the naked chip to work at all. Follow this excellent tutorial to create the minimum "bare bones" Arduino. Then you can use the working Arduino to program the new chip.

Perhaps a friend with any -328P board will assist you. Some hackerspaces have UNO boards (or Nano.)

Adafruit sells the chip pre-programmed, but I checked and it is out-of-stock.

In any case, you need TWO arduino controllers
So you have to ask someone else or buy another one

1 Like

I just found an Arduino mega, will that work?

yes, see the tutorial in the post #4

But if it was in stock I couldn't buy it cause I need that as soon as possible and I am in Colombia, pretty far from U.S or whatever and the shipment would take days to come

Oh I forgot, I already see it, I will try with the mega hope that it works, so the thing that I understood from that was that when I am done with the circuit then I will upload the code to the programmer and then I need to burn the bootloader and that's it I guess

So when I am done uploading the code to the chip I can do whatever I want with it? Like turning on LEDs or reading button signals or it is limited for a number of things? and also, I program it with the same language or there is another one for it?

You just pop the chip back into the UNO socket. There are YouTube vids on this.

arduino load optiboot uno youtube - Search (bing.com)

wdym that put the chip back? so when I upload the code to the chip there's nothing to do with it if I don't put it back in the uno?

Self-explanatory?

1 Like