I'm working with VGA DSUB-15 output, however VGAX only allows for 4 colors. I'm using an Arduino Nano that uses an 8-bit atmel chip, and I've seen many 8-bit computers of which have a bit more than 4 colors.

  • Is there any form or shape of VGA that uses composite output? The usual 15-pin VGA connector has separate analogue (baseband) signal lines for the red, green and blue components.
    – Henning Makholm
    Jul 23 '16 at 15:51
  • @HenningMakholm Ah, no. Will edit.
    – James Pae
    Jul 23 '16 at 16:03
  • Google RGBI for more in-depth information about this phenomenon and how old computers with CGA graphics worked this way.
    – winny
    Jul 23 '16 at 16:50
  • @winny RGBI has 16 colors.
    – pipe
    Jul 23 '16 at 17:59
  • @pipe Sure, but the principle of limited color space is transferable.
    – winny
    Jul 23 '16 at 18:14

It's a memory limitation. The ATmega328 has 2 KB of RAM, and a 120x60 framebuffer at two bits per pixel (four colors) uses 1.8 KB. There's no room for more.

  • Thanks, is there any way i can get around this? Other than heavy optomization.
    – James Pae
    Jul 23 '16 at 18:45
  • 3
    Use another microcontroller with more memory.
    – user7800
    Jul 23 '16 at 19:42

Are you using the Arduino to directly drive the VGA, or are you using a shield. If you're directly driving the display, I think the limitation is on the Arduino because with only 2kb or RAM, you can't really store all the pixel data. And the duino is also generating the high frequency vsync and hsync signals.

  • Try this: gammon.com.au/forum/?id=11608. Note: the code didn't work for me, but try it.
    – p7810456
    Jul 23 '16 at 16:22
  • The link in the question leads to schematics that show the VGA output pins being driven directly by the digital output pins of the Adruino, with just some bridging resistors.
    – Henning Makholm
    Jul 23 '16 at 16:24
  • That's how you drive VGA directly without a shield.
    – p7810456
    Jul 23 '16 at 16:25
  • So it may be possible to have more colours at a lower resolution.
    – TEMLIB
    Jul 23 '16 at 18:04
  • That's what gammon said
    – p7810456
    Jul 23 '16 at 19:26

The VGA interface uses full analog signals for Red, Green an Blue video. There is no limit to the color levels in the VGA standard.

However, it is not unusual to find that minimalist implementations of VGA in microcontroller products use Digital to Analog Converter (DAC) techniques with a limited number of bits of resolution. For example, using two bits of resolution for Red and Blue, and three bits of resolution for Green so that the pixel information will fit into an 8-bit byte, etc.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy