I'm Looking for Current 2020 Bare Bones Atmega328P Using Internal Crystal Inform

As the subject indicates, I’m Looking for Current 2020 Bare Bones Atmega328P Using Internal Crystal Information. Searching this forum and the INTERNET, plus trying a bunch, I just can’t get where I want to be.

I have URLs about this subject with dates like May, 7, 2014, Dec, 15,2015 & Aug 3, 2017. When I work through the documentation, something always goes wrong, like no longer can find links to needed files, or the provided Sketch won’t compile.(Error resolving FQBN: missing Error compiling for board ATmega328 on a breadboard (8 MHz internal clock).
).. I figure as time goes on, things change with upgrades and cleaning out servers.

You guys have been helpful in the past.

Please point me to some instructions that will help me to bootload a ATMEGA238P chip for internal 8MHz clock then install a Sketch doing something simple like PWM to a single 5 volt LED. I would like to do all with using Arduino Genuio tool, not buying any additional circuitry.

One of the previously mentioned instructions pointed me to a list of breadboard zip files and instructed me to down load the appropriate file. At this stage of my knowledge, I don’t know what the appropriate file was. I downloads all but they unzip to the same file name overlaying the previous.

Much of this may be intuitive to those that have done it one or more times in the past but there are those of us that are trying to teach ourselves. I’ll need more hand holding till I get it.

Someone please be sympathetic and understand my frustration and point me to something that WILL work.

You'll need a Programmer to set the Fuses for internal crystal and load in the bootloader.

If you also load Minicore from GITHUB into your IDE, you can easily select 8 MHz as the internal clock source.

Boy, I'm so new that I didn't realize that the Arduino Genuino was also called an IDE. I thought IDE was hard drive communication/protocols, something just before SATA.

OK. I have the UNO Kit that includes board that will allow the remoal of the ATMEGA328P chip, I have a brad board, jumper wires and several extra ATMEGA328P chips. I do have some 16MHz crystals and 22Pf caps but I want to build a bare bones circuit to NOT use the crystal.

Do you have to include the internal 8MHz option when doing the bootloader?

CrossRoads:
You'll need a Programmer to set the Fuses for internal crystal and load in the bootloader.

If you also load Minicore from GITHUB into your IDE, you can easily select 8 MHz as the internal clock source.
GitHub - MCUdude/MiniCore: Arduino hardware package for ATmega8, ATmega48, ATmega88, ATmega168, ATmega328 and ATmega328PB

I do thank you very much for the above information. For the past few hours, I have read and worked through much of the decription.

Being a newbie here, the gethub is suggesting I make decisions and I have no idea as to what decision to make. Yes, after following the instructions, I can see in the IDE where I'm prompted but again, I do not know what to select. Here is an example - 'Select what kind of programmer you're using under the Programmers menu.' There were 9 to choose from.

Are there instructions more similar to these URL that work (for one or more reasons, these are not working for me). It may very well be that I'm not understanding what they intend to convey through the instructions.

May 7,2014 https://www.instructables.com/Setup-Arduino-Software-for-Atmega328P-with-Interna/

Dec. 15,2015 Setup Arduino Software for Atmega328P with Internal Crystal on Breadboard

August 3, 2017 Arduino Without External Clock Crystal on ATmega328 - Hackster.io
See, they are step by step to include verification of the wiring from the UNO board to the breadboard.

billz1:
Here is an example - 'Select what kind of programmer you're using under the Programmers menu.' There were 9 to choose from.

From the information you've provided so far, it sounds like you will probably prefer to use the "Arduino as ISP" programmer. You can learn about that here:

If you have other specific questions, please let us know and we'll help you out.

billz1:
Boy, I'm so new that I didn't realize that the Arduino Genuino was also called an IDE.

It's not. "Arduino" and "Genuino" are trademarks owned by the Arduino company. Those trademarks are used by the Arduino company on their various physical and software products. They are also colloquially used to refer to the framework in general, even parts of it not controlled by Arduino.

One such software product is the Arduino IDE, but it's not correct to call that software product "Arduino Genuino" because that term could refer to many things.

By the way, the "Genuino" trademark is an artifact of a legal dispute over the "Arduino" trademark which was resolved years ago. So the "Genuino" trademark is no longer used and has no real relevance today other than to historians.

billz1:
I thought IDE was hard drive communication/protocols, something just before SATA.

It's true that the IDE acronym can refer to "Integrated Drive Electronics", but in this context it refers to "integrated development environment":

