Go Down

Topic: Arduino with TV (Read 11595 times) previous topic - next topic


Hi, i'm new here and i don't know if i'm posting in the right section.

I just tried out the TVOut library and it works great(except for the new beta). I was wondering iv you could get it to use color instead of B&W.


I was wondering iv you could get it to use color instead of B&W.

I haven't played with it, but I followed the original thread about it - basically the answer is "no" simply because the Arduino doesn't have enough memory. Your frame buffer would have to be able to store not just black and white, but an RGB value (because you aren't using an external palette lookup table). However, if you did build an external hardware palette lookup table, then it might be possible to gain colors.

But there's another issue: timing and speed; your timing and everything for NTSC/PAL color has to be even more precise than black and white. It is certain possible to do color with an ATMega (as has been demonstrated here - albeit VGA):


...but the timing is really tight; I mean, you almost -have- to be a demoscene coder to pull that kind of stuff off with a microcontroller, at least if you want it to do anything more complex than show a static image. One minor timing glitch and you either get a black and white picture or nothing, most likely.

Something you might try, though, with the TV-Out library is to investigate using artifact coloring (easier with NTSC than PAL) - you used to be able to do this with CGA (where its explained a bit):


Essentially, when you place two white lines close together on an NTSC frame, because of bandwidth bleedover and such (I don't understand it fully), you get a different color visble. I am most familiar with the TRS-80 Color Computer, which used this mode quite a lot for game and graphics. It had a 256x192 pixel mode (Color Computer 2) that could do artifact colors, to give you an effective resolution of 128x192, with four colors (black, white, red and blue - although properly, the colors were closer to black, buff, magenta, cyan).

In 2009, a mode was found on the Color Computer 3, whereby setting the palette of the 640x192 4-color screen to black, white, and the two grays that were supported on that machine, you could obtain a virtual 160x192 "256 color" screen:


This actually caused a pretty big splash, though it has yet to be exploited by anybody for a game or otherwise (the images in that thread above are all still images). What amazes me most about this mode was the history of it - it was essentially discovered back when the Color Computer 3 was being sold in the mid-1980s, but never made the "splash" it should have because the guy who first published about it, published in a small CoCo magazine, instead of the larger Rainbow magazine of the day, which was the largest national magazine regarding the Color Computer. Thus it faded into obscurity, only to be re-discovered close to 20 years later.

Another possibility to try might be to use what the UzeBox:


...uses for its color capability - the AD725 RGB to NTSC/PAL encoder:


However, you still run into the memory issue of storing a multiple color image in RAM, without a hardware palette lookup table (with such a table, it becomes more in the realm of possibility - basically, its a hardware device that encodes a of some size 2, 4, 8 bits - into an RGB triplet).

Now - the UzeBox is based on the 644 (essentially the Sanguino), but uses a different library than the Arduino - but in theory could be coded for using the Arduino libraries and some hacking...

I will not respond to Arduino help PM's from random forum users; if you have such a question, start a new topic thread.


Jan 23, 2011, 11:44 pm Last Edit: Jan 23, 2011, 11:47 pm by farlepet Reason: 1
Is it possible to add at least one extra color? Like green or red? I may try to get it working with VGA, but id need a connector first.


Like I said, look into artifact coloring - its your best option for gaining a couple of extra colors (at the expense of resolution). You might be able to generate a gray value, somewhere between the black and the white; if you do some research on generating NTSC signals with PIC processors, you'll find circuits that show how to achieve this. This, coupled with artifact coloring, may (that's a big if, due to lack of resolution) give you a possibility of a larger number of artifact colors. Something to keep in mind is that some LCD TVs don't generate artifact colors properly (or at all); they are really the result of the NTSC system and low-cost or old televisions. If you've ever watched a show where a person is wearing a checked or striped pattern, and saw colorful rainbows on their clothes as the moved on the screen (instead of the pattern, or in addition to it), those were artifact colors; if you can see that on an LCD TV, then it could potentially be used to display such colors.

But native solid colors? Like I said - that isn't like to be easy at all. I'm not saying it is impossible, but you are likely going to need the coding chops of the developer of the TVOut library coupled with the skills of the developer of Craft, coupled with a lot of knowledge about the NTSC/PAL (or VGA - though trying to get the Arduino to generate VGA that doesn't have large block pixels is going to be difficult to impossible - it just doesn't have the speed) television system.
I will not respond to Arduino help PM's from random forum users; if you have such a question, start a new topic thread.


What problems to you have with the beta? the video pin did change was that it?

color is not going to happen without added hardware. gray scale is possible but doing anything with the color burst is beyond the capabilities of a micro controller running at these speeds.

VGA would be the way to go for color but the its lines are half as long as NTSC/PAL and 128pixels wide would be the best that can be done @ 16mhz.  In addition making a 2bit or 4bit color space is going to need much more ram.

strictly speaking color in PAL signals would be possible (as demon-straighted by phasor) but not for NTSC, the tricks used to generate color in phasor require the alternating phase of the color burst.


If you have a TV with a SCART input you may be able to experiment with colour, since some TVs accept an RGB SCART input. This has the same timing as PAL/NTSC but the red, green and blue signals are separate. With spare pins and resistors you may be able to make a circuit which changes the background colour, for example.

Go Up