2021-05-13 06:43 AM
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.
2021-05-13 07:44 AM
> 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.
2021-05-13 10:19 AM
Which STM32? Besides of prescaler it may be possible to select other clock source for the SPI.
--pa
2021-05-13 10:32 AM
Sorry, I forgot to mention that. I'm using STM32F446RE