cancel
Showing results for 
Search instead for 
Did you mean: 

How to set SPI Baud Rate Without Using Prescaler?

IAtam.1
Associate II

I'm new to STM32 development. I need to use RF98W LoRa module and also I need high clock frequency.

Problem is RFM98W datasheet says RFM98W has bit rate up to 300 kbps. To achieve 300kbps spi clock frequency I think I need to have low frequency around 50MHz (with 256 Prescaler). But I want to use my microcontroller in full clock frequency which is 180MHz.

Is there anyway to give SPI 300kbps baud rate and maintain 180MHz clock frequency at the same time? Thank you for reading.

3 REPLIES 3
TDK
Guru

> Is there anyway to give SPI 300kbps baud rate and maintain 180MHz clock frequency at the same time?

Not in master mode. You are limited to the options provided by the prescalers.

One option would be to run it in slave mode and hook up a timer pin to drive the SCK line, but this adds considerable hardware and software complexity, but gives you flexibility over the clock rate.

Another option is to lower the AHB clock such that the /256 prescaler gives you a rate below 300kbps.

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

Which STM32? Besides of prescaler it may be possible to select other clock source for the SPI.

--pa

Sorry, I forgot to mention that. I'm using STM32F446RE