2015-05-17 08:29 AM
Hi there , I use the SPI3 unit on my STM32F4 Discovery board to control a TFT. I want the images to load faster and as a result I need to increase the SPI3 clock/frequency. Currently this line of code clocks the unit:
RCC->APB1ENR |= RCC_APB1Periph_SPI3;Any idea how can I get to 1.5 or 2 MHz.Thank you2015-05-17 08:49 AM
Well that seems relatively slow.
Given the way the prescalers work you might have to play with the CPU and AHB/APB clocks to hit specific rates you want. You might have to run the CPU slower than maximal to get the integer divisions you need.2015-05-17 09:11 AM
Hi there, thank you for your quick reply. Actually what I want is faster not slower. As far as I know the STM32F4 Disc runs with 8 Mhz crystal. So is it the AHB or the AHP that can give me the right speed ? it's because the bitmaps are showing slowly on my 128*128 tft
2015-05-17 09:57 AM
The STM32F4-DISCO has an 8 MHz external source, and 16 MHz internal one, but those can feed to a PLL/VCO capable of running the CPU at 168 MHz, with the buses at fractions of that.
2015-05-17 10:28 AM
So what do you suggest sir ?
I need At least the tft to update with 10fps . How can colck it to be faster ? Thank you2015-05-18 03:26 PM
Which STM32F4? For STM32F429
RCC->APB1ENR |= RCC_APB1Periph_SPI3 Enables the clock to the SPI Bits 3-5 (BR) in SPI_CR1 Set the divisor value of the clock. According to the 429 datasheet SPI3 can communicate at up to 22.5 Mbit/s (SPI1, SPI4, SPI5, and SPI6 up to 45 Mbits/s) assuming you have overdrive on and so running it at 180MHz. So APB1 running at 45MHz/32 = 1.41MHz (BR[2:0] = 100) 45MHz/16 = 2.8MHz (BR[2:0] = 011)