Close

The Project Deadline Limbo

A project log for VGAtonic

CPLD-flavored VGA Video card

PKPK 08/21/2014 at 05:120 Comments

I couldn't resist one last update before the project entries lock... and it's a big one:

That's right; I've got a working prototype here.  

640x480 8 bit color VGA video is possible in a 144 macrocell CPLD (spoiler alert: it's possible on an 109 macrocell CPLD or less, actually).  Bitmap conversion is done with a Python script, preprocessing was in Adobe Photoshop.

On the technical side, it wasn't immediately evident how to jam 7 bitmaps into Arduino header files.  So, here's how to increase your sketch size if you've got a Galileo.

How to Increase Sketch Size on an Intel Galileo (on a Mac)

Getting 7 images to fit in an Intel Galileo Arduino sketch was a bit of a feat - but know this: the default sketch maximum size is a lie!  

On my Mac, I was able to change it by right clicking the IDE in my Applications folder, choosing 'Show Package Contents', then 'Contents' -> 'Resources' -> 'Java' -> 'hardware' -> 'arduino' -> 'x86' -> 'boards.txt'.

Here's what I changed the Galileo I section to:

##############################################################

izmir_fd.name=Intel® Galileo
izmir_fd.upload.tool=izmirdl
izmir_fd.upload.protocol=sam-ba
izmir_fd.upload.maximum_size=29491200
izmir_fd.upload.use_1200bps_touch=false
izmir_fd.upload.wait_for_upload_port=false
izmir_fd.upload.native_usb=false


izmir_fd.build.mcu=i586
izmir_fd.build.f_cpu=-m32
izmir_fd.build.core=arduino
izmir_fd.build.variant=galileo_fab_d
#izmir_fd.build.variant_system_lib=libx86_izmir_gcc_rel.a<br>

The important part being that 'maximum_size', of course - by default it's set to 262144 bytes.  640*480 pixels (each with a byte of color info)?  307,200 bytes.  So, yeah, it was kind of arbitrary - and worse, you can't even fit one whole bitmap.

But it's not completely arbitrary - you'll get spurious errors in your Arduino IDE once you make the change (or maybe only because I used such a big number?), so save (a lot) more often.

A Working Prototype!(!!)

I know the focusing was pretty bad in the video, but the picture isn't perfect and there are some improvements I'll be making before I release any code.  I've got it writing to RAM every cycle: an unnecessary ~9.5ns /WE assertion zooming around the board and upsetting the rest of the PCB.   I'll clean that up and put code up on the repo soon (find it in our info section).

But, hey, doesn't that look great?  And, even at only 8.33MHz SPI it's not too painful of a refresh.  I'll see how we can do with a Linux framebuffer and improved firmware.

Stay tuned, and thanks for following!

Discussions