Go Down

Topic: VGA output (Read 34767 times)previous topic - next topic

bensom

#45
Apr 28, 2013, 04:07 amLast Edit: Apr 28, 2013, 09:31 am by bensom Reason: 1
@Graynomad Yes, it runs BASIC, a very limited version from the obfuscated C contests! http://www.youtube.com/watch?v=FRbr8ulNP5M

I was coding away on a bit more advanced version, parallel with a simple emulator running on windows but I got on to other things, so that is stalled at the moment. Don't know where to host that code, can send by mail or something if you like!

All inspired by the VGA lib thanks to @stimmer, great work! Just tried the PAL version on a little car DVD panel with medium succes. It shows very nice stable black and white, but lots of color fringe. I suspect my soldering, will try that again soon.
Also, doesn't composite video need a 75 ohm resistor to ground?

edit: Got the color working with an R 2R ladder made of 68 and 150 ohm resistors, looks much better now.

stimmer

#46
Apr 28, 2013, 01:00 pm
Composite video only needs the 75 ohm load resistor if the input to the TV is high impedance. Almost all TVs have a 75 ohm input impedance already so the load resistor isn't needed - the TV is the load

According to the data sheet there is a slight output resistance on the digital outs, you may find 82 ohm resistors work better than 68. Try it, it will either look better or worse. I did write a sketch to test how monotonic the DAC is - put a 75 ohm load resistor in place for this (doesn't have to be exactly 75 ohms) and connect the output to analog in 0:
Code: [Select]
`// array runs lsb to msb, you can add/remove // values according to the number of resistors// in your DACchar pins[]={34,35,36,37,38,39,40,41};void writeval(int v){  for(int i=0;i<sizeof(pins);i++){    digitalWrite(pins[i],v&1);    v>>=1;  }}void setup() {  Serial.begin(115200);  analogReadResolution(12);  for(int i=0;i<sizeof(pins);i++)    pinMode(pins[i],OUTPUT);}void loop() {  int l=0;  for(int i=0;i<(1<<(sizeof(pins)));i++){    writeval(i);    delay(10);    int m=analogRead(0);    printf("%d : %d  d=%d\n",i,m,m-l);    if(m<l)printf("!!!!!!ERROR!!!!!!!!!! non-monotonic\n");    l=m;  }  delay(2000);}`

Because of the number of technical compromises that have to be made to get a colour composite signal at all, there will always be a lot of colour fringe. The output signal is way off spec in a number of areas. I aimed low with that project, the goal was VHS quality rather than broadcast quality
Due VGA library - http://arduino.cc/forum/index.php/topic,150517.0.html

#47
Apr 28, 2013, 03:11 pm
Quote
a very limited version from the obfuscated C contests!

I hope you didn't have to work with the obfuscated source code.

I'm not personally interested in BASIC but it is very popular with many people and might be a way to convert Picaxe and Maximite users to Arduino.

The Maximite has a pretty good interpreter that was/is open source, maybe it's worth porting that across. For that matter there has to be 100s of interpreters around.

_____
Rob
Rob Gray aka the GRAYnomad www.robgray.com

bensom

#48
Apr 28, 2013, 08:11 pm
Rob, actually, I did de-obfuscate that interpreter, only to find the deobfuscated version when I was done, oh well. A sunday well spent. BASIC on the Due sure made my Apple][ days come back to me!
And yes, there are lots of BASIC interpreters to be found, sure one should fit the arduino due pretty well. I might continue on what I have, if it rains a lot this summer.

Stimmer, I did something similar, but looked at it with the scope, seems decently linear.
Code: [Select]
`void setup() {    pinMode(36,OUTPUT);    pinMode(37,OUTPUT);    pinMode(38,OUTPUT);    pinMode(39,OUTPUT);    pinMode(40,OUTPUT);    pinMode(41,OUTPUT);    REG_PIOC_OWER = 0xFFFF;}int i=0;void loop() { // C.4 - C.9    REG_PIOC_ODSR = i<<4;    if (++i>64) i=0;}`

I really like the VHS quality on this, 40 columns of text and all that! That space-age, Z80/6502 look
Will try with 82 ohm resistors, but unloaded the voltages seems pretty spot on, according to the composite video wiki page.

beddy

#49
Apr 30, 2013, 01:14 am
Hi everyone,

I have an idea but I not sure if it is possible. Let me to tell you... I imagine that on Arduino Due.

If I am using digital pin to control access to a RAM (address, data, ES and W/R pins ).
I could easier store data in this RAM.

With the VGA lib (modified) I'll enough time to get data from the RAM to built my bitmap or it's just a dream ?

Eddy

#50
Apr 30, 2013, 01:26 am
Your first problem is that the Due doesn't really support the external memory function because they didn't break out all the pins. You can kludge something up but it's just that, a kludge, and I can't remember what (if any) limitations there are with that approach.

One of the guys has a thread about it on the forum here.

As for the timing I'm not sure, but as you can see it's working with internal RAM, external will be slower but I would think still fast enough.

One question is what will you do with all that RAM, it's not required for a text display or even a lo-res graphic display.

______
Rob

Rob Gray aka the GRAYnomad www.robgray.com

beddy

#51
Apr 30, 2013, 01:44 am

Of course external RAM will be slower but may be enough to be just a bitmap.
If it's the case we could display a resolution better with more colors.
If you have a RAM you make a kind of double buffering.

About pins I read that Arduino Due have 54 digital I/O pin.
I don't know very well this product but I'm imaging :
10 pins for vga
8 pins for data RAM
and others for addressing RAM and control.

#52
Apr 30, 2013, 01:58 am
Quote
8 pins for data RAM
and others for addressing RAM and control.

That's sort of correct BUT you have to have the right pins if you want real XM access, and the Arduino team did not see fit to provide them so you will have to dick with the board and solder wires in place.

You can of course bit bang the interface using any old pins but that will be incredibly slow in this context.

As I said though external RAM has been implemented by someone but I can't remember by who or where the post is.

IMO the Due as it stands is not an appropriate platform for hi-res VGA, but if you can properly implement XM it might be OK.

_____
Rob
Rob Gray aka the GRAYnomad www.robgray.com

beddy

#53
Apr 30, 2013, 02:07 amLast Edit: Apr 30, 2013, 02:12 am by beddy Reason: 1
ok tks

I found that

http://arduino.cc/forum/index.php/topic,20025.0.html

#54
Apr 30, 2013, 04:17 am
That thread is about the Mega, an entirely different processor and as such of little use to you with a Due.

______
Rob
Rob Gray aka the GRAYnomad www.robgray.com

EarthMake

#55
Dec 11, 2013, 10:23 pm
Stimmer,

Hats off for a job well done. I have a really cool sunlight readable Sharp 6.5" NTSC on my site at EarthMake for \$69. It has an RGB input and NTSC timing. This means it should take a lot less bandwidth out of the due because ntsc is only 1.4318 MHz versus 25 MHz for vga. Check it out here:
http://earthmake.com/product/amt-002/
If it's something you want to play with email me at randy at earthlcd com and I'll get you one.

Randy

stimmer

#56
Dec 12, 2013, 02:01 am
Look at the VGA library thread (in my sig). NTSC is supported, but the bandwidth for NTSC is actually nearer 6MHz, so needs a sample frequency over 12MHz to generate (I use 14MHz). And as the VGA colour mode is half-resolution I use 14MHz for that too. So the bandwidth is the same, but as NTSC is a more complex signal it actually takes much more out of the Due, not less. (VGA can be done with DMA alone, but NTSC requires processing as well to do the mathematics).
Due VGA library - http://arduino.cc/forum/index.php/topic,150517.0.html

Go Up

Please enter a valid email to subscribe