Uno with on board clock crystal - info

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.

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;

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

Oh ..f@$k your right, I saw something using this crystal for a external timer and the board look like a Uno.

@sterretje
I re winded my memory and it was the Bluepill (Stm32f) that I saw.

it was the Bluepill (Stm32f) that I saw.

I guess if you squint a little it might look like an Uno

3 Likes

Stop it, Jim :wink: I nearly spit my :coffee: over my :computer:

1 Like

Yes rub it in I deserve it .. I should win a price for the dumbest question asked in 2024.

Sorry but you set yourself up so perfectly I couldn't resist.

:+1:

1 Like

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

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.