Skip to main content
MGGd.1
Associate
May 2, 2021
Question

How to generate 32.768khz STM32F103C8T6 bluepill for Max30003 sensor?

  • May 2, 2021
  • 2 replies
  • 1758 views

There is MCO that supports PLLCLK, HSI, HSE, SYSCLK but not LSE with 32.768khz. How can I produce this frequency for FCLK pin of Max30003 sensor? Do I need use Timer? If yes could you send me some examples how to do it properly?

This topic has been closed for replies.

2 replies

waclawek.jan
Super User
May 2, 2021

Set up an appropriate TIMx_CHx pin to AF push-pull output, set the timer's respective TIMx_CCMRx.OCxM to some of the PWM modes (or alternatively Toggle mode, where the output will be 50% duty and half the frequency of the timer's overrun frequency), set respective TIMx_CCER.CCxE to enable the PWM/Toggle output (and if it's and Advanced timer, set also TIMx_BDTR.MOE). Set timer's TIMx_ARR to match the required output frequency and enable the timer by setting TIMx_CR1.CEN.

JW

MGGd.1
MGGd.1Author
Associate
May 3, 2021

Thank you for reply. But can I use pins OSC32_IN and OSC32_OUT somehow for generating 32.768kHz frequency by LSE? Your explanation seems difficult to me, I don't know how to configurate it properly in CubeMX

Tesla DeLorean
Guru
May 3, 2021

You really wouldn't want to attach to the OSC32_IN/OUT pins with a crystal as you're likely to disturb the circuit characteristics. If you used a 32.768 KHz TCXO or XO, you could perhaps split that feed.

As I recall the F1 would allow the 32.768 KHz Divided by 64 to be gated out the PC13 TAMPER-RTC pin

Best course of action would be to use a TIM clocking at 72 MHz and divided by 2197, that would be around 32.772 KHz

Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..
schar.11
Associate
March 14, 2023

Can u provide the code for max30003 ecg, r to r, i am doing a project on max30003.