Crystals and accuarity

Why do some boards have multiple crystals,I was looking at STM32F103C8T6 and it has 8Mhz crystal and it also has 32.768.What does that mean? So when I would make delay(86 400 000); (It's 24 hours) what crystal would it use? would it automatically use 32.768 one or it would use 8 one (I would like to use 32.768 one,ofcourse).If I can use 32.768 one for delay then I don't need RTC :slight_smile:
So my question is,what crystal is being used for delay?

The MCU's are designed to be able use both. The 32768Hz is precise for timekeeping use and second crystal is for main clock.

For timekeeping it is usually possible to use RTC circuit with better accuracy and stability than crystal but it has no meaning if it is implemented inside of MCU on the die.

So,I can use delay(86 400 000); and get it accurate (within 10 minutes),right?

In theory yes. It depends on precision of the crystal and implementation of delay (if it uses the RTC).

I'm pretty sure the Arduino "delay()" uses internal timers, not the internal RTC, so the error will be proportional to the 8 MHz crystal accuracy. I'd expect something on the order of 1E4 for a "computer grade" crystal so about 10 seconds per day. The 32.768 kHz crystal ought to be better than that but one never knows with generic boards and you'd have to figure out how to use the RTC.

So,it won't use 32.768 crystal?

It is possible to run the realtime clock on those STM32 chips off the low speed external crystal; It may or may not be done that way, and you may or may not have to do something to tell it that there's a crystal there.

This is all dependent on the implementation in whatever core you're using to add support for those chips, so you should consult their documentation. I don't hear talk of STM32 here much, so I think they probably have their own forum too.

I'm using it with arduino IDE using GitHub - rogerclarkmelbourne/Arduino_STM32: Arduino STM32. Hardware files to support STM32 boards, on Arduino IDE 1.8.x including LeafLabs Maple and other generic STM32F103 boards
Also,is arduino nano same as pro mini?

Roger Clark is lead person around STM32, for me at least. I'm recommending to visit his web www.stm32duino.com.
I think, you can obtain the best info about STM32 there.

Nano isn't same as pro mini, but both have same MCU - ATmega328P. Nano has USB. Pro mini needs USB/serial converter. It has no USB port for direct connection to the PC. Read more in Products section.

A Nano is essentially a pro mini with a serial adapter built in. This is convenient, but makes them more expensive and increases the idle power consumption and board size by a bit.

Thanks that's what I was wondering.I'll be ordering SMD atmega 328p and I'll be making my own arduinos

Nikola19992:
Thanks that's what I was wondering.I'll be ordering SMD atmega 328p and I'll be making my own arduinos

For hand soldering small SMT parts, I highly recommend a knife tip if your iron supports it. I have one and it is beyond awesome, easily my favorite tip for general-purpose use. With a flux pen, I've had no trouble soldering things like SOT23.

Jiggy-Ninja:
For hand soldering small SMT parts, I highly recommend a knife tip if your iron supports it. I have one and it is beyond awesome, easily my favorite tip for general-purpose use. With a flux pen, I've had no trouble soldering things like SOT23.

Learn to drag solder - it's not that hard, and you can quickly solder SMD parts that at first glance would look unsolderable by a human. Works with any normal tip (preferably one that's not super small - you actually want a tip that looks larger than you'd ever imagine using on fine pitch SMD parts), too, so you don't have to swap tips (which is time consuming unless your hands are fireproof).

DrAzzy:
Learn to drag solder - it's not that hard, and you can quickly solder SMD parts that at first glance would look unsolderable by a human. Works with any normal tip (preferably one that's not super small - you actually want a tip that looks larger than you'd ever imagine using on fine pitch SMD parts), too, so you don't have to swap tips (which is time consuming unless your hands are fireproof).

You think I can't? I've watched the tutorials. First time I tried I had no problem with 0805s or a 32 pin TQFP, but the damn SOT23 transistor pissed me right off and took multiple attempts The end result still looks like crap.

The knife tip is like magic in comparison. I soldered a SOT23-6 to a breakout board yesterday with absolutely no trouble. The edge let me tack down one entire side of it, and a brief swipe took care of the other side. Add to that the technique of drag soldering header pins and I'm head over heels in love with it.

I don't need to swap tips, it's better than a chisel or conical type for almost everything I've used it for.