cancel
Showing results for 
Search instead for 
Did you mean: 

STM32 Timer?

GHerz.1
Associate

I'm just getting started with STM32, so I'll ask

I need to generate a 25ns pulse 75ns gap on one output and again

On the other the same, but shifted by 180 degrees, ie by 50ns

Is it in the power of STM32 timers to do this?

The whole is mainly the rising edges of the pulse, they must have a fixed distance.

I compare their phase shift on a phase comparator

this signal generoji with a handful of 74LVCxxx leaning on TCXO, but I would like to drastically simplify the matter

Thank you for kicking in the right direction

0693W00000Bai3yQAB.png

5 REPLIES 5
Javier1
Principal

Which stm32 mcu are you using?

You should take a look at https://deepbluembedded.com/stm32-timers-tutorial-hardware-timers-explained/

Pay speciall atention to everything related to Timer slave modes it should be interesting for your project.

Using a master timer to create a delay and trigger secondary timers.

This is also a good lecture :

https://www.st.com/resource/en/application_note/dm00236305-generalpurpose-timer-cookbook-for-stm32-microcontrollers-stmicroelectronics.pdf

we dont need to firmware by ourselves, lets talk

In newer STM32 models, timers have Combined mode, which allows to generate phase-shifted waveforms within one timer. It's simpler than using the master-slave mechanism between timers, which for cycle-precision suffers from undocumented latencies.

JW

GHerz.1
Associate

Thanks.

The choice of using series and type is entirely up to me.

Yes, the price plays a role (not the big and expensive ones), the size of the case (ideally smaller than 48 pins), those with lower consumption have priority

I look on MCU with Combined mode.

>undocumented latencies.

Yes that's exactly what I'm afraid of, plus

STM32 cannot work with such a fast external crystal, ie use an internal PLL for the clock

Here is the question of how very stable (temperature, long-term in time), how accurate the duty cykle is, etc.

TDK
Guru

Seems quite doable to me using 2 timers, one slave in gated mode and one master, on any STM32 series.

Probably not something HAL supports, but if you're comfortable making your own code and reading the reference manual, it should not be too difficult.

If you feel a post has answered your question, please click "Accept as Solution".

>>undocumented latencies.

>Yes that's exactly what I'm afraid of

That's why I recommend using any newer STM32 ('F3, 'L4, 'G0, 'G4, 'H7) which has the Combined mode in Timer.

> Here is the question of how very stable (temperature, long-term in time),

PLL jitter is specified in datasheet.

I'd recommend you to buy a cheap Nucleo board, maybe start with the 'G4 family, and try.

JW