Pages: [1]   Go Down
Author Topic: Arduino with TV  (Read 5100 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 26
Intermediate Arduino user
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.

Logged

Phoenix, Arizona USA
Offline Offline
Faraday Member
**
Karma: 36
Posts: 5519
Where's the beer?
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
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):

http://www.linusakesson.net/scene/craft/index.php

...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):

http://en.wikipedia.org/wiki/Color_Graphics_Adapter

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:

http://www.atariage.com/forums/blog/105/entry-6693-color-computer-3-artifact-art/

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:

http://belogic.com/uzebox/

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

http://www.analog.com/en/digital-to-analog-converters/video-encoders/ad725/products/product.html

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...

 smiley
Logged

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

0
Offline Offline
Newbie
*
Karma: 0
Posts: 26
Intermediate Arduino user
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
« Last Edit: January 23, 2011, 05:47:19 pm by farlepet » Logged

Phoenix, Arizona USA
Offline Offline
Faraday Member
**
Karma: 36
Posts: 5519
Where's the beer?
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

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

Michigan, US
Offline Offline
Full Member
***
Karma: 3
Posts: 148
Go Huskies
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.

Logged

Offline Offline
God Member
*****
Karma: 32
Posts: 506
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged


Pages: [1]   Go Up
Jump to: