cancel
Showing results for 
Search instead for 
Did you mean: 

Configure SPI or I2C for continuous clock

PCTM
Associate

In our STM32L5 based design we are using HSI16 to drive some clocks (SPI1). one way to route HSI16 clock is through MCO. is there any other way we can route this clock.

1. Can we configure I2C or SPI1 to route its clock on some GPIOs ?

2.Continuous write ,dummy write, on to I2C or SPI is good enough to generate clock ?

6 REPLIES 6
Pavel A.
Evangelist III

Use a timer for pulse output?

Piranha
Chief II

Beyond MCO the next simplest is a timer output channel.

S.Ma
Principal

Agreed that timer pwm is the logical next choice. However to answer the original question, yes, you can use spi master transmit mode to generate a pseudo clock using DMA cyclic TX a single data byte 0x55....

PCTM
Associate

Thank you for inputs.

Sorry i missed one imp ask, we are trying for clean clock or its mimic. Any change in phase of clock or delay/stretch in clock will affect our test.

we tried timer, but timer roll out will add 'glitch' in our measurement.

Tried I2C but AUTOEND will add phase shift in clock.

SPI with DMA one which i am trying, hope this will give clean clock.

our effort is in getting clock as good as it is out-of-osc kind. Since MCO is not-reachable in our design we are looking for alternate solution.

Thank you again for taking time out, to respond.

Sem A.
Associate III

This forum thread was marked by the moderator as needing a little more investigation, so a support case was created in your name and will be handled off-line. Should anyone have any related questions, please feel free to open a Support case directly at your myST portal: http://community.st.com/s/onlinesupport

Piranha
Chief II

> timer roll out will add 'glitch'

Timer can generate perfect pulses without any glitches. You just have to program it properly.