Help with NEW atmega chip programming with arduino board!

Plesae help me I bought a new microcontroller atmega chip same as chip on arduino when i mounted the chipnon the board and tried to upload a simple blink IDE program it shows uploading and finally shows programmer not responding
What should I do............?

Installation & Troubleshooting
For problems with Arduino itself, NOT your project

TheMemberFormerlyKnownAsAWOL:

This is not my project this is just for arduino help

My arduino was working well but as I removed chip and mounted back , It did not work well! And my question is can we mount another atmega chip on this board and should it work the same ?

Thread moved to a more appropriate section.

74younus:
This is not my project this is just for arduino help

My arduino was working well but as I removed chip and mounted back , It did not work well! And my question is can we mount another atmega chip on this board and should it work the same ?

Is here anyone to help me with with this...!

I bought a new microcontroller atmega chip

Was it advertised as having a pre-burned bootloader?

TheMemberFormerlyKnownAsAWOL:
Was it advertised as having a pre-burned bootloader?

No I have arduino UNO I removed its atmega and mounted a new bought atmega just to check if the board responds to it the same or not but I found that if the board does not the new atmega the IDE shows the sketch could not be uploaded for the arduirduino something like this. Could you tell me why this happens..!

You need to have a chip with the boot loader; the boot loader allows the chip to be programmed via the Uno's USB.

So did you buy a chip with the boot loader pre-programmed? If not, you first have to burn the boot loader if you want to make use of programming via the Uno's USB. You will need another Arduino or a programmer for that.

The boot loader for the 328P is called optiboot.

sterretje:
You need to have a chip with the boot loader; the boot loader allows the chip to be programmed via the Uno's USB.

So did you buy a chip with the boot loader pre-programmed? If not, you first have to burn the boot loader if you want to make use of programming via the Uno's USB. You will need another Arduino or a programmer for that.

The boot loader for the 328P is called optiboot.

:slight_smile: arduino ide already has this option in tools TAB "burn bootloader" should i use this option to burn atmega328........?

Yes. But you need an other Arduino (i think the sketch to be loaded in that Arduino is called Arduino as ISP) or a programmer.

Hook up your uno and the other Arduino via icsp, select ArduinoISP (again, not 100% sure what it is called) and burn the boot loader.

sterretje:
Yes. But you need an other Arduino (i think the sketch to be loaded in that Arduino is called Arduino as ISP) or a programmer.

Hook up your uno and the other Arduino via icsp, select ArduinoISP (again, not 100% sure what it is called) and burn the boot loader.

But in the first place tell me why arduino board can not program or burn a new atmega chip. I thought it would so as uno board is itself a programmer. What is relationship between at mega chip and uno board. ...!

I think I already explained it but maybe not clear enough. It's not the Uno board that contains the programmer, it's the 328P chip (if programmed with the programmer software aka boot loader).

The 328P that comes with the Arduino has a so-called boot loader programmed in it; see it as the BIOS of a PC. That boot loader is the programmer and is missing on a standard 328P that you bought.

An atmega can be programmed in two ways:

  1. in ISCP mode and a suitable programmer
  2. in USB mode with on-board serial interface and bootloader engraved in the microcontroller.-> it is case of arduino board.

To burn a bootloader the only solution is to switch to ISCP mode.

For this, a UNO card can receive a program which transforms it into an ISCP programmer.
But in this case you need inside Uno board an atmega with soon a bootloader.

This is why we are trying to make you understand that way to burn the bootloader is to have a USBasp or TynyUSB programmer or a second UNO card.

With a single UNO card you have to place your new atmega on a breadboard but you have to reconstitute the entire power supply diagram as well as the quartz diagram.

The easiest way is to buy a USBasp or tynyUSB for a few euros or to buy microcontroler with bootloader already engraved.

68tjs:
An atmega can be programmed in two ways:

  1. in ISCP mode and a suitable programmer
  2. in USB mode with on-board serial interface and bootloader engraved in the microcontroller.-> it is case of arduino board.

To burn a bootloader the only solution is to switch to ISCP mode.

For this, a UNO card can receive a program which transforms it into an ISCP programmer.
But in this case you need inside Uno board an atmega with soon a bootloader.

This is why we are trying to make you understand that way to burn the bootloader is to have a USBasp or TynyUSB programmer or a second UNO card.

With a single UNO card you have to place your new atmega on a breadboard but you have to reconstitute the entire power supply diagram as well as the quartz diagram.

The easiest way is to buy a USBasp or tynyUSB for a few euros or to buy microcontroler with bootloader already engraved.

