Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
15 votes
1 answer
2k views

Why is the MCU clock out waveform sinusoidal and not square pulse

I got a new oscilloscope :) (proud amateur moment) I am trying to visualize the internal clock of a STM32G431RBT6 MCU. So I built an example program given by the vendor which provides the MCU clock ...
anirudhan's user avatar
  • 151
10 votes
1 answer
25k views

Why use STM32 HSE?

Why do we use an external oscillator for STM32??? Why not just use the microchip oscillator? I am using STM32F2xx it clocks at 120Mhz But, an external oscillator of 12Mhz is latch into the microchip,...
Tim's user avatar
  • 929
8 votes
2 answers
5k views

Ways to observe clock signal of an STM32 MCU

Is there a nice way to be able to observe the clock signal in an oscilloscope to validate my settings for clock speed? After setting it to 168 MHz with PLL for an STM32F407VGT6 MCU let's say.
muyustan's user avatar
  • 2,126
6 votes
2 answers
22k views

STM32 Timer Internal Clock Source

As I understand, the internal timer clock source on the STM32(F4) microcontrollers can be either APB1 or APB2. However, I can't find which timers get which clock. I already found ST AN4013, which ...
Pezo's user avatar
  • 192
4 votes
3 answers
15k views

Basic timings with an STM32

I am looking to make very basic timings on an STM32. For example, I would like to program my STM32 to output bytes on the UART for 1 minute. What clock/timer should I use? Looking through the ...
Randomblue's user avatar
  • 11.2k
4 votes
2 answers
1k views

Jitter of UART TX pin

I'm developing a small robot using the STM32L152C Discovery board. I'm currently trying to configure the board using the STM32CubeMX. I've never worked at this very-low level (my experience is much ...
Alexis Nicole's user avatar
4 votes
0 answers
72 views

Multiplexer bandwidth limit (Datasheet decryption) for two external clock on STM32

I would like to have the possibility to select between two main clock on my STM32. Both clock are single ended, 3V3 LVCMOS output. First clock is a 19.2 MHz TCXO, and second clock is a variable clock ...
rom1nux's user avatar
  • 498
3 votes
1 answer
15k views

STM32 - Clock signal generator using a timer - STM32CubeMX generated code

I am trying to generate a clock of 1.4 MHz using the STM32F103C8Tx using STM32CubeMX. First of all, in my code I have pin PB13 as output and in main I toggle it every two seconds. This works. ...
Cezar Chirila's user avatar
3 votes
1 answer
2k views

STM32F4 Timer accuracy and jitter

I'm trying to generate a 24MHz clock signal from the STM32F407 running at 168MHz. This signal would then be used to clock a USB hub IC (Microchip USB2513B). From the hub's datasheet, I learn that the ...
user avatar
3 votes
2 answers
2k views

How to set external clock value for STM32F1?

I creating a project with the microcontroller STM32F101C8t. This microcontroller has an internal clock of 36MHz. My question is how to correctly set the external clock value, ie what crystal value ...
Eduardo Cardoso's user avatar
3 votes
0 answers
803 views

Increasing system clock frequency on STM32F303 drops I2C clock proportionately - why?

I'm trying to figure out a weird little issue I've discovered while debugging another element of my code. I've got a STM32F303K8 reading and writing to an I2C peripheral. The I2C clock speed is ...
pileunderflow's user avatar
2 votes
2 answers
2k views

When would be occasions to use a lower clock given that high speed would always be preferable?

I am using STM32F0 MCU and STM32 CubeMX configurator. I encountered the clock configuration below When would be occasions to use a lower clock speed? Wouldn't faster always be preferable?
user768421's user avatar
  • 1,257
2 votes
4 answers
2k views

STM32F7: need of a crystal? Which resonator?

I'm currently designing a PCB based on a STM32 micro-controller (more precisely a STM32F722ZE). The question is : do I need a high speed clock (or is the internal good enough)? If so, what crystal and ...
Sandro's user avatar
  • 8,118
2 votes
3 answers
488 views

Which libs to use with a STM32F103C6 microcontroller? [closed]

I'm very new with ARM microcontrollers and I've been doing a lite lecture of about 4 books to know how to configure this devices to start programming them. First I did a reading an how to use mbed but ...
vram's user avatar
  • 158
2 votes
2 answers
794 views

What is my DAC clocking frequency for this STM32 board?

I'm trying to figure out the exact clocking frequency of the DACs for this board. Here is the clock config: And the code section for the DAC initilaztion: ...
pnatk's user avatar
  • 1,504
2 votes
1 answer
2k views

STM32f2xx could not work with maximum frequency

I'm using default configuration (according to UM1061, RCC section) to configure an SMT32F215RG to work with 120MHZ CPU clock. here is my configurations: ...
Ehsan Khodarahmi's user avatar
2 votes
1 answer
2k views

STM32 : set APB1 and APB2 to same clock frequency

When configuring a STM32 (or at least my STM32F722ZE based nucleo board), there are 2 clock frequencies, one for APB1, the other for APB2. The annoying thing is that some timers use APB1, other use ...
Sandro's user avatar
  • 8,118
