TVout: NTSC and PAL Composite Video Output.

Alright I've broken down and ordered a TellyMate as per your recommendation. It's only £12,50 so at least I can get on with the project.

But my offer to help still stands if theres anything I can do please let me know.

i DON'T THINK THE TELLY(sorry) will help. it sounds like it has to do with the tv having an auto-on type option. my tellymate will work on on small tv and not the other. I am getting ready to try the tv out curciut. Prolly flash the tellymate to bootloader?

As a side note the tv-out design works with the tv the telemate did not work with, but will not work with unit the telymate will work on. I am not using the 75ohm-ground resistor. I also have the nano dso toy o-scope if you want to see the signals.

Hi all.

For the beginning I want to thank you to mdmetzle for this great work and of course to all contributors to improvement of this library. And just after that I want to switch to my problem.. maybe someone can help.

I also started to use this library and of course coming from R/C world, I started to develop my own OSD as many others. Why I did start? Not because I don't like others on the market or because they are not good, but as always because of low cost.
I already have an Arduino Duemilanove Board - and succeeded with drawing of the OSD on the screen(like HUD). Nothing complicated because of is TVout library.

As second step, i did wrote the part of code where I am reading the data from GPS NMEA sentences. But of course, because this library is interrupt driven the serial doesn't work even if using pollserial(). This 2 parts works well apart from each other but not together. Together I have problems .. screen flickering and/or missing GPS info (incomplete NMEA sentence).

Also, thinking that the purpose of OSD is to overlay the text over image some modification need to be done to accomplish this, and maybe using sync generator will also help improving the timing?

So, the big question here: Will anyone help me interfacing my arduino board with LM1881?! Maybe someone already did it and can share useful info about that.
As I know, LM1881 should be connected to INT0 and INT1 of ATMEGA.. but the rest.. I don't know :frowning:

so.. here I will stop "crying" .. and will return later with any other info that I will learn.

@schumixmd
I haven't done anything with OSD capabilities but TVout has been modified to do this previously (search the old thread linked to in the first post). An OSD has also been done with nothing more than a few resistors see (not TVout based but this is where I had planned on starting if I was to create a TVout OSD version): http://www.elenafrancesco.org/arduino/baroneosd/ which will do some basic text overlay.

As far as the pollserial issues that is odd but not all that surprising as I did'nt do much testing beyond the super basic terminal app meant as a quick example on using the hbi_hook. If I remember correctly pollserial goes a bit crazy if the rx buffer gets full maybe start there? (make sure to handle the data fast enough maybe)

@gijs
I very much enjoyed those videos you achieved some very cool effects.

Hi,

I have a neat project in mind to display the output from my solar panel inverter on our TV inside so I don't need to go lift the hood on the inverter to see how much juice we're generating etc.

The issue currently is that I can't get a decent display on my 4yo Panasonic plasma TV with the TVout library. I can see the content is being displayed, but the sync is messed up so the content is scrolling down and around, and also horizontally everything is whacked.

The hardware hookup is dead simple on a breadboard - following the schematic on the wiki (and shown by OP above).

I immediately thought "a ha! 75 ohm ground resistor required!". But alas that made no difference except to dim the displayed content slightly. The sync was still all over the shop.

The TV will happily take PAL or NTSC input, so I tried both DemoPAL and DemoNTSC with pretty much the same results.

Any thoughts?

I'm using TVoutBeta1.zip

Cheers,

mdmetzle:
@schumixmd
I haven't done anything with OSD capabilities but TVout has been modified to do this previously (search the old thread linked to in the first post). An OSD has also been done with nothing more than a few resistors see (not TVout based but this is where I had planned on starting if I was to create a TVout OSD version): http://www.elenafrancesco.org/arduino/baroneosd/ which will do some basic text overlay.

As far as the pollserial issues that is odd but not all that surprising as I did'nt do much testing beyond the super basic terminal app meant as a quick example on using the hbi_hook. If I remember correctly pollserial goes a bit crazy if the rx buffer gets full maybe start there? (make sure to handle the data fast enough maybe)

Thank for your answer mdmetzle.
The fact is that I have checked BaroneOSD and also have read the full archived thread of TVout.
BardoneOSD has a simplistic Hardware Design but a not easy to understand software. I do know Delphi and C but have no knowledge in microprocessor programming. And also BaroneOSD is very sensitive to the Device that inputs and outputs the video signal. I tried it with 2 different TV and I had problems.. But... the TVout library did exactly the job I needed.

And that's why I need help. I will try to search again, but please .. if anyone has some suggestions then please share them..

I attached my dinky little Jyetech scope on the output and this is what I'm seeing, which looks vaguely correct from what I can tell.

I ordered a Hackvision last week and am now worried it will also fail when it arrives... :frowning:

Cheers,
G.

@pocketscience,
I've sold hundreds of Hackvisions and no one has reported any problems with TV incompatibility. I tested on many types of TVs, and had a friend test in a PAL country. I don't think you need to worry too much.

Michael
nootropic design

pocketscience, could you try running the sketch I've attached to this post and tell me if it syncs? The circuit is similar to TVOut but the sync is on pin 9 and the video is on pin 7. I think my sync code is more correct than TVout, so if it works it might be possible to hack my sync timing into the TVout library.

(The code actually does 4 bit greyscale so if it syncs you can try connecting pins 7,6,5, and 4 through 1k, 2k, 4k and 8k resistors.)

Also sometimes TVout syncs better if you put diodes in series with the resistors. And you may need to experiment with the values of the resistors too.

