I was thinking about building a video circuit that uses two Arduinos (maybe more) to generate video using NTSC
and the AD725
. Although, VGA might be nice if possible.
Anyway, the idea is to use one Arduino as the background layer and the other one as the sprite layer (overlay).
Then, instead of masking the sprite data and having more cpu time, I was thinking of running the signals through a mux. So that when drawing background data and no sprites (per scanline) then pipe the signal to the AD725. But when there is a sprite mid-line, then the>0v signal of the sprite Arduino would cause the mux to pipe its contents through to the AD725.
Or, something similar.
I believe many arcade boards from the 80's did this. Many of them had entire "sprite boards" attached and the signals would mix. Each layer would have it's own RAM and not be aware of the other layer.
But to do this, I would have to keep the Arduinos sync'd perfectly.
So that's my question. How I can do this?
Oh, my Arduino of choice in the beginning would be the UNO but I have others (DUE, Teensy3.1, etc.) if that would be a better fit.
Thanks.
-
I would discourage using arduino for anything with video. A raspberry Pi comes with a built-on HDMI-out aswell as GPIO pins.aaa– aaa2015年05月26日 11:51:15 +00:00Commented May 26, 2015 at 11:51
-
Not really interested in using the RPi for this. But thanks anyway.cbmeeks– cbmeeks2015年05月27日 11:48:44 +00:00Commented May 27, 2015 at 11:48
4 Answers 4
Arduinos are great for many things, and I think the idea of synchronizing two or more Arduinos might have several applications. However, if I wanted to generated VGA or NTSC video, I would look at the Parallax Propeller as another option.
Many people use the Parallax Propeller to produce VGA video, keeping its 8 processors working in parallel.
- "Hive retro computer" "containing a total of 24 RISC processors, VGA graphics, stereo sound, ... uses all DIP and through hole components."
- "Signal processing module using Parallax's propeller chip", apparently can do "video in ... to do video-overlay then send it to video out."
- Dangerous prototypes has a long list of projects using the Parallax Propeller. "Dangerous Prototypes: Parallax Propeller"
- "Pocket Mini Computer on Parallax Propeller" includes VGA output
- "Propellerpowered Forums" includes many people discussing video output on the Parallax Propeller.
- etc.
-
1I decided on the Propeller. It's almost like it was made for this task. :-)cbmeeks– cbmeeks2015年05月27日 11:49:32 +00:00Commented May 27, 2015 at 11:49
I would take a look at MREtv which seems to promise all that you want to do, with just one arduino. This might not be the answer you're looking for, but getting threads to sync is a pain in the rear end, see this for explanation of why threads are a pain.
Now back on topic, it seems like MRETV might off what you want to do, and it can do some pretty impressive things from what I read in the arduino. You might need to modify the library a bit, but it offers already implemented encoding, so that is a plus.
http://www.instructables.com/id/MRETV-Video-Stereo-Sound-and-much-more-from-a-s/
-
I tried to get that MRETV to work. Followed the instructions to the letter and it wouldn't even compile. This is on a fresh install of the Arduino IDE (newest version).cbmeeks– cbmeeks2015年03月26日 23:31:36 +00:00Commented Mar 26, 2015 at 23:31
-
@cbmeeks Could you give me details of what the IDE spat out when it failed to compile? Are you on windows? What was the actual error, the ide couldn't find a file?HSchmale– HSchmale2015年03月27日 00:08:23 +00:00Commented Mar 27, 2015 at 0:08
-
I don't have the exact error in front of me at the moment. But I'm on a Mac and the error was something along the lines of "must define const sound" or something like that.cbmeeks– cbmeeks2015年03月27日 14:37:24 +00:00Commented Mar 27, 2015 at 14:37
You would need to use interrupts on the "sprite arduinos" to get the timing very exact - the "background" arduino would need to send signals sync signals (horizontal and vertical) to the sprite arduinos. The sprite arduinos would then need to keep track of which line it is on, and time exactly how far along the line it is. You will need a circuit to either allow the incoming signal through (I believe the arduino will be too slow to pass it read it, then write it);
alternatively, have multiple (still synchronized) sources, each indicating if they want to be on the screen; then one that takes the "I want to be on the screen" signals, make a decision, and connect the appropriate one (via a transistor).
A basic tutorial on TV out is found at: http://playground.arduino.cc/Main/TVout
Just a thought, you could try synchronizing micros() / millis() between Arduinos... [ https://aaka.sh/patel/2013/12/23/synchronizing-micros-millis-arduino/ ]
Over time you could set instructions/commands to execute at certain time intervals on target arduinos using something as simple as a 2 wire serial setup [ http://arduino.cc/en/Tutorial/MasterReader ]