2 votes
1 answer
1k views

Clocking scheme for LAN8720A - Cortex M4

This is regarding a design choice involving LAN8720, specific to clocking schemes. We are interfacing an ARM cortex M4 (with inbuilt MAC) to the 8720 PHY via RMII in the REFCLKO configuration. In the ...
Rustin's user avatar
  • 141
2 votes
3 answers
2k views

STM32 hardware design for clock

I want to develop my own PCB using STM32F4. I want to use an external 16MHz clock. Where do I have to connect the clock, OSCIN32-OSCOUT32 (pins 3 and 4) or OSCIN-OSCOUT (HSE) (pins 5 and 6 in ...
Developing Electronics's user avatar
2 votes
1 answer
2k views

STM32L0 - Delay in microseconds

I am using a B-L072Z-LRWAN1 board (which has a STM32L072 MCU) and I want to get data from a DHT11 sensor. To achieve this, I need a microseconds delay which I am not able to obtain. The libraries ...
user avatar
2 votes
1 answer
2k views

Separate GND-plane for microcontroller crystal resonator

1.  Background info I'm designing a board for an STM32F767ZI microcontroller. This microcontroller has a primary oscillator for the SYSCLK (overall system ...
K.Mulier's user avatar
  • 2,389
2 votes
1 answer
3k views

Connect STM32 Ethernet to PHY - clock signal

I want to connect MAC available on STM32F745 to KSZ8041FTL (PHY) via RMII. I will clock PHY from external 50MHz clock generator, connecting clock to the REFCLK input of PHY. But what about STM32? ...
zupazt3's user avatar
  • 1,627
2 votes
0 answers
89 views

STM32f030 Inconsistent clock

I am trying to write my own microsecond delay function for an STM32f030R8t6 by using the counter function on Timer 3. The first time I power the microcontroller up after flashing the delay works ...
Eric14003's user avatar
2 votes
0 answers
580 views

SD Card CLK stops working properly on STM32F4 with SDIO connections

I have an SD Card socket connected to STM32F4 with the connections as follows: The firmware uses the following codes to initialize the SDIO: ...
Patratacus's user avatar
1 vote
3 answers
2k views

Internal oscillator drift and its effect on UART

I am eager to know whether a 150kHz drift of internal oscilator clock (mentioned in a STM32 MCU operating with 8MHz internal clock) could destroy a UART connection?
Bornak's user avatar
  • 83
1 vote
1 answer
205 views

Zero-R Resistor on XTAL pins

Looking at the schematics of the STM32F4-Discovery board page 28, whose screenshot is attached below.. there is a Zero Ohms resistor 'R25' which is shown in the circuit with the Crystal. And there is ...
scico111's user avatar
  • 927
1 vote
3 answers
3k views

Measuring the HSE frequency of an STM32F2

I am programming an STM32F2 (manual here). I am having clock problems and would like to check every clock using an oscilloscope. The first clock I want to check is HSE, which stands for: High Speed ...
Randomblue's user avatar
  • 11.2k
1 vote
1 answer
272 views

Clock source of an STM32G030K6T6

I am currently designing a GPS tracker and have decided to go with an STM, choosing just STM32G030K6T6 (datasheet). I currently have the following pinout configured: My question is, since there is no ...
lasb3tas's user avatar
  • 195
1 vote
1 answer
3k views

Setting the HSE clock frequency of an STM32

I am programming an STM32 (manual here). Page 83 has a diagram indicating that the HSE Clock frequency is between 4 and 26 MHz. The paragraph on HSE clocks starts on page 84, but does not give any ...
Randomblue's user avatar
  • 11.2k
1 vote
1 answer
644 views

Fix clock settings on STM32F105 with 25MHz oscillator

Noob here :) While reverse engineering a CAN bus filter module: Using existing code from Github: https://github.com/EliasKotlyar/Canfilter It appears that the clock settings aren't correct because <...
brigadir's user avatar
  • 275
1 vote
2 answers
9k views

Prescaler vs Counter Period (STM32)

For timers on the stm32, there is the option of setting prescaler and counter period. I understood that the prescaler is dividing the frequency before using it for the counter. However, it seems to me ...
bilaljo's user avatar
  • 163
1 vote
1 answer
656 views

Crystal oscillators of an STM32 microcontroller board

