Go Down

Topic: Using the new ATMega328P-PU in the socket Arduino Uno (Read 1 time) previous topic - next topic

Chiwos

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?

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
Two or three hours spent thinking and reading documentation solves most programming problems.

Chiwos

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?


pert

  • 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.

Robin2

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
Two or three hours spent thinking and reading documentation solves most programming problems.

Chiwos

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

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?

Robin2

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
Two or three hours spent thinking and reading documentation solves most programming problems.

CrossRoads

Quote
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.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

CrossRoads

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,
Quote
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?




Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

Robin2

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
Two or three hours spent thinking and reading documentation solves most programming problems.

pert

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.

Chiwos

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!

...

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?



Go Up