Kortrijk, Belgium
Offline
Newbie
Karma: 0
Posts: 22
|
 |
« Reply #15 on: January 01, 2007, 06:25:15 am » |
as this is black&white (and there is no burst involved, PAL=4.43Mhz, NTSC=3.38Mhz) it might work on some Tv's because 50Hz * 625 lines = 31250 lines in PAL and 60Hz * 525 lines = 31500 lines so there is only difference of 250 lines/sec, it all depends on the vertical sync of the TV. if we can get to the asm source I think it would be easy to change the 50Hz into 60Hz and the 625 lines to 525 lines. Erik
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Newbie
Karma: 0
Posts: 15
|
 |
« Reply #16 on: January 04, 2007, 08:21:05 pm » |
I think possibly the problem might be that the DigitalWrite command takes a few microseconds to work... maybe you could try using port registers to switch the outputs? http://www.arduino.cc/playground/Code/BitMath#registersYou might need to add up the cycles that you're using to make sure you get exact timing... Sorry if all of what I've said is total rubbish... this is just my guess at a possible solution
|
|
|
|
|
Logged
|
|
|
|
|
The Moon
Offline
Newbie
Karma: 0
Posts: 10
I <3 ?
|
 |
« Reply #17 on: January 04, 2007, 08:37:14 pm » |
I think possibly the problem might be that the DigitalWrite command takes a few microseconds to work... maybe you could try using port registers to switch the outputs? http://www.arduino.cc/playground/Code/BitMath#registersYou might need to add up the cycles that you're using to make sure you get exact timing... Sorry if all of what I've said is total rubbish... this is just my guess at a possible solution I've actually had a feeling that that's where my problem is and I've been trying to figure out just how to figure out how long digitalWrites take. This page might help out though, I'll try it later tonight. Thanks!
|
|
|
|
|
Logged
|
"When skating on thin ice, our saftey is in our speed" - Ralph Waldo Emerson
|
|
|
|
0
Offline
Newbie
Karma: 0
Posts: 15
|
 |
« Reply #18 on: January 05, 2007, 06:16:54 pm » |
Yeah, the guy who did the pic pong counted each clock cycle- I'm hoping that the arduino's delay functions are accurate enough for this... does anyone know of a way to delay a specific amount of cycles in code? If a specific amount can be delayed, and one knows how many cycles each instruction uses, you could get perfect timing this way I should have thought...
The arduino does seem to have quite a bit more processing power than the pic he used, so i'm hoping you could get some better game logic in there...
Keep us updated with your progress though, this is one of the things i want to try when i get my arduino! Roll on a wave of arduino based games I say!
|
|
|
|
|
Logged
|
|
|
|
|
The Moon
Offline
Newbie
Karma: 0
Posts: 10
I <3 ?
|
 |
« Reply #19 on: January 09, 2007, 12:39:29 pm » |
O.K. so after reading some about using the registers and applying it to some code I ended up with this http://datablue.net/random/better_vid.AVINot perfect, but alot better than before! This code still doesn't incorporate the vertical sync because I can't get the timing right. I think It might have something to do with the loop I'm using. /* Composite Video Generation * ------------ * * uses a 2-bit D-A converter to generate * voltages for composite video to RCA. This * code should generate continous white horizontal * lines to create a fullly white TV * * Created 18 December 2006 * copyleft 2006 Kyle Granat <http://www.datablue.net> * http://arduino.cc * * based on Rickard Gunée's pic work * http://www.rickard.gunee.com/projects/video/pic/howto.php * * Register code from Cosine Kitty * http://www.arduino.cc/playground/Code/BitMath#registers */
void setup() { // set pins 0 (serial transmit) and 2 and 3 as output, // but leave pin 1 (serial receive) as input // (otherwise serial port will stop working!) ... DDRD = B00001101; // digital pins 7,6,5,4,3,2,1,0 // Turn off digital output pins 2 and 3 PORTD &= B00000011; // turns off 2..7, but leaves pins 0 and 1 alone
}
void loop() { PORTD = B00000000; // sets out to 0V for sync pulse for 4 uS delayMicroseconds(1); delayMicroseconds(1); delayMicroseconds(1); delayMicroseconds(1);
PORTD = B00000100;//sets out to .33V for 'porch' delayMicroseconds(1); delayMicroseconds(1); delayMicroseconds(1); delayMicroseconds(1); delayMicroseconds(1); delayMicroseconds(1); delayMicroseconds(1); delayMicroseconds(1);
PORTD = B00001100; //sets out to 1V(White) delayMicroseconds(52);
}
|
|
|
|
|
Logged
|
"When skating on thin ice, our saftey is in our speed" - Ralph Waldo Emerson
|
|
|
|
Florida, USA
Offline
Full Member
Karma: 0
Posts: 146
meow!
|
 |
