Brand New ATMEGA328P U Chip Installing BootLoader Issues

For a big project I bought 10 ATMEGA328P U chips only to find, because they are new, they do not have a boot-loader. Research took me to this URL (URL Gammon Forum : Electronics : Microprocessors : How to make an Arduino-compatible minimal board ) that was well written back in 2012. However, after compiling both Sketch that were recommended ‘Atemga_Board_Detector’ and ‘Atmega_Board_Programmer’ I found errors in compiling.

My questions: What is the most current instructions on setting a new ATMEGA328P U Chip to accept programs? If this is it, where do I get a Sketch that will compile without errors?

Errors:
Arduino: 1.8.13 (Windows 10), Board: "Arduino Uno"

C:\Users\bill\Documents\Arduino\Atmega_Board_Detector\Atmega_Board_Detector.ino: In function 'void readBootloader()':
Atmega_Board_Detector:202:16: error: 'readFuse' was not declared in this scope
byte hFuse = readFuse (highFuse);
^~~~~~~~
C:\Users\bill\Documents\Arduino\Atmega_Board_Detector\Atmega_Board_Detector.ino:202:16: note: suggested alternative: 'extFuse'
byte hFuse = readFuse (highFuse);
^~~~~~~~
extFuse
Atmega_Board_Detector:257:14: error: 'readFlash' was not declared in this scope
showHex (readFlash (addr + i));
^~~~~~~~~
Atmega_Board_Detector:275:11: error: 'readFlash' was not declared in this scope
mem = readFlash (addr++);
^~~~~~~~~
C:\Users\bill\Documents\Arduino\Atmega_Board_Detector\Atmega_Board_Detector.ino: In function 'void readProgram()':
Atmega_Board_Detector:330:14: error: 'readFlash' was not declared in this scope
showHex (readFlash (addr + i));
^~~~~~~~~
C:\Users\bill\Documents\Arduino\Atmega_Board_Detector\Atmega_Board_Detector.ino: In function 'void getSignature()':
Atmega_Board_Detector:346:3: error: 'readSignature' was not declared in this scope
readSignature (sig);
^~~~~~~~~~~~~
C:\Users\bill\Documents\Arduino\Atmega_Board_Detector\Atmega_Board_Detector.ino:346:3: note: suggested alternative: 'getSignature'
readSignature (sig);
^~~~~~~~~~~~~
getSignature
C:\Users\bill\Documents\Arduino\Atmega_Board_Detector\Atmega_Board_Detector.ino: In function 'void getFuseBytes()':
Atmega_Board_Detector:374:12: error: 'readFuse' was not declared in this scope
showHex (readFuse (lowFuse), true);
^~~~~~~~
C:\Users\bill\Documents\Arduino\Atmega_Board_Detector\Atmega_Board_Detector.ino:374:12: note: suggested alternative: 'extFuse'
showHex (readFuse (lowFuse), true);
^~~~~~~~
extFuse
C:\Users\bill\Documents\Arduino\Atmega_Board_Detector\Atmega_Board_Detector.ino: In function 'void setup()':
Atmega_Board_Detector:396:3: error: 'initPins' was not declared in this scope
initPins ();
^~~~~~~~
C:\Users\bill\Documents\Arduino\Atmega_Board_Detector\Atmega_Board_Detector.ino:396:3: note: suggested alternative: 'init'
initPins ();
^~~~~~~~
init
Again, My questions: What is the most current instructions on setting a new chip to accept programs? If this is it, where do I get a Sketch that will compile without errors?

@billz1

Your topic was Moved to it's current location / section as it is more suitable.

Could you also take a few moments to Learn How To Use The Forum.

Other general help and troubleshooting advice can be found here.
It will help you get the best out of the forum in the future.

OK. I got it. Seems there are many ways described to BootLoad these ATMega328p chips. Some work and others, not so much, for various reasons. So, I bailed on the efforts above and found another way.

For this point in time, what worked for me was reading this posting > Arduino Forum

Which pointed me to this URL > Burning the ATMega328p Bootloader

I followed to the letter, which was very detailed, and it worked!!

Now, I have 10 ATMega328p chips that I can program with no issues.

Thanks for the update which others may find useful.

Karma.

Hello billz,
I've already prorgammed an ATmega328P Processor on a custom PCB.
Yes, you do need to burn a bootloader onto the IC before you are able to programm it.

Here's how you do it:

  • Most important is, that you have connections to the Pins of the Serial Dataline ICSP/ISP(In-System programming).
  • You need a working Arduino, you don't need any more or a ISP Programmer (for example an USBasp)
  • Open the Arduino IDE on your Computer.
  • (Only if you use an Arduino as your Programmer!: Open the Arduino as ISP sketch: File/Examples/11.ArduinoISP/ArduinoISP and upload this sketch to your Arduino. Attention!: You will no longer be able to use this Arduino unless you have another Programmer or Arduino Programmer)
  • Connect the Programmer (or Arduino) to your Processor. Allways connect GND/0V, but do not connect 5V if you are supplying 5 Volts externally. If you are using an Arduino you can find (and change if you want) the Pins in the ArduinoISP Program. Default: D10: SS/Reset - D11: MOSI - D12: MISO - D13: SCK
  • Change the Programmer Setting at "Tools/Programmers:" to the programmer you use.
  • Change the Board Setting to a Board, wich matches your specs. If you have a 16MHz Crystal on your Board you can use Boards like Arduino Nano, Arduino Mini or Arduino Uno. If your Crystal has a different frequency you need to create your own board in the "Boards.txt" File. Or maybe this could help if you need a different setting. It is a little advanced tho! :confused:
  • Open the Programm you want to upload to the Processor.
  • Press "Upload using Programmer"

Every time you connect power to your Processor the first try of programming the Processor will probably fail. Just try again!

I hope, that I was able to help you.
Best of luck

  • Helextronix