ntsc.pde (81 KB)

@stimmer - thanks - will try that this weekend! I did try putting various pots in (1K static plus 20ohm pot, 500 static plus 500 ohm pot) and twiddling that but it really made no difference. Didn't try the diodes though.
@Michael - good to hear!

Karma for you both! :slight_smile:

Cheers,
G.

Wow, frustrating evening! Tried stimmer's code - no difference, tried 1N4148 diodes - no difference, tried re-working the breadboard - no difference, tried direct jumper connections to composite cable instead of my soldered connector - no difference. Then I realised that removing the sync jumper from pin D9 on my Arduino board made NO DIFFERENCE... huh strange. What if I bang the jumper against D9 on the Atmega328 - bingo!!!! Solid, stable image from TVout demos, and also stimmers ntsc demo (nice pic!)!!

@Michael - I now have zero concerns about the Hackvision working, but thanks for the awesome post-sale, pre-delivery support!! :slight_smile:

Thanks guys, you all rock!! On to the next part of the project!

Cheers,

TVout is very cool, as-is Hackvision!

My progress: http://arduino.cc/forum/index.php/topic,53348.0.html

Cheers,

@mdmetzle, Thanks!

I am looking for a way to get the tvout lib to let one pin go HIGH when there is a white pixel, and another pin go HIGH when there is a black pixel..

it should probably be done close to here, but i don't understand this..:

asm volatile (
"ADD r26,r28\n\t"
"ADC r27,r29\n\t"
//save PORTB
"IN r16,%[port]\n\t"
"ANDI r16,0xFD\n\t"

(the above is from version 3 of the tvout lib, video_gen.ccp).

gijs:
@mdmetzle, Thanks!

I am looking for a way to get the tvout lib to let one pin go HIGH when there is a white pixel, and another pin go HIGH when there is a black pixel..

it should probably be done close to here, but i don't understand this..:

asm volatile (
"ADD r26,r28\n\t"
"ADC r27,r29\n\t"
//save PORTB
"IN r16,%[port]\n\t"
"ANDI r16,0xFD\n\t"

(the above is from version 3 of the tvout lib, video_gen.ccp).

The first two lines are a 16bit add and are calculating the pointer to the current render line in the frame buffer. The second 2 lines grab the port containing the output pin and set it to the video pin to low and the sync pin(if applicable in later versions) high. Then through out the rest of the line rendering routine the video pin is modified and the rest of the port is left alone. If you dont care about the port status then the these lines are not needed.

Hello.
A couple of days ago I tried to realize a little idea of mine...
I used 2 standalone Atmega328 on a breadboard: the first one runs a sketch that uses the PS2Keyboard lib to read the input from a PS2 keyboard, the second one has a sketch inside che reads the input from the first Atmega and then sends the output on the TV.

But I'm having a strange problem: keys that I see on the TV are different from the ones I press on the keyboard.... I.E. I get [ESC] from "h" or "3[ESC]" from "7" etc...

Strange because if I connect the first Atmega to an Arduino and send the keys I read from the keyboard to a serial terminal open under the Arduino IDE I can see the correct keys (i.e. if I digit "h"-"e"-"l-"l"-"o" I see "hello"), so I can say for sure that the connection of the keyboard is OK. It seems that "pollserial" doesn't read the correct datas.

I connected the 2 Atmega using pins 2 and 3 (RX & TX): of course, 2->3 and 3->2.
This is the sketch on the first Atmega:

/*  PS2Keyboard library example*/
   
#include <PS2Keyboard.h>

const int DataPin = 2;
const int IRQpin =  3;

PS2Keyboard keyboard;

void setup() {
  delay(2000);
  keyboard.begin(DataPin, IRQpin);
  Serial.begin(9600);
}

void loop() {
  if (keyboard.available()) {
    
    // read the next key
    char c = keyboard.read();
    
    // check for some of the special keys
    if (c == PS2_ENTER) {
      Serial.println();
    } else if (c == PS2_TAB) {
      Serial.print("[Tab]");
    } else if (c == PS2_ESC) {
      Serial.print("[ESC]");
    } else if (c == PS2_PAGEDOWN) {
      Serial.print("[PgDn]");
    } else if (c == PS2_PAGEUP) {
      Serial.print("[PgUp]");
    } else if (c == PS2_LEFTARROW) {
      Serial.print("[Left]");
    } else if (c == PS2_RIGHTARROW) {
      Serial.print("[Right]");
    } else if (c == PS2_UPARROW) {
      Serial.print("[Up]");
    } else if (c == PS2_DOWNARROW) {
      Serial.print("[Down]");
    } else if (c == PS2_DELETE) {
      Serial.print("[Del]");
    } else {
      
      // otherwise, just print all normal characters
      Serial.print(c);
    }
  }
}

This is the sketch that is running on the second Atmega:

#include <TVout.h>
#include <pollserial.h>
#include <fontALL.h>

TVout TV;
pollserial pserial;

void setup()  {
  TV.begin(_PAL,120,96);
  TV.select_font(font6x8);
  TV.println("Terminale seriale");
  TV.println("-- Versione 0.1 --");
  TV.set_hbi_hook(pserial.begin(9600));
}

void loop() {
  if (pserial.available()) {
    TV.print((char)pserial.read());
  }
}

Common grounds? Just checking... :slight_smile:

1 Like

What do you mean?
That I don't have to use common grounds or that I have to use them? :cold_sweat:

Does the tvout sketch work when you send data from the pc?