Fortunately :slight_smile: I have two arduino UNOs
HOW to prepare it to program atmega on other uno .....?
I will follow your procedure. Line by line then.....!

1. This is the ATmega328P chip (Fig-1) that you ave bought from a shop.
Atmega328PImage.jpg
Figure-1:

2. Inside the chip of Fig-1, there are 32x1024 bytes memory locations (called Code Memory or Flash) to hold program codes. Initially, all these locations remain in "erased conditions" which means that all the locations contain FFs (all 1s). There is absolutely no program/sketch within the chips that are released by the manufacturer.

3. From users point of view, the flash memory of ATmega328P of Fig-1 has many divisions which are depicted below in Fig-2.
flashMemFac.png
Figure-2:

4. You can create a LED blinking program using Atmel Studio 7 and store the binary codes of the program into the application area of Fig-2 using a commercial ROM programmer.

5. Arduino Company also buys the same ATmega328P chip from the shop and then they do some modification on the Fuse Bits of the chip. As a result, the flash memory takes up the following divisions of Fig-3.
flashMem.png
Figure-3:

6. After that the Arduino Company stores a specialized program (called Boot Loader) into the Boot Section of Fig-3.

7. After that the Arduino Company puts the chip of Step-6 on the socket of the Arduino UNO Board.

8. The Boot Loader Program takes the binary codes of your sketch from the Arduino IDE and stores them into the application area of Fig-3.

9. After that the control goes from Boot Loader to location $0000 (0x0000) (Fig-3) from where the control again goes to location $005C which is the beginning point of your sketch that you have down loaded.

flashMemFac.png

flashMem.png

Atmega328PImage.jpg

I had the names wrong in a previous post (reply #9). The sketch to be loaded in the Arduino that you want to use as the programmer is ArduinoISP so upload that to the working Arduino.

Next you select Uno for the target (OK, in your case that was already selected), and select Arduino as ISP for the programmer. Next select burn boot loader.

2. Inside the chip of Fig-1, there are 32x1024 bytes memory locations (called Code Memory or Flash) to hold program codes. Initially, all these locations remain in "erased conditions" which means that all the locations contain FFs (all 1s). There is absolutely no program/sketch within the chips that are released by the manufactureYou can create a LED blinking program using Atmel Studio 7 and store the binary codes of the program into the application area of Fig-2 using a commercial ROM programmer Arduino Company also buys the same ATmega328P chip from the shop and then they do some modification on the Fuse Bits of the chip. As a result, the flash memory takes up the followi

After that the control goes from Boot Loader to location $0000 (0x0000) (Fig-3) from where the control again goes to location $005C which is the beginning point of your sketch that you have down loaded.

Thakyou for this info. I have seen programmers but regarding arduino board I was thinking that it is a chip along with uno board as its programmer and re-programmer
But here the story is entirely different.
How good it would have been if arduino company had made uno both so I could have program n number of chips and use them somewhere.
Which programmer do you suggest.......

But first I will use another approach in which two arduinos are used to burn boot loader and program the chip. In this way I can learn when I have no programmer how to program chips and the later method is perhaps difficult but at the end very good achievement...!

sterretje:
https://www.arduino.cc/en/Tutorial/ArduinoISP

I had the names wrong in a previous post (reply #9). The sketch to be loaded in the Arduino that you want to use as the programmer is ArduinoISP so upload that to the working Arduino.

Next you select Uno for the target (OK, in your case that was already selected), and select Arduino as ISP for the programmer. Next select burn boot loader.

  1. I will connect two arduinos to laptop/PC comports.
  2. Load ISP sketch in working arduino
  3. I will select both arduino at comports
  4. ? Where I get the ISP sketch ... In which uno I select burn boot loader and how sketch is connected with target uno please a bit more help....! Here

Did you read the link; it's in the IDE under examples.

According to the link, you don't need to connect the target board to USB; the only reason would be power but in the link that I provided the target is powered from the programmer.

You only need to select port of the Arduino that is used as the programmer; you will not have even another port if you don't connect the target to usb

@OP

We make consumer products and industrial control circuits using Arduino UNO Board in the following way:

1. We make (say 10) a number of copies of the the ATmega328P chip that has come with the UNO Board. Here copies means:
(a) We change Fuse Bits as needed to create Boot Section using commercial Parallel ROM Programmer.

(b) Then we copy the Boot Loader Program.

2. We develop product and then upload the sketch into the ATmega328P chip that has originally come with the socket of the UNO Board.

3. We took out the chip from the UNO Board and then place it in our customized board.

4. After that we put another chip from our stock (one of 10 of Step-1) into the socket of the UNO Board.