« Reply #20 on: January 09, 2007, 01:16:12 pm » |
My guess is that you might have some problems because of timer interrupts (or other interrupts?) messing up your timing. Just as an experiment, try adding this to the end of your setup(): cli(); // disable interrupts Of course, this will mess up all kinds of stuff you might want to add later, like serial port I/O, use of timers, delay(), millis(), etc. I say this because I was surprised when I tried generating radio frequency energy and encountered an unexpected tone modulated on top of what was supposed to be a pure carrier wave. See here: http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1166896036
|
|
|
|
|
Logged
|
|
|
|
|
The Moon
Offline
Newbie
Karma: 0
Posts: 10
I <3 ?
|
 |
« Reply #21 on: January 09, 2007, 06:13:28 pm » |
My guess is that you might have some problems because of timer interrupts (or other interrupts?) messing up your timing. Just as an experiment, try adding this to the end of your setup():
cli(); // disable interrupts
I disabled the interrupts but nothing noticable has changed. Thanks for the suggestion though.
|
|
|
|
|
Logged
|
"When skating on thin ice, our saftey is in our speed" - Ralph Waldo Emerson
|
|
|
|
0
Offline
Newbie
Karma: 0
Posts: 23
|
 |
« Reply #22 on: January 24, 2007, 08:49:22 pm » |
I disabled the interrupts but nothing noticable has changed. Thanks for the suggestion though. Any news? 
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Newbie
Karma: 0
Posts: 23
|
 |
« Reply #23 on: January 25, 2007, 06:44:00 am » |
Hi, do you understand what's Q1 specifications in that schematic? Thanks, Superware
|
|
|
|
|
Logged
|
|
|
|
|
The Moon
Offline
Newbie
Karma: 0
Posts: 10
I <3 ?
|
 |
« Reply #24 on: January 25, 2007, 10:03:26 am » |
Any news?  Still working on it, though classes seem to be getting in the way :3 I might get a chance this weekend to tinker some more, but no real progress as of late. Also q1 in the schematic is a pnp transtor. I'd imagine a 2n3906 would work fine.
|
|
|
|
|
Logged
|
"When skating on thin ice, our saftey is in our speed" - Ralph Waldo Emerson
|
|
|
|
0
Offline
Newbie
Karma: 0
Posts: 15
|
 |
« Reply #25 on: March 12, 2007, 03:55:21 pm » |
I'm going to start work on an ASM version of this to get the timing exact.
How would I go about writing a block of ASM code in C? Would you just stick all the lines in an asm() ?
|
|
|
|
|
Logged
|
|
|
|
|
Netherlands
Offline
Sr. Member
Karma: 0
Posts: 414
|
 |
« Reply #26 on: March 19, 2007, 05:33:02 am » |
Looking forward to any updates on this. Also, anyone knows if it would be possible to create a video overlay (OSD) with Arduino?
|
|
|
|
« Last Edit: March 19, 2007, 05:33:14 am by jds »
|
Logged
|
|
|
|
|
Kortrijk, Belgium
Offline
Newbie
Karma: 0
Posts: 22
|
 |
« Reply #27 on: March 21, 2007, 03:29:20 am » |
Looking forward to any updates on this. Also, anyone knows if it would be possible to create a video overlay (OSD) with Arduino? http://www.knology.net/~gdion/videoverlay.html
|
|
|
|
|
Logged
|
|
|
|
|
Netherlands
Offline
Sr. Member
Karma: 0
Posts: 414
|
 |
« Reply #28 on: March 21, 2007, 03:39:32 am » |
Thank Erik,
That is a very valuable link!
Cheers,
JD
|
|
|
|
|
Logged
|
|
|
|
|
Poitiers (France)
Offline
Full Member
Karma: 0
Posts: 136
Ca va j'vais le faire !
|
 |
« Reply #29 on: April 20, 2007, 09:13:03 am » |
hello, I had the same idea : http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1176757335. Now I'm giong to read your post, I have some timming pbroblems in interruption mode...
|
|
|
|
|
Logged
|
Cordialement, Benoît ROUSSEAU
|
|
|
|
|