VGA1306 (VGA-out for DIY Arduboys implemented on an FPGA!)


…after some discussion with @filmote have refactored the FPGA code for 5x scaling of the 128x64 frame = 640x320! (was previously scaled 4x to 512x256 and centered):

Also happy to report we got @Mpiazza’s eBay board working :slight_smile:

(Simon) #58

Looks great! I can’t wait to play with this one …

(Mark Piazza) #59

I’ve cleaned up the wire from the Gameboy, it turns out that the 6 pin header on the CPU board is D0-1 and Clk, with the other 3 being ground. I isolated one of the grounds and made it vsync. I tossed in hsync, too, just in case.
I know I’m off topic, but I wanted to share.

Thanks again, @uXe!

(Mac Ha Nguyen) #60

Is it possible to use the Numato Labs’ Elbert V2 board (

It’s based on Spartan XC3S50A, has on board VGA connector and stereo audio out, among other peripherals. I got it several years ago, but being a total newbie to FPGA just done some simple tutorials, and since then looking into what to use it for. Your project looks as a perfect application, but I’ll need your community help and guidance on how to implement it, if at all possible! Thank you very much in advance!


Looking at the specs it certainly should be possible. I think you’d be better off starting a thread on the Numato community though:

You will also need a level-shifter if whatever you are planning to interface with does not have 3.3V I/O? I do not have any experience with the toolchain for that board, but I can try to follow along and help if you start a new thread over there…

They have an example for VGA but it is written in VHDL, and my code is written in Verilog:

(Scott R) #62

I was curious to see if we could actually VGA out with an oled connected at the same time.
Unlike @uXe and his perfect wiring mine is more honey badger.
Currently no CS pin is being used but so far this has not presented any issues. I’m hoping to test on an actual Arduboy as soon as I can grab some header pins after running out over the weekend.


I’ve hooked up the VGA adapter to my HomeMade DevKit with NES controller board and proto flash cartridge. It’s like an Arduboy console now :smiley:

It’s awesome seeing Arduboy on my TV with huge pixels :smiley:


(Scott R) #65

lets try the real thing :wink:


(Scott R) #67

I just couldn’t help myself with this one.

(Scott R) #68

Having so much fun with this.


Is VGA 1306 compatiable with Arduboy?
(or rather, is VGA 1306 similar to the 1306 display we find out there?)
If so, are there any video out (HDMI, mini DP are OK) format for someone with original Arduboy library (the one that support SSD 1309?)

(Scott R) #70

The FPGA emulated the SSD1306 that the Arduboy uses in my image it’s wired to the test pads for the Arduboys OLED, both can be run simultaneously as in the photo.

I doubt it would be much work for @uXe to add SSD1309 support since the displays are so similar. HDMI is possible with a VGA to HDMI adaptor I’m not sure if this board has enough pins available to do HDMI but it would certainly be possible to do HDMI with an FPGA.

(Scott R) #71

Not wanting to take thing too off topic but I’ll close the audio discussion up here with this. I was too eager to wait for the 2.2k Ohm so I tested one channel using a bunch of 0.5 Ohm resistors I had and wow 2 two channels will be amazing.

Getting back on topic I’ve been thinking how handy it could be for other projects to support more oled controllers.


Certainly achievable… you can even potentially have multiple selectable FPGA configurations onboard:

Any particular controllers you had in mind though?

(Scott R) #73

SH1106 seem to be a popular alternative to SSD1306 in many projects. And recompiling is not always an option or may be a lot of messing around when switching back and forth between OLED and VGA.

@Mr.Blinky figured how to hex between ssd1306 and ssd1309 so this one wouldn’t be an issue.

SSD1327 128x128 could provide some interesting results as could SSD1329 96x96


Difference between SSD1306 / SSD1309 is one of the configuration commands, and the FPGA code ignores all commands anyway and only listens for the data, so SSD1309 should work fine.

SH1106 - the issue here is that the page address does not automatically increment. So you need to manually set the page addresses during the frame… which means the DC pin is being toggled during the frame and this upsets the FPGA code!

I did write a temporary workaround for trying out the VGA1306 board with @Mr.Blinky’s streaming-bootloader demo, which uses this page-addressing mode for maximum SSD1306 / SH1106 cross-compatibility…

Just needed to replace this portion of Verilog:

always @(posedge wclk) // Write memory
  if (write_en) begin
    mem[waddr] <= din; // Using write address bus
    waddr_r <= waddr_r + 1; // Increment address
  else begin
    waddr_r <= 0; // 'VSYNC'

with this:

always @(posedge wclk) // Write memory
  if (write_en == 1 && waddr_r < 8192) begin
    mem[waddr] <= din; // Using write address bus
    waddr_r <= waddr_r + 1; // Increment address
  else if (waddr_r == 8192) begin
    waddr_r <= 0; // 'VSYNC'

So, yes - a ‘universal’ SSD1306 / SSD1309 / SH1106 version shouldn’t be difficult!

Could definitely be interesting, yes. 16 shades of grey to play with!

The current 3-bit RGB hardware only allows for 8 colours though :face_with_raised_eyebrow: But add another five resistors, and you get 256 colours! :smile:


Thought I’d better reply to this over here… :smirk:

…if you remove the flash chip from the socket and use some other external device to send the initial configuration to the FPGA in ‘slave mode’, then the four SPI pins (SPI_SO, SPI_SI, SPI_SS_B and SPI_SCK) become available to the user application 49 clock cycles later - and that same external device can then take advantage of those IO!

Details are on page 26/27 of the iCE40 Programming and Configuration Technical Note.

(EDIT: SPI_SS_B and SPI_SCK do have pull-up resistors attached though, which may limit their usefulness! :roll_eyes:)


Hmm…I can tell 32 shades.

these many things make me think of my homemade bridge diode…
Or one of those mililtary circuit board(Fallout junk items) ancient circuit board with no less than 50 of them on board
Wait. it work with SSD1306? :tada:
If you can give me the sketch for NES controller (for a Arduino Micro), and @uXe figure out how to get one of your board to be, then I might be able to fit all these onto one Proto-shield. With a 3.5mm headphone jack.
That being what I am aiming for, but @uXe’s board is a tad too big.