ATmega328 chip on internal crystal

Hello friends!!Greetings!

I am working on a form factor constraint project where I need to save space as much as possible, so I was guessing if I could make work to use ATmega328 chip with arduino without the external crystal and I came across this link:

Pretty much easy since all the stuff is explained there. Still one thing I would like to know that what are the compromises I have to make if I implement this. I read that speed, serial communications and delays are affected by this. I wish to communicate this Atmega328 chip programmed in arduino with NRF52840 dongle and receive the data from it through serial and once it is done then store it on SD card. In later phase, I need to reveres this process as well like retreive the data from SD card and give it to the dongle via serial again. So my question is, if I happened to run my atmega chip on its internal crystal would this be possible or not? if its possible, would it be reliable?

Thanks in advance.

If you use a proper core with a choice for 8MHz internal oscillator, serial, delay and everything should work with no issues. I use the MiniCore core.

groundFungus:
If you use a proper core with a choice for 8MHz internal oscillator, serial, delay and everything should work with no issues. I use the MiniCore core.

Seems uite intresting but then would I be able to program the chip in Arduino C?

Yes. That will put another entry in the Tools, Boards menu. Choose the processor that you want and set it to 8MHz internal and burn the bootloader. Then use the IDE to program the chip normally.

groundFungus:
Yes. That will put another entry in the Tools, Boards menu. Choose the processor that you want and set it to 8MHz internal and burn the bootloader. Then use the IDE to program the chip normally.

Sorry I got it wrong at the first place. MiniCore is hardware package for Arduino IDE analogous to hardware core add-on. After I install it I will get several boards unlocked under it. This link explains it in detail

Have you tried using serial and SPI with that core and how was the overall performance and relaiblitiy? what is the baudrate that you used in serial? Does it support 9600?

I use the MiniCore exclusively for all my 8MHz 328 projects. I have seen no problems with using that core. I use Serial at up to 115200 baud, but it will probably go higher, though I have not tried it. SPI and I2C work just fine, too.

With MiniCore the crystal pins are available as regular digital IO pins.

groundFungus:
I use the MiniCore exclusively for all my 8MHz 328 projects. I have seen no problems with using that core. I use Serial at up to 115200 baud, but it will probably go higher, though I have not tried it. SPI and I2C work just fine, too.

With MiniCore the crystal pins are available as regular digital IO pins.

That Solves all of my problems then. Thanks Bro!

There are two factors that impact on the proper and reliable operation of the serial interface.

One is the divider value used to generate the UART clock. As the usual crystal values are not multiples of baudrates - such as 115200, the divider values merely approximate the correct clock and necessarily, the larger the divider value, the more accurate the approximation. This is why in general, lower baudrates are more reliable.

The second is the stability of the clock. Crystal clocks will always be perfectly stable in terms of generating baudrates while drift in the internal RC oscillator may cause problems, particularly with temperature variation. On the other hand, the oscillator calibration may be “tweaked” to cause a divider ratio to produce the exact baudrate in which case apart from whether it is practical to match the “tweak” and a given divider ratio, all baudrates so generated will be equally reliable.

groundFungus:
I use the MiniCore exclusively for all my 8MHz 328 projects. I have seen no problems with using that core. I use Serial at up to 115200 baud, but it will probably go higher, though I have not tried it. SPI and I2C work just fine, too.

With MiniCore the crystal pins are available as regular digital IO pins.

I did use the minicore but only trouble I’m facig now is I can’t upload the program to my Minicore atmega via USB. Is there any other option available for that beside firing it through ICSP each time I need to update the program?

Paul__B:
There are two factors that impact on the proper and reliable operation of the serial interface.

One is the divider value used to generate the UART clock. As the usual crystal values are not multiples of baudrates - such as 115200, the divider values merely approximate the correct clock and necessarily, the larger the divider value, the more accurate the approximation. This is why in general, lower baudrates are more reliable.

The second is the stability of the clock. Crystal clocks will always be perfectly stable in terms of generating baudrates while drift in the internal RC oscillator may cause problems, particularly with temperature variation. On the other hand, the oscillator calibration may be "tweaked" to cause a divider ratio to produce the exact baudrate in which case apart from whether it is practical to match the "tweak" and a given divider ratio, all baudrates so generated will be equally reliable.

So you wouldn't recommend going for internal clk?

I have had no issues with the mega328 processors serial communications with MiniCore 8MHz internal setups. No trouble with uploading code via serial and the IDE.

Describe what you are doing.

I have made several projects that use Atmega328s running at 8MHz with the internal oscillator. I followed this Arduino To Breadboard tutorial. I have not come across anything that would not work. Many of my projects use Serial at 500,000 baud.

I had not heard of the MiniCore before now - what advantages does it offer?

...R

MiniCore offers more flexible options: internal/external clock speeds, BOD voltages, chip variants like 168, 328, P, PB, two extra pins on 328, use of printf(), bootloader that allows Sketch to write to flash...

Robin2:
I had not heard of the MiniCore before now - what advantages does it offer?

Plus 1536 bytes more flash space and the Watchdog works properly.

Thanks for the info. None of those improvements are relevant to my programs to date - but I will keep it in mind.

...R

PS ... when I went to bookmark the MiniCore link in Reply #1 I discovered that I already had it bookmarked ... doh!

I've never run into a '328[p] with an internal oscillator off-target badly enough that serial didn't work on internal oscillator...

Count:
I did use the minicore but only trouble I'm facig now is I can't upload the program to my Minicore atmega via USB. Is there any other option available for that beside firing it through ICSP each time I need to update the program?

My guess is that you either had it wired incorrectly, or (if the upload worked once) you didn't set up the autoreset circuit correctly.

Robin2:
I have made several projects that use Atmega328s running at 8MHz with the internal oscillator. I followed this Arduino To Breadboard tutorial. I have not come across anything that would not work. Many of my projects use Serial at 500,000 baud.

I had not heard of the MiniCore before now - what advantages does it offer?

...R

I would recommend using either my cores or the MCUDude cores (depending on which supports the part you're using) for all development purposes where a specific board (like an Uno) is in use..They are designed to target chips (rather than boards) making them better suited to these purposes, and are more consistent with eachother compared to the official cores.

srnet:
Plus 1536 bytes more flash space and the Watchdog works properly.

Flash issue depends what you're comparing it to (uno uses an earlier version of the same bootloader, with the same 512b bootloader section)...
WDT reset, same deal ...

DrAzzy:
I would recommend using either my cores

I use your cores for my Attinys - thank you very much for creating them.

...R