5521

The PIC32MK has plenty of SPI interfaces that can be synchronized. Here three are used to create VGA with one bit per color (RGB).

The SPI outputs of a PIC32MK can be synchronized in frame mode with an internally generated output (frame mode). This example shows how to generate VGA 640x480 and 3 Bits per Pixel (8 colors). The software was tested with a PIC32MK Curiosity Pro development board. It should be noted though that the micro is pretty buzy with generating the video signal and has little processing time left for other tasks. The outputs of the SPI need to be level adapted to VGA. This has been described in another Elektor project: UP TO RGB888 to VGA | Elektor Magazine.

This is the list of used pins:

/*
* RB6  RefClock1   Output the peripheral clock (2x the VGA pixel clock)

* RB9  T9CK        Input
* RC2  T5CK        Input
* RC6  T4CK        Input

* RB7  SDO2        Output VGA output one Bit color 1
* RA0  SDO1        Output VGA output one Bit color 2
* RA14 SDO3        Output VGA output one Bit color 3

* RB0  SS2         Input signalling frame start input
* RD4  SS1         Input signalling frame start input
* RC1  SS3         Input signalling frame start input

* RF9  HSYNC       Output
* RF10 VSYNC       Output

* RF1  TX1         Output for Debug messages
* RA7  RX1         Input for Debug messages
*/

Timer 4, timer 5 and timer 9 are used for synchronization of horizontal and vertical VGA signals.