There are reports of a Tetris movie with a sizable budget, and with it come a plentiful amount of questions about how that would work. Who would the characters be? What kind of lines would there be to clear? Whatever the answers, we can all still play the classic game in the meantime. And, thanks to some of the engineering students at Cornell, we could play it without using a controller.
This hack comes from [Bruce Land]’s FPGA design course. The group’s game uses a video camera which outputs a standard NTSC signal and also does some filtering to detect the user. From there, the user can move their hands to different regions of the screen, which controls the movement of the Tetris pieces. This information is sent across GPIO to another FPGA which uses that to then play the game.
This game is done entirely in hardware, making it rather unique. All game dynamics including block generation, movement, and boundary conditions are set in hardware and all of the skin recognition is done in hardware as well. Be sure to check out the video of the students playing the game, and if you’re really into hand gesture-driven fun, you aren’t just limited to Tetris, you can also drive a car.
Continue reading “Hand Gestures Play Tetris”
The ESP8266 is well known as an incredibly small and cheap WiFi module. But the silicon behind that functionality is very powerful, far beyond its intended purpose. I’ve been hacking different uses for the board and my most recent adventure involves generating color video from the chip. This generated video may be wired to your TV, or you can broadcast it over the air!
I’ve been tinkering with NTSC, the North American video standard that has fairly recently been superseded by digital standards like ATSC. Originally I explored pumping out NTSC with AVRs, which lead to an entire let’s learn, let’s code series. But for a while, this was on the back-burner, until I decided to see how fast I could run the ESP8266’s I2S bus (a glorified shift register) and the answer was 80 MHz. This is much faster than I expected. Faster than the 1.41 MHz used for audio (its intended purpose), 2.35 MHz used for controlling WS2812B LEDs or 4 MHz used to hopefully operate a reprap. It occasionally glitches at 80 MHz, however, it still works surprisingly well!
The coolest part of using the chip’s I2S bus is the versatile DMA engine connected to it. Data blocks can be chained together to seamlessly shift the data out, and interrupts can be generated upon a block’s completion to fill it in with new data. This allows the creation of a software defined bitstream in an interrupt.
Why NTSC? If I lived in Europe, it would have been PAL. The question you’re probably thinking is: “Why a dead standard?” And there’s really three reasons.
Continue reading “Color TV Broadcasts are ESP8266’s Newest Trick”
Making retro video games on today’s micro controllers brings many challenges, especially when using only the micro controller itself to handle the entire experience. Complex graphics, sound, game logic and input is taxing enough on the small chips, toss in NTSC color graphics and you have a whole different bear on your hands.
[rossum] set out making the Arduinocade retro game system using an overclocked Arduino Uno, and not much more. Supporting 4 voice sound and IR game controllers, the system also boasts 27 simultaneous colors all in software. These colors and the resolution feel like they’re impossible without a graphics chip to offload some of the work. While doing all of this the ATmega328p is also playing some faithful reproductions of classic arcade games.
The uses a couple of interesting tricks. Color is generated with NTSC color artifacts, where the screen is really black and white, but thanks to a delay or two in the signal generation the bits are out of phase from the reference “color burst” signal and appear on-screen as unique colors. This approach was used in the 8 bit Apple II personal computers to generate its colors, and also on the early IBM PC’s with CGA cards to drastically increase color depth. In this case, the chip is overclocked with a 28.6363 MHz crystal (a multiple of NTSC timing) and the SPI hardware leveraged to shift out all the necessary pixels. Check out how great it looks and sounds after the break.
It’s good to see an old trick on a new project and we are off to play some games!
Continue reading “Retro Games on ArduinoCade Just Shouldn’t Be Possible”
It’s graduation time, and you know what that means! Another great round of senior design projects doing things that are usually pretty unique. [Bruce Land] sent in a great one from Cornell where the students have been working on a project that uses FPGAs and a few video cameras to keep score of a ping-pong game.
The system works by processing a live NTSC feed of a ping pong game. The ball is painted a particular color to aid in detection, and the FPGAs that process the video can keep track of where the net is, how many times the ball bounces, and if the ball has been hit by a player. With all of this information, the system can keep track of the score of the game, which is displayed on a monitor near the table. Now, the players are free to concentrate on their game and don’t have to worry about keeping score!
This is a pretty impressive demonstration of FPGAs and video processing that has applications beyond just ping pong. What would you use it for? It’s always interesting to see what students are working on; core concepts from these experiments tend to make their way into their professional lives later on. Maybe they’ll even take this project to the next level and build an actual real, working ping pong robot to work with their scoring system!
Continue reading “FPGAs Keep Track of your Ping Pong Game”
Provided you have an NTSC-compatible TV you can build yourself a really inexpensive spectrum analyzer. From there you just need one trivial piece of hardware to complete this build. [Bruce Land] has come up with a spectrum analyzer that shouldn’t cost any more than $5, if that’s what’s been keeping you from adding this tool to your workbench!
The spectrum analyzer is based on a PIC32 microcontroller which was previously proven in his Oscilloscope project. [Bruce] has managed to squeeze quite a bit out of this robust chip; the spectrum analyzer has 450 kHz bandwidth and runs a 256 Hz TV display and can output over 30 updates per second. The microcontroller runs the Fast Fourier Transform (FFT) to do calculations, with great results.
[Bruce] notes that the project was based on TV framework from another project, and that the FFT was added on top of that. Be sure to check out the source code on the project site if you’ve been on the hunt for an inexpensive spectrum analyzer, and if you need something with more processing power but only slightly more money, check out the FFT that runs on the Raspberry Pi’s GPU.
[CNLohr] has made a habit of using ATtiny microcontrollers for everything, and one of his most popular projects is using an ATTiny85 to generate NTSC video. With a $2 microcontroller and eight pins, [CNLohr] can put text and simple graphics on any TV. He’s back at it again, only this time the microcontroller isn’t plugged into the TV.
The ATtiny in this project is overclocked to 30MHz or so using the on-chip PLL. That, plus a few wires of sufficient length means this chip can generate and broadcast NTSC video.
[CNLohr] mentions that it should be possible to use this board to transmit closed captioning directly to a TV. If you’re looking for the simplest way to display text on a monitor with an AVR, there ‘ya go: a microcontroller and two wires. He’s unable to actually test this, as he lost the remote for his tiny TV from the turn of the millennium. Because there’s no way for [CNLohr] to enable closed captioning on his TV, he can’t build the obvious application for this circuit – a closed caption Twitter bot. That doesn’t mean you can’t.
Continue reading “ATtiny85 Does Over The Air NTSC”
For their ECE 4760 final project at Cornell, [Varun, Hyun, and Madhuri] created a real-time sound spectrogram that visually outputs audio frequencies such as voice patterns and bird songs in gray-scale video to any NTSC television with no noticeable delay.
The system can take input from either the on-board microphone element or the 3.5mm audio jack. One ATMega1284 microcontroller is used for the audio processing and FFT stage, while a second ‘1284 converts the signal to video for NTSC output. The mic and line audio inputs are amplified individually with LM358 op-amps. Since the audio is sampled at 8KHz, a low-pass filter gets rid of frequencies above 4KHz.
After the break, you can see the team demonstrate their project by speaking and whistling bird calls into the microphone as well as feeding recorded bird calls through the line input. They built three controls into the project to freeze the video, slow it down by a factor of two, and convert between linear and logarithmic scales. There are also short clips of the recorded bird call visualization and an old-timey dial-up modem.
Continue reading “Video Voice Visualization”