Generating VGA pixel clock hint (640x480@60Hz=>25.175MHz pixel clock)
I decided to have a go at producing a VGA display with the STM32L4.
640x480 @ 60Hz is the lowest resolution compatible with most displays (and VGA to HDMI convertors - many TVs only have HDMI ports these days). This resolution requires a pixel clock of 25.175MHz, which is usually derived from a crystal.
But you can get close to this frequency using the PLL. Set the MSI to 24MHz, the input divider to 5 (/M) and the multiplier to 21 - this produces a VCO frequency of 100.8MHz, which divides down to 50.4MHz (for the System clock) and 25.2MHz (for SPI/Pixel clock).
25.2MHz is only 0.1% off from 25.175, which should work (haven't quite finished off the rest of the software yet.....).
