hsieh3k:
- Why use the Arduino default 8MHz Internal doesn't work? (I follow and got the 8MHz boards.txt from the link:
https://www.arduino.cc/en/Tutorial/ArduinoToBreadboard)
Something wrong with it's bootloader code? or upload ?
I have also experienced this with the "breadboard" hardware package. What I notice is that the upload speed for the "ATmega328 on a breadboard (8 MHz internal clock)" board in the "breadboard" hardware package is 57600. The upload speed for the MiniCore ATmega328P, 8 MHz internal board is 38400. The actual baud rate on the microcontroller differs from a given target baud rate according to the clock speed. According to this table:
https://cache.amobbs.com/bbs_upload782111/files_22/ourdev_508497.html
at 8 MHz, the baud rate at the target of 38400 is only off by 0.2%. The baud rate at the target of 57600 is off by 3.7%. On top of that, we have the fact that the internal oscillator is less accurate than an external crystal or resonator. That inaccuracy may end up pushing the baud error of the microcontroller ever farther off. If the actual baud rate of the microcontroller differs enough from that of the computer, communication fails.
You could actually test this fairly easily because MiniCore also provides a bootloader for the ATmega328P, 8 MHz internal board that is compiled for 57600 baud communication. You would need to edit line 130 of the MiniCore boards.txt from:
328.menu.clock.8MHz_internal.upload.speed=38400
to:
328.menu.clock.8MHz_internal.upload.speed=57600
Restart the Arduino IDE, select the MiniCore's ATmega328P, 8 MHz internal board, Burn Bootloader, then try an upload.
I was going to give it a try, but the two ATmega328P boards I have close to hand are currently working even with the "breadboard" hardware package so I can't currently reproduce the issue.
hsieh3k:
2. The Minimum Circuit diagram need to have the X'tal there. (Only if you change Oscillator from internal to internal "1M to 8M or 8M to 1M", you don't need the X'tal.) Others : if changing from external to internal/external or internal to external ..... you do need it. So my suggestion is always connect the X'tal when you are burning the bootloader. Please also see the attached drawings (Fig.6).
If you have set the fuses to use an external clock source, the CPU of the microcontroller will not run, not even enough to change the fuses back to the internal oscillator. For this reason, you need to have an external clock source connected when changing the fuses from external clock to internal oscillator. If the fuses are already set to use the internal oscillator, then there is no point in connecting a crystal. When the ATmega328P comes from the factory, the fuses are set to use the internal oscillator. However, if you buy an ATmega328P "with Arduino bootloader", that chip will have its fuses set to use an external clock (because they configured it like an Uno).