Using the new ATMega328P-PU in the socket Arduino Uno

Immediately I apologize for my English, because I write through a translator.

I followed all the instructions for writing a new bootloader ATMega328P-PU chip, which came to me from China. Use the scheme, do not use additional components, only the Arduino board and the chip itself.

Guide: https://www.arduino.cc/en/Tutorial/ArduinoToBreadboard

Used Arduino IDE 1.0.5 r2 and the corresponding version of the library, as to version 1.6.6 did not work.

However, today all is well: I wrote the bootloader and moreover even tested the operation of the new chip. But I can write to the chip only when it is set to breadbord.

The question that interests me very much: what should I do in order that we could use the new chip in the socket, that is, as the original? Is that possible?

Have you installed the bootloader for 16MHz operation?

You have not told us what error messages you get when you try to use the chip on the Uno.

Nick Gammon's program for detecting chips may help to diagnose the problem.

...R

Robin2:
Have you installed the bootloader for 16MHz operation?

You have not told us what error messages you get when you try to use the chip on the Uno.

Nick Gammon's program for detecting chips may help to diagnose the problem.

...R

I used boards.txt unchanged, as far as I remember there is set atmega328bb.build.f_cpu = 8000000L. If I understand your question.

At the expense of the error I can not say anything until I get home and not restarted entry into the chip.

UPD: atmega328bb.bootloader.file=ATmegaBOOT_168_atmega328_pro_8MHz.hex
Apparently I really set 8MHz. Nevertheless, I still do not understand. I would be immensely grateful if you could explain what the difference is and that really necessary?

  • Plug the ATmega328P into the Uno
  • Connect the programmer to the Uno
  • Plug the programmer into your computer
  • Tools > Programmer > select the correct programmer
  • Tools > Board > Arduino/Genuino Uno
  • Tools > Burn Bootloader
  • After the Burn Bootloader operation is complete, disconnect the programmer from your computer
  • Disconnect the programmer from the Uno

The Uno should now work as usual.

Chiwos:
Apparently I really set 8MHz. Nevertheless, I still do not understand. I would be immensely grateful if you could explain what the difference is and that really necessary?

The 8Mhz setting is not going to work when the chip is plugged into the socket on an Uno because the oscilator on the Uno board works at 16MHz.

...R

pert, thank you, but unfortunately I do not have anything except the Arduino Uno. =(

Robin2:
The 8Mhz setting is not going to work when the chip is plugged into the socket on an Uno because the oscilator on the Uno board works at 16MHz.

...R

I do not understand why I did it was not clear before. After all, I read as many articles on the subject, but only after your words, I understand the value of 16MHz oscilator. Many thanks!

I assembled all the components to breadbord to use 16MHz oscilator and 10K resistor, but without the use of a capacitor (see that this is done without them in some cases).

Programmer has been chosen Arduino as ISP;
The price chosen Arduino Nano;
The loader is successfully loaded, but with a message:

***failed;
avrdude: WARNING: invalid value for unused bits in fuse "efuse", should be set to 1 according to datasheet
This behaviour is deprecated and will result in an error in future version
You probably want to use 0xfd instead of 0x05 (double check with your datasheet first).

I understand that this is just a warning, but it is worth paying attention to it and take corrective action?

Now there's another question: this loader recording scheme enables the chip in the socket, but if you need to use a chip without Arduino Uno is it correct to use with or without oscilator him?

Chiwos:
but if you need to use a chip without Arduino Uno is it correct to use with or without oscilator him?

I'm not sure if I understand that as you intended. I use Atmega328 chips in projects without using an Uno and I always use the internal 8MHz oscillator as that minimizes the number of external parts. Of course my Atmega328s will not work on an Uno.

I don't know the anwers to your other questions.

...R

Of course my Atmega328s will not work on an Uno.

Why not? Just need to select the right board type for the bootloader you have installed to download code, no?

Or if no bootloader, then download code via ICSP.

I build my boards to run from 16 MHz crystal & caps. Always have the option to not install those and run internally like you do, but the pads are there if you do want to use them.

0xfd instead of 0x05 -> 0b11111101 and 0b00000101
Extended fuse (efuse) only uses the 3 right bits, the 5 on the left are unused and often read back as 1s. The warning can be ignored, or you can change the boards.txt setting from 0x05 to 0xfd to make it go away.

If you want to run with no crystal, just the internal RC oscillator, you need to make the low fuse byte have 0010 in its 4-right hand bits.

"Calibrated Internal RC Oscillator 0010"
If the chip was already set up as an Uno, it needs to have a crystal connected to be able to change the fuses to run without a crystal.

Robin2,

I always use the internal 8MHz oscillator as that minimizes the number of external parts.

What board type do you select for that? Or, do you have a custom board set up in boards.txt that you can share?

CrossRoads:
Why not?

I meant that the ones I have bootloaded for 8MHz won't work on an Uno - i.e. they are not interchangeable in the way that one with the 16MHz bootloader would be.

...R

Chiwos:
avrdude: WARNING: invalid value for unused bits in fuse "efuse", should be set to 1 according to datasheet
This behaviour is deprecated and will result in an error in future version
You probably want to use 0xfd instead of 0x05 (double check with your datasheet first).

I understand that this is just a warning, but it is worth paying attention to it and take corrective action?

Just ignore it. If the behavior(workaround for changed unused fuse bits handling) is ever deprecated(which may never happen) by Arduino they will also change the fuse values at the same time. The only possible concern if that ever happened would be certain 3rd party hardware packages but that's irrelevant for you since you're using an official Arduino boards definition.

pert:
Just ignore it. If the behavior(workaround for changed unused fuse bits handling) is ever deprecated(which may never happen) by Arduino they will also change the fuse values at the same time. The only possible concern if that ever happened would be certain 3rd party hardware packages but that's irrelevant for you since you're using an official Arduino boards definition.

Many thanks!

CrossRoads:
...

I build my boards to run from 16 MHz crystal & caps. Always have the option to not install those and run internally like you do, but the pads are there if you do want to use them.

If I understand you, and both schemes use the chip in its own board are correct? Using the crystal gives any advantage?