In reading up the Atmega328 specs, it talks a fair bit about clocking on PB6 & 7. All the Uno schematics I’ve seen use and external crystal into PB6/7 but I’m not sure that’s necessary.
From the Specs: “The device is shipped with internal RC oscillator at 8.0MHz and with the fuse CKDIV8 programmed, resulting in 1.0MHz system clock. The startup time is set to maximum and time-out period enabled. (CKSEL = “0010”, SUT = “10”, CKDIV8 = “0”). The default setting ensures that all users can make their desired clock source setting using any available programming interface.”
Did you mean to post this as a new topic? Were you replying to something?
FYI, Nick Gammon has some great info on the different timers on board the 328P here:
And here’s a document on calibrating the internal oscillator:
New topic. It relates back to a design I started last year but Uni got in the way.
I need a fair few digital pins and also need to minimise my component count.
The atmega can run off an internal oscillator - no problem
Precise timing from a crystal is useful if you intend to use UART - which has stricter timing requirements than the oscillator can provide (at higher baudrates).
Put simply, if you want to use UART at > 9600baud then you’ll likely need an external crystal. Otherwise you’re good to go!
Thanks Liam, Michael,
That’s pretty helpful info.
I removed the UART from the schematic and will plug the UART in at programming time.
Atmega328P definitely works with internal RC oscillator.
Can confirm from personal experience. Once tried to make a clock with minimal number of components. Could never get it as accurate as a bedside clock, but it did work.
I used the ICSP interface to load programs, if I remember right.
The bootloader needs to be changed if you change from the standard 16MHz crystal.
If you need more GPIO pins you could try the Atmega32U4 or an Atmega 2560 board.
Really depends on what you want to do and what facilities you have access to.
There are a number of boards with the Atmega32U4 that may work for you.
I finished the schematic and the number of IO pins worked out such that I can leave the crystal in place. I ended up using an LM324 to do some of the error detection I built in. I used MultiSim to do some simulation which is a pretty handy tool.