Better Than Original Pong Using Arduino

Games like Pong are legendary, not only in the sense that they are classic hours fun but also that they have a great potential for makers in stretching their learning legs. In an attempt at recreating the original paddle games like Pong and Tennis etc, [Grant Searle] has gone into the depths of emulating the AY-2-8500 chip using an Arduino.

For the uninitiated, the AY-3-8500 chip was the original game silicon that powered Ball & Paddle that could be played on the domestic television. Running at 2 MHz, it presented a 500 ns pixel width and operated to a maximum of 12 Volts. The equivalent of the AY-3-8500 is the TMS1965NLA manufactured by Texas Instruments for those who would be interested.

[Grant Searle] does a brilliant job of going into the details of the original chip as well as the PAL and NTSC versions of the device. This analysis will come in handy should anyone choose to make a better version. He talks about the intricacies of redrawing the screen for the static elements as well as the ball that bounces around the screen. The author presents details on ball traversal, resolution, 2K memory limit and its workarounds.

Then there are details on the sound and the breadboard version of the prototype that makes the whole write-up worth one’s time. If you don’t fancy the analog paddles and would rather use a wireless modern-day touch, check out Playing Pong with Micro:bits

Thanks [Keith O] for the tip.

9 thoughts on “Better Than Original Pong Using Arduino

  1. the original arcade Pong was done in TTL, one big, larger than A3, board.

    anything AY-x-yyyy is worthwhile, there was a cool tank game, a multi game chip with light pen (gun) input, a brilliant “complex sound generator”.

    the General Instruments data manual is an amazing read

    1. Damn I actually pulled apart one of those machines and had an original “pong board”. I was actually after the monitor, they were expensive then. Now lost in the depths of the spiralling e-waste. I also built one from Electronics Australia with all CMOS chips c:1981?. Ah, the sad old days, but it was fun!!! Sadly no sense of history in my own area.

  2. This is one of the best documented and informative projects I’ve seen in a while. Go to the link and have a look at the other projects on his website, its fantastic, really educational (I assume HAD has featured his projects before?).

  3. He’s wrong about the shooting games not working on modern TVs. Pong is actually one of the few light gun games that will still work on a modern TV. The lens is focussed approximately on the screen, there’s a dark tube for the barrel, and an LDR at the end. You could score points by pointing it at a light bulb. It simply looks for light. Just needs a bit of a contrast alteration so it can tell white from black.

    I wrote a sim ages ago for this kind of Pong. It used a lot of counters, emulating timers. Since that’s basically how the old chips did it. Indeed I would bet the timers in the original were fully analogue, just charging and discharging a capacitor. That’s how a discrete version was designed in an old electronics magazine I read.

    You have a line counter, or more likely a charging cap, from the top of the screen to the bottom. You have a comparator for each on-screen bat. If the cap > player’s potentiometer voltage, then it’s time to start drawing the bat. Set a timer for that, too. You can change the discharge rate for a shorter bat, therefore harder game. Then while this timer is active, you set the “bat” indicator to on.

    As the screen is being drawn, various elements are activated at the appropriate time. So, an inch or so from the left, you check if the left bat should be drawn on this line. If it is, raise the “bat” line on the chip.

    Other bat is the same, and the ball’s X and Y values are also held on caps, charged or discharged depending on the direction it’s travelling. Which is held in toggles. When the ball hits a bat, or the outside screen edge, you flip the toggles.

    For the score, again, each “bit” for the 7 segments decides when that segment is drawn. Timing tells the chip whether to connect that segment’s bit to the output (the bat output, actually) for the designed time.

    Each of the output bits, the bat, ball, background, is sent out separately. In a B&W machine you can connect them to the video output using resistors to get greys. Or you can add the optional colourising chip that does the mixing, and adds colours too.

    Not much more to it than that. If you know how an Atari 2600 is programmed, then the beam-chasing graphics make perfect sense.

    I can’t say I’ve had the cap off, but it’s how the discrete versions were done, and certainly how I’d have done it.

    In my version on the PC, I just used counters instead of caps. It even gave a few of the same bugs Pong has! Like the bats going all long if they disappear off the screen.

    1. Not “wrong” about light guns, just slightly off or oversimplified. At least for light guns in general, if not Pong specifically. Modern LCD Displays have only recently gotten to decent refresh rates to rival even old 70s CRTs. For a stretch in the 2000s their refresh rate was abysmal in the 30ish Hz range, almost half the rate the games assumed at 50/60 Hz. An LCD was just as likely as not to drop the contrast frame.

      G2G latency times > 5ms would still be problematic even at higher refresh rates if pixels aren’t entirely cleared between frames and your contrast frame isn’t contrasted enough. Latency between video input and output from post-processing, filters, etc. will also cause issues as the setup requires millisecond precision. For example Guitar Hero informed me that my 4k HDTV had over 100ms of lag(!) with default picture settings. Your HDTV probably has a Game Mode for this reason.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.