Thanks for all of the information. I'm so new that I don't know what I don't know.

But, what I do know is that somehow, these ATMEGA328Ps can be set up to run from the internal 8MHz clock. What I'm looking for is good, step by step instructions to help me run a PWM program from an ATMEGA328P chip in a barebones circuit using its internal 8MHz clock. I have some regulated 5 volt supplies and PWM programs that do run with a regular Arduino UNO board.

As I said before, the instructions I've tried on gethub and other placed have issues now (may have worked in the past).

Just maybe someone knows of a URL help that will work that a newbie can use.

I learn best by starting with something that works then working out from there. If I try something that doesn't work first, i have no idea what to do to fix (most of the time).

I'm fairly sure that if you have a brand new virgin 328P, then the default configuration of the chip is to run from the internal 8MHz oscillator. And, if memory serves, the chip is initially running at 1MHz because the CKDIV8 fuse bit is set.

There are plenty of examples of a standalone 328P design around. If you search for "minimum arduino circuit", quite a few should appear.

There's also an example on the Arduino website here.

If you are intending to use the internal 8MHz clock, then you can skip the step in the above link where it talks about adding the 16MHz crystal and the 22pF capacitors.

Markd833,

Thanks a bunch for this link. It is not one that popped up on any of my search or it was so far down, I never got to it. I will read and study this.

But, since I alresdy have a UNO board that is suppose to help me with serial interface to the Arduino IDE, I don't really have to purchase all of the components described. My hope was to leverage the UNO board.

Yes, you are right about the brand new ATMEGA328Ps but before I read about the barebones circuit for them, I bootloaded all using the UNO board and a 16MHz crystal. Now I want to do what it takes to have some of the ATMEGA283Ps to use the Internal 8MHz clock.

It is about not knowing at the time.

"I bootloaded all using the UNO board and a 16MHz crystal."
So do the same process, but make the part type, speed, oscillator, etc. selection from the choices that MiniCore adds to the IDE under Tools.

For example, here is the list that comes up with MightyCore, which use for '1284P chips. I would expect MiniCore for 328P would be similar. You have to select Tools and pick one, select Tools and pick the next, until you have made all your choices.

So would select Atmega328 to start. ThenL
Variant: 328P
Bootloader: Yes on UART0
BOD: disabled, or something below the voltage you are running at
Pinout, if there's an option
Clock: find the Internal 8 MHz option
etc.
(I don't have MiniCore installed, so I don't know what is presented.)

Then burn the bootloader, and the fuses should be set and running for internal 8 MHz clock.

If you had previously bootloaded them as Uno, then you may need to have that 16 MHz xtal setup connected for the chip to talk and be reburned.

CrossRoads,

You said 'If you had previously bootloaded them as Uno, then you may need to have that 16 MHz xtal setup connected for the chip to talk and be reburned.'. So you are saying that switching from 16MHz to 8MHz is a matter of the bootloader program you use and not about the chip finding or not the 16MHz crystal. And the wiring is the same to include the 16MHz crystal to communicate just this time. That clarifies things a bunch!!

I'll use the documentation I have that I used to bootload the 16MHz and select the 8MHz bootloader option. Everything else is the same. I'll get back to you.

Thanks again for your help.

Dang IT!!! I really thought I had everything right but something I got wrong.

Will someone read through this error and help

Arduino: 1.8.13 (Windows 10), Board: "ATmega328, Yes (UART0), EEPROM retained, 328P / 328PA, BOD  disabled, LTO disabled, External 8 MHz"
C:\Users\bill\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/bin/avrdude -CC:\Users\bill\AppData\Local\Arduino15\packages\MiniCore\hardware\avr\2.0.9/avrdude.conf -v -patmega328p -cstk500v1 -PCOM4 -b19200 -e -Ulock:w:0x3f:m -Uefuse:w:0b11111111:m -Uhfuse:w:0b11010110:m -Ulfuse:w:0b11110111:m 
avrdude: Version 6.3-20190619
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2014 Joerg Wunsch
         System wide configuration file is "C:\Users\bill\AppData\Local\Arduino15\packages\MiniCore\hardware\avr\2.0.9/avrdude.conf"

         Using Port                    : COM4
         Using Programmer              : stk500v1
         Overriding Baud Rate          : 19200
         AVR Part                      : ATmega328P
         Chip Erase delay              : 9000 us
         PAGEL                         : PD7
         BS2                           : PC2
         RESET disposition             : dedicated
         RETRY pulse                   : SCK
         serial program mode           : yes
         parallel program mode         : yes
         Timeout                       : 200
         StabDelay                     : 100
         CmdexeDelay                   : 25
         SyncLoops                     : 32
         ByteDelay                     : 0
         PollIndex                     : 3
         PollValue                     : 0x53
         Memory Detail                 :
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           eeprom        65    20     4    0 no       1024    4      0  3600  3600 0xff 0xff
           flash         65     6   128    0 yes     32768  128    256  4500  4500 0xff 0xff
           lfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           hfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           efuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           lock           0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           calibration    0     0     0    0 no          1    0      0     0     0 0x00 0x00
           signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00

         Programmer Type : STK500
         Description     : Atmel STK500 Version 1.x firmware
         Hardware Version: 2
         Firmware Version: 1.18
         Topcard         : Unknown
         Vtarget         : 0.0 V
         Varef           : 0.0 V
         Oscillator      : Off
         SCK period      : 0.1 us

