Close

Planning for Asynchronous Serial Graphics Mode!

A project log for VGA Graphics Over SPI and Serial - VGATonic

640x480 (and 848x480!) Color VGA Video Card for Microcontrollers and Single Board Computers

pkPK 07/07/2015 at 05:390 Comments

As of tonight, VGATonic has all of the initial promised specs working:

When I first laid VGATonic out, I put a microcontroller onboard with a number of pins connected to the CPLD... I was, of course, planning for feature creep.

The ATTiny 2313a is an interesting little microcontroller - it only has 128 Bytes of RAM, but it has a hardware UART, and a hardware 'USI', or Universal Serial Interface. The USI we will use as 'SPI Out' to the CPLD (driving VGATonic just like the rest of our demos), and the UART we'll use to communicate with every piece of hardware for the last 50 years (hyperbole - but you know what I mean, right?).

Here's the relevant section of the schematic:

Since SPI is working perfectly on the CPLD, I wont be getting in the way. Instead, I'll use one of the AVR_CPLD_EXT pins to send a signal to the CPLD that the AVR wants to be the master, and avoid the entire mess by just shifting where MOSI/SCLK/CS come from. It's a clever trick (or at least I think so). Here's the relevant VHDL:

	if (SEL_SPI = '1') then
		SEL <= AVR_SEL;
		SCK <= AVR_SCK;
		MOSI <= AVR_MOSI;
	else
		SEL <= EXT_SEL;
		SCK <= EXT_SCK;
		MOSI <= EXT_MOSI;
	end if;
So with this change, we're backwards compatible with everything I've already got working on VGATonic, and now the AVR can grab control of the screen and do... well, whatever we can fit in 128 Bytes!

Again, very excited to be switching from VHDL to C here... let's see what we can make the Microcontroller do!

Discussions