Wednesday, January 29, 2014

How to get 72 MHz out of this thing?

The microcontroller I used for this board (STM32F373CBT6) was capable of running at 72 MHz speed. But out of the box the thing ran at mere 8 MHz using it's internal clock. Need more speed!

It was time to take advantage of the external crystal I had soldered on the board. It would be used to generate accurate 8 MHz signal which would then be multiplied into 72 MHz using the microcontroller's internal PLL (Phase Locked Loop).

Again it took the standard couple of evenings in the kingdom of RTFM and debugging before the PLL did exactly what I wanted it to do. One of the harder to find bugs in the PLL configuration was that once I went over 48 MHz or so, the system crashed. Eventually this was due to the flash ROM wait states: I hadn't configured the flash memory usage speed so that the microcontroller would wait long enough for the data to read correctly. No wonder the system crashed when the microcontroller was in too much of a hurry and as a result read only garbage from the flash memory.

Here's the source file I wrote to clock the microcontroller up to 72 MHz.

No comments:

Post a Comment