I have the STM32F302R8 MCU board.l Its user manual is here. There are two crystal oscillators on the board. X3 is missing and X1 seems to be used for the small debugger microcontroller (circled in ...
cm64's user avatar
  • 2,255
1 vote
1 answer
524 views

RCC clock freq in STM32F103

If I select internal clock source to run my TIM3 in TM32F103 (TIMxCLK from RCC) as shown in the attached picture: CK_INT Then how to find out what is the freq of this clock? I am using External ...
alt-rose's user avatar
  • 1,489
1 vote
1 answer
2k views

Why does `RCC_GetClocksFreq` return different results than I expect?

I have a STM32F427 MCU with a 8MHz HSE crystal. I am setting up the clock as follows: ...
varesa's user avatar
  • 639
1 vote
1 answer
317 views

LCD with PCF8574 I2C driver doesn't work on frequencies lower than 2 MHz (STM32F103 Bluepill)

I am working on a low power project using the STM32 "Bluepill" and I would like to use an LCD without the need to set the frequency for the HCLK (Core Clock) to anything beyond 500 kHz. ...
A.H.Z's user avatar
  • 633
1 vote
1 answer
1k views

STM32L4 clock set up

I'm using STM32L4R5 for my project and this is my first time designing a clock source and using an ST microcontroller. I'm trying to figure out the clocking hardware configuration by reading the clock ...
cy1125's user avatar
  • 201
1 vote
1 answer
855 views

How to change the clock frequency of a STM32H753ZI

just got a new MCU for testing and having a hard time changing its clock speed to the maximum (480MHz) Using bare metals or directly manipulating the registers as I never liked the HAL interface. What ...
Leoc's user avatar
  • 1,421
1 vote
1 answer
1k views

STM32L4 Clocks Configuration

Does anyone know of a code template to properly configure clocks, PLL, latency, etc. for the STM32L4x parts? I'm using a NUCLEO board with this part (L476RG) and have struggled for days with the ...
TomServo's user avatar
  • 929
1 vote
1 answer
1k views

STM32F7 Discovery LTDC unit - changing system clock

I have strange experiences with display on my F7 Discovery board. When working with 216MHz system clock, the display (LTDC) works properly. However after changing to 120MHz (using CubeMX, so the app ...
VIPPER's user avatar
  • 356
1 vote
2 answers
705 views

GPIO and clock configuration of STM32F427VG

I am very new in STM32 projects and it is my first time writing a program with STM32. I used to program with AVR and now I should progress to STM32. I have a board with STM32F427VG on it without any ...
Amir's user avatar
  • 59
1 vote
1 answer
113 views

STM32F407 PLL config not producing 1ms SysTick

I've a bare metal PLL setup for my STM32F407 which should generate a 168MHz system clock. However for some reason the 1ms SysTick interrupt is orders of magnitude off the grid. The math works out on ...
Michael's user avatar
  • 113
1 vote
0 answers
178 views

Can a single crystal oscillator drive both an MCU and an ADC?

My STM32G491 design uses an 8MHz crystal for the HSE clock based on the reference design. My design also has a ΔΣ ADC that requires an 8.192MHz LVCMOS clock signal. I do not have any synchronization ...
Mike's user avatar
  • 533
1 vote
1 answer
1k views

Confusion about the meaning of HSE clock modes for an STM32 board

I have this STM32F303K8 board and I couldn't figure out whether this board has its own crystal oscillator or not. I can set the clock as Crystal/Ceramic as follows: and set the clock source as HSE as ...
cm64's user avatar
  • 2,255
1 vote
0 answers
408 views

STM32F4 OC Clock Jitter

I am using STM32CubeMX to configure an STM32F4 to output a clock signal using Timer 3, Channel 4 on PC9. I have read in the datasheet PLL section that jitter shouldn't be more than 15ps RMS but I am ...
Matt's user avatar
  • 9
1 vote
0 answers
2k views

stm32f2xx HSI configuration does not work correctly

I'm using below settings (in SystemInit function) to configure a STM32F215RG MCU to work at maximum speed (120MHZ) with USB support: ...
Ehsan Khodarahmi's user avatar
1 vote
1 answer
4k views

STM32 F4 max GPIO toggle frequency [duplicate]

I just started using the STM32 F401VC Discovery Evaluation board and I'm trying to get the maximum GPIO toggling frequency without assambler. So my tought process is following: The code I was ...
Raitis Bērziņš's user avatar
0 votes
3 answers
1k views

Choosing the clock for STM32

I'm building a custom board using a STM32F303K8T6. This custom board will be connected to 4 other custom boards via CAN bus protocol. The task of the following board is to drive high switches if there ...
Nik_01's user avatar
  • 41
0 votes
2 answers
767 views

STM32H7 not utilizing the 480MHz PLL clock

hope y'all are doing well. I am currently trying to get my STM32H753ZIT6U to 480MHz as its the max clock frequency it can achieve, however when doing the procedure to change the frequency I am not ...
Leoc's user avatar
  • 1,421
0 votes
2 answers
443 views

STM32F405 Setting Clock Freq Less than Max 168 MHz

For STM32F405 the max system clock frequency is 168 MHz. I want to run it at marginally lower frequency only for the sake of safety and reliability because my application will run non-stop through out ...
scico111's user avatar
  • 927
0 votes
2 answers
248 views

What is the maximum PLL output frequency in the STM32H7A3?

I'm setting up a hyperram, and I want to run it at 200MHz, with the DHQC setting enabled. The peripheral manual on page 874 says: DHQC must not be set when the prescaler value is 0, as this action ...
Drew's user avatar
  • 7,636