avrdude: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.02s
avrdude: Device signature = 0x000000 (retrying)
Reading | ################################################## | 100% 0.02s
avrdude: Device signature = 0x000000 (retrying)

Error while burning bootloader.
Reading | ################################################## | 100% 0.02s
avrdude: Device signature = 0x000000

avrdude: Yikes!  Invalid device signature.
         Double check connections and try again, or use -F to override this check.

avrdude done.  Thank you.

Most of the tutorials tend to try to simplify things, using the capabilities provided by the Arduino IDE. And it's the IDE that has changed most in the last 10 years (certainly the ATmega328p itself is the same.)
To actually understand what's going on, you may want to take a step backward/upward, and deal with things from a more conceptual level.

To make an ATmega328P chip run Arduino code using it's internal 8MHz Oscillator, you need to do the following:

  • Wire up the chip correctly. Both Power and Ground pins should be connected, and you should have two small capacitors (100nF) connected; one near each set of power pins. You will need to connect the ISP pins (SPI and RESET) to a "device programmer." Jumper wires will work, but try not to let them be too long. Make sure you're using a "fresh" ATmega328p; if you take one out of an existing Arduino, it will be configure for, and require, an external crystal.
  • Using your device programmer, set the ATmega328P "fuses" to the correct value for "internal clock", "no clock divisor", "Reset to booloader", "Bootloader size is xxx" (where xxx depends on exactly which bootloader you're using. 256words (512 bytes) for Optiboot.
  • Using the device programmer, program the correct bootloader into the chip. (optional. Instead, you can continue to the use ISP programmer to "upload using programmer" any sketches you write.)
  • (optional) connect serial port to UART pins, so that you can then use the bootloader to upload sketches using the "normal" Arduino buttons.

(2 & 3 can be done together using the Arduino "Burn Bootloader" command. If the board settings are correct.)

Thanks WESTFW for the reply.

Make sure you're using a "fresh" ATmega328p; if you take one out of an existing Arduino, it will be configure for, and require, an external crystal.

Before I knew it was possible to make these ATMEGA328Ps use there internal 8MHz clocks, I boot-loaded them all using an external 16MHz crystal. Is it possible, with an extra step or 2, to set some of these already boot-loaded up for the internal 8MHz clock?

If so, will you point me to the correct steps?

Did you connect a crystal like you were setting up for an Uno, so the chip can talk to the Programmer for burning the fuses?

Did you connect a crystal like you were setting up for an Uno, so the chip can talk to the Programmer for burning the fuses?

Yes. I put a 16MHz crystal and 2 22Pf caps like the step by step instructed. I did it to all 10 of the ATMEGA328P chips I got from China. Recently I find out that my PWM program will run just great using the internal clock. I now want to make some of them use the internal 8MHz clock so I can save a little by not including the 16MHz crystal and caps.

I figured it wouldn't be much more difficult than doing a boot-load again on the same ATMEGA238P chips but without the 16MHz crystal circuit.

Is there a way to change a ATMEGA328P chip from 16MHz external clock to a 8MHz internal clock.

I'd like to know the process (steps).

Yes, you need to reprogram the fuse settings using a programmer (same programmer you used to load the bootloader should work fine).

The CKSEL fuse settings are the ones to look at.

Have a look at the Engbedded Atmel AVR® Fuse Calculator. Select the ATmega328P device and look at the first dropdown selection box under features. One of the settings is marked "default value". That will show you the values you need to program into the fuse bits.

billz1:
Is there a way to change a ATMEGA328P chip from 16MHz external clock to a 8MHz internal clock.

I'd like to know the process (steps).

Here's the instructions to do it "the Arduino way":

  • (In the Arduino IDE) File > Preferences
  • Add the following URL to the "Additional Boards Manager URLs" field (if you have multiple URLs, separate them with commas): https://mcudude.github.io/MiniCore/package_MCUdude_MiniCore_index.json
  • Click the "OK" button.
  • Tools > Board > Boards Manager
  • Wait for the update to finish.
  • Scroll down through the list of available boards packages until you see "MiniCore by MCUdude". Click on it.
  • Click the "Install" button.
  • Wait for the installation to finish.
  • Click the "Close" button.
  • Tools > Board > MiniCore > ATmega328
  • Tools > Clock > Internal 8 MHz
  • Connect your ISP programmer to the ATmega328P.
  • Connect your programmer to your computer.
  • Select the correct ISP programmer from the Tools > Programmer menu.
  • If using the "Arduino as ISP" programmer, select the port of the programmer board from the Tools > Port menu.
  • Tools > Burn Bootloader
  • Wait for the burn bootloader process to finish successfully.

I did step by step just like you said but I got an error attempting to bur the bootloader.

ERROR:

Arduino: 1.8.13 (Windows 10), Board: "ATmega328, Yes (UART0), EEPROM retained, 328P / 328PA, BOD  disabled, LTO disabled, Internal 8 MHz"
C:\Users\bill\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/bin/avrdude -CC:\Users\bill\AppData\Local\Arduino15\packages\MiniCore\hardware\avr\2.0.9/avrdude.conf -v -patmega328p -cstk500v1 -PCOM4 -b19200 -e -Ulock:w:0x3f:m -Uefuse:w:0b11111111:m -Uhfuse:w:0b11010110:m -Ulfuse:w:0xe2:m 

avrdude: Version 6.3-20190619
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2014 Joerg Wunsch

         System wide configuration file is "C:\Users\bill\AppData\Local\Arduino15\packages\MiniCore\hardware\avr\2.0.9/avrdude.conf"

         Using Port                    : COM4
         Using Programmer              : stk500v1
         Overriding Baud Rate          : 19200
         AVR Part                      : ATmega328P
         Chip Erase delay              : 9000 us
         PAGEL                         : PD7
         BS2                           : PC2
         RESET disposition             : dedicated
         RETRY pulse                   : SCK
         serial program mode           : yes
         parallel program mode         : yes
         Timeout                       : 200
         StabDelay                     : 100
         CmdexeDelay                   : 25
         SyncLoops                     : 32
         ByteDelay                     : 0
         PollIndex                     : 3
         PollValue                     : 0x53
         Memory Detail                 :

                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           eeprom        65    20     4    0 no       1024    4      0  3600  3600 0xff 0xff
           flash         65     6   128    0 yes     32768  128    256  4500  4500 0xff 0xff
           lfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           hfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           efuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           lock           0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           calibration    0     0     0    0 no          1    0      0     0     0 0x00 0x00
           signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00

         Programmer Type : STK500
         Description     : Atmel STK500 Version 1.x firmware
         Hardware Version: 2
         Firmware Version: 1.18
         Topcard         : Unknown
         Vtarget         : 0.0 V
         Varef           : 0.0 V
         Oscillator      : Off
         SCK period      : 0.1 us

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.01s

avrdude: Device signature = 0x000000 (retrying)

Reading | ################################################## | 100% 0.02s

avrdude: Device signature = 0x000000 (retrying)

Error while burning bootloader.

Reading | ################################################## | 100% 0.02s

avrdude: Device signature = 0x000000
avrdude: Yikes!  Invalid device signature.
         Double check connections and try again, or use -F to override
         this check.

avrdude done.  Thank you.

This is my breadboard wiring. I'm having trouble seeing the picture on 'Preview' so I'll use words. Looks like the picture took on the post!! I'm still learning.

Pins 11, 12, & 13 on the UNO Board are connected to pins 17, 18 & 19 on the ATMEGA328P chip wit positive 5 volts from the UNO board on pins 8 & 20 and ground on 9 & 22. Nothing else connected, no resisters, no caps, no crystals... I used this same wiring but included the crystal and 2 22Pf caps. I just removed the 2 caps and crystal.

I'm not knowing what I did wrong to correct. Somebody help me please.