No luck with TVOut library.

Hi,

Need some help with a Duemilanove and the TVOut library.
The example code (DemoPAL) doesn't compile because I don't have enough memory.

So, I started my own small sketch to get things started:

#include <TVout.h>
#include <font4x6.h>
#include <font6x8.h>
#include <font8x8.h>
#include <font8x8ext.h>
#include <fontALL.h>

#include <video_gen.h>

TVout TV;
int s1 = 0;
int ledPin13 = 13;
int toggle = 0;

void setup()
{
char c;

#if 1
c = TV.begin(PAL,120,96);
TV.select_font(font6x8);

#endif
pinMode(ledPin13, OUTPUT);

TV.println("I am the TVout\nLibrary\n");
TV.delay(2500);
}

void loop()
{
if(toggle == 0)
{
digitalWrite(ledPin13, HIGH); // set the LED on
toggle = 1;
}
else
{
digitalWrite(ledPin13, LOW); // set the LED on
toggle = 0;
}

#if 1
TV.print("s1 is ");
TV.println(s1);
s1++;
TV.delay(100);
#endif
}

While it compiles, it doesn't do anything useful. And as the LED isn't being lit in the 'loop' function I assume that something in TV.println in 'setup' is causing it hang.

Also, I am unsure about which pins to be using, all the docs show to use pins 7 and 9.
But, I'm not sure if that's correct for the Duemilanove.
Either way, I don't see any life at all on the PAL TV.

Any help appreciated.

Regards

Nick

In fact, the only thing gets a reponse out of the TV is if I use pin 1 on the Arduino.
It makes the TV flash briefly when I press reset button.

But, this is probably because pin 1 is used by the serial comms.

None of the other pins get a response from the PAL TV.

Also, I have a piezo buzzer. I connect that to the pins in turn to check if I hear any digital activity.
But, alas nothing.

Regards

Nick

OK, so I tried the Arduino PONG code, submitted elsewhere on this forum.

And, happily, that works fine.

So, I know I have a Duemilanove that can work my PAL TV OK. And, the right resistor values.

So, the problem must be somewhere in TVOut library.

Thanks anyway.

Regards

Nick

I had another look at the TVOut library today.
After some success with the PONG example on my PAL TV, with my duemilanove atmega168, I tried TVOut library again.

And, I have now got it to work, but with a very much reduced resolution.

The best I can seem to get is using:
TV.begin(PAL, 88, 70);

This gives me 13 columns of 'font6x8' characters, and 8 rows.

But, it only uses up about 2/3 of the screen area. So, it's still not entirely usable.

Is this low resolution due to the low RAM available in duemilanove atmega168?

Regards

Nick

That would explain it. A resolution of 120x96 needs 12096 bits = 12096/8 bytes = 1440 bytes. The 168p only has 1024 bytes of RAM. 88x70 needs 770 bytes which should fit in just.

Ah damn,

Would you believe it.

Just as I'm starting to make some interesting progress, I am now getting the infamous:

avrdude: stk500_getsync(): not in sync: resp=0x00
avrdude: stk500_disable(): protocol error, expect=0x14, resp=0x51

This is real depressing.

Searching on google and forums for the above text reveals some interesting reliability problems with the arduino platform.

Since my problem isn't related to COM ports or choosing the right target type - I assume that it's the infamous broken bootloader problem. This makes life complicated.

I don't think I can progress any further with a system with this sort of inherent reliability problem.

Might go back to PIC programming.

Thanks anyway.

Nick Thomas

After some researching on how to re-program the bootloader, I see that an AVR Dragon can be used.
It just happens that I have one in my toy box.

And after about an hour of tinkering I now have a working bootloader in my Duemilanove.

I don't think it's the same one as was pre-programmed when it was delivered because the LED's flash in a different pattern.

But, anyway, I can now get my sketch uploaded to it.

Despite the comments and suggestions from many other people in other forums, the failure to upload was nothing to do with incorrect COM port settings, or stuff like that.
It appears that it's unfortunately easy to trash the bootloader on these things.

Fortunately, this is not a production or professional project - it's a home project.

But, what it has taught me is that the Arduino can't be installed in a production environment due to the inherent reliability problem with the bootloader. Which is a real shame.
But still, I guess it's useful for educational purposes.

Regards

Nick