mikedb
December 6, 2024, 10:48am
1
Hi Everyone.
On the Uno R3 there is a clock crystal on the pcb.
But searching "Uno How to use the on board clock crystal" brings up nothing.
The external clock module is very popular in use even on a Uno.
My question >>Why is the on board clock crystal never used on a Uno?
I could not find any example , video or Arduino code using the on board clock crystal to generate the 1 Second interrupt.
srnet
December 6, 2024, 10:51am
2
But it is used.
It runs the clock for the micro controller.
You can run the micro controller clock from a less accurate\stable internal source, but why would you do that when there is a more accurate external crystal to use.
I'm confused about that. Mind to explain what you mean?
The original UNO has 2 crystals.
Ref: https://docs.arduino.cc/resources/schematics/A000066-schematics.pdf
One is used by the Atmega16U2 chip that acts as an interface between the USB and the Atmega328.
This cannot be used by the programmer.
The other is used by the Atmega328 that generates all the times needed for its operation.
You can indeed use this crystal, using for example the millis() function.
If you use 1000 millis() cycles, you will have 1 second.
Ex:
int seconds = millis() %1000;
mikedb
December 6, 2024, 11:17am
7
I am referring to the 32.768Khz crystal.
@ruilviana
Not sure what you saying.
Mod edit:
Reply to deleted post removed.
Your opening post mentions Uno R3. There is no 32.768Khz on the PCB of a standard Arduino Uno R3.
1 Like
mikedb
December 6, 2024, 11:28am
10
Oh ..f@$k your right, I saw something using this crystal for a external timer and the board look like a Uno.
mikedb
December 6, 2024, 11:33am
11
@sterretje
I re winded my memory and it was the Bluepill (Stm32f) that I saw.
jim-p
December 6, 2024, 12:33pm
14
it was the Bluepill (Stm32f) that I saw.
I guess if you squint a little it might look like an Uno
3 Likes
mikedb
December 6, 2024, 12:56pm
16
Yes rub it in I deserve it .. I should win a price for the dumbest question asked in 2024.
jim-p
December 6, 2024, 1:00pm
17
Sorry but you set yourself up so perfectly I couldn't resist.
mikedb
December 6, 2024, 1:16pm
20
The Uno R4 does have the 32.768Khz crystal , without further investigating I assumed (and we all know that .. assumption is the mother of .......) that the R3 also have this clock crystal.
I've deleted what was obviously an AI response full of errors and I've deleted the replies to it.
If I missed anything let me know.
Thank you
system
Closed
June 4, 2025, 1:56pm
22
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.