2
\$\begingroup\$

I'm designing a PCB and I was looking at the schematic of the blue pill STM32 board to integrate it, and found that there are two crystals on the schematic? Why is this? Also, there is only one on the board?

https://stm32-base.org/assets/pdf/boards/original-schematic-STM32F103C8T6-Blue_Pill.pdf

two crystals

\$\endgroup\$
4
  • 5
    \$\begingroup\$ The 32.768kHz xtal is optional, and would be used for real-time clock/calendar applications. It is added to layouts 'just in case' and is populated only when needed. ST ref \$\endgroup\$ Jan 7, 2022 at 19:25
  • \$\begingroup\$ st.com/resource/en/application_note/… woud be a much better starting point than this board, and also explains in detail the specific issue in the question. \$\endgroup\$
    – devnull
    Jan 7, 2022 at 19:54
  • \$\begingroup\$ I don't know about the STM32, but a lot of microcontrollers can also turn off their main clock oscillator and use a secondary, lower-speed one for low-power modes. \$\endgroup\$
    – Hearth
    Jan 7, 2022 at 19:54
  • 1
    \$\begingroup\$ Also, the 20p caps in the 32Khz crystal are a bad idea. Datasheet says it must not exceed 15p... \$\endgroup\$
    – nachus001
    May 3, 2022 at 14:53

1 Answer 1

3
\$\begingroup\$

It is common for MCUs and developement boards to have a high speed main clock crystal and a low speed crystal for real-time clock feature where it can keep time with only backup battery power. STM32 calls these HSE and LSE.

The STM32 does not need either crystal to function, it's just that the HSE is useful and might even be required for some tasks. The LSE is omitted because most people do not need it, but can add it if they want it.

If you intend to start using STM32 MCUs, please understand that the Blue Pill is a terrible example, it does many things that should be avoided or not done.

You should refer to manufacturer documentation and examples how to use STM32 properly.

\$\endgroup\$
4
  • 1
    \$\begingroup\$ I'm just curious what are the things on Blue pill that should be avoided? I don't use Blue pills, I just use STM32 MCUs for my projects. So I would like to know what to avoid. \$\endgroup\$ Jan 7, 2022 at 21:17
  • \$\begingroup\$ @Chupacabras the list is too numerous to write here, just read the STM32F103 eval board schematics, appnotes and documentation such as how to get started in hardware developement and it is easy to compare. \$\endgroup\$
    – Justme
    Jan 7, 2022 at 21:41
  • 1
    \$\begingroup\$ I've looked at the schematic, I didn't see anything obvious. It's so simple project. When looking at the board layout I see one problem, the placement of the crystal and caps, otherwise it looks ok to me. \$\endgroup\$ Jan 8, 2022 at 7:34
  • 4
    \$\begingroup\$ @Chupacabras Reset should not have the pull-up, crystal should not have the 1Mohm resistor, USB data pull-up should definitely not go to +5V, the VBAT pin should not float unpowered. It's as if they read the MCU documentation how to do things, and then did exactly the opposite. \$\endgroup\$
    – Justme
    Jan 8, 2022 at 21:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.