Wednesday, May 02, 2012

Reverse Engineering a Dot Matrix Plasma Display

Awhile back, I bought a lot of arcade parts from somebody on Craigslist with the intention of getting some parts and marquees for my house. I wanted to try my hand at reselling as well to see if I liked it. Most of the garage has been sorted, sold or thrown away at this point and in the back corner I found a box labeled "Betson Replacement Screen." I pulled it open and found a brand new dot matrix display. Remembering a post by a friend on his progress reverse engineering a LED display from the 80s, I decided that I had to get a picture on it.

The first thing I did when I got it upstairs was flip it over and google the model number, "APD-128G064A-1". My initial excitement was dashed when I realized that the copious links all pointed to the same 2-page PDF document that was almost entirely devoid of information (datasheet here). It did go over the theory of use at a very high level. Also, thankfully, it discussed voltage requirements. With that bit of information I decided that my best course of action would be to get power to it and see if it did anything, followed by attempting to trace the circuit and figure out what pins did what. Since the datasheet called out the method by which the screen could be updated, I just needed to get a good idea of which pin was for each of the six signals listed. Then I could experiment with a microcontroller and confirm my guesses.

There was a nice test fixture (possibly for probing converted voltages?) that mentioned Vcc, so I stupidly hooked 12V to that and ground to the gnd pin. Nothing happened, and I shut off the power supply and re-read the data sheet. I realized that it called out two different voltages, one for DC-DC conversion to run the plasma display, and one for the logic. With that bit, I re-examined the ignored 4-lead cable attachment and realized that it was probably the power connector. Vcc as labeled was traced to a pin, ground to two more, and I guessed that the last would be the 12-36V DC-DC input. I re-soldered to these instead of the test points and turned the power on. I was immediately greeted with a zapping noise and several of the dots lit up temporarily. Before I could congratulate myself, the power supply tripped. No matter, I knew I had the power lines connected right.

With a renewed excitement, I soldered wires to the used pins of what appeared to be the logic connector and began tracing the circuit out. Every chip on the circuit was a 7400 series chip with the exception of the shift registers. All of them had data sheets online. I managed to probe out several of the connections, concentrating on the circuits that fed the clock and data in pins on the shift registers. After a good hour or so of probing, I had the following crudely sketched schematic and was 99% sure as to the use of four of the six inputs. The other two were either row clock or row data, but I could figure that out by trying both combinations.

Backside of the display.

Schematic bits.

I hurried to Fry's to pick up an Arduino board and they had what they called "Arduino Compatible" OSEPP Uno boards. I got it home and after a bit of googling learned that you had to manually select a different board type. I burned the blinking light test binary on and it worked, so I was off throwing together a quick test application. Armed with a new, beefier power supply, I tried my code. The first thing I attempted was to display a test pattern to the screen. It failed outright. I figured that since the display claimed that the row needed manual resetting that I wasn't clocking the row line in properly. After a bit of time experimenting, I had a program that took the random garbage that showed up on the screen when it booted and stepped it down one line per second. I now knew which line was row clock and which was row data. After a few ore hours of throwing code together, I came up with this program. I powered on the display and below is what I was greeted with:

I had officially achieved liftoff! There was a pesky problem with wobbly pixels in some areas, and the screen refreshed so slowly that it flickered like hell. Also, there was garbage at the bottom of the screen that I couldn't account for. Now that I'd prototyped it, it was time to get rid of the Arduino libraries (they are very slow) and go to raw register accesses. Also, I wanted to create some sort of protocol by which I could update the display using the USB to serial connection provided on the Arduino. I briefly tried creating 3 color and 4 color grayscale images by displaying images 1/2 of the time, and then 2/3 and 1/3 of the time. The screen stopped lighting all the pixels when refreshed too quickly and when I slowed it down well enough to get a clean picture, it flickered, so that was out. Also, since there was only 2 KB of SRAM, I had to place half the image in EEPROM which meant that access times for the two frames were not in sync. I finally settled on a simple serial protocol by which the EEPROM could be rewritten, a 1KB buffer in SRAM could be rewritten, or text could be rendered onto the screen using the EEPROM image as a 128 character 8x8 font.

The program took me a few nights to complete, thanks to some setbacks with the Arduino programming environment. However, I got the column data clocking out via SPI instead of bit banging which drastically improved the refresh speed. I also converted to raw port accesses which helped. The images now displayed crisply and I could dump data to the screen using a test program in Visual Studio. I put my friends to work helping me format an 8x8 font bitmap and drawing black and white images to display, and the results are below:

Text rendering using font burned to EEPROM

A cat!

Milhouse is not a picture.

The current source code to the Arduino application is available here. The visual Studio application that I developed into a console application is available here. They're probably not much use to anyone who doesn't happen to have one of these screens available but I figured they would be educational to the curious. The serial protocol can currently accept a 128x64 image for display or burning into the EEPROM. It can accept text to be rendered. It can clear or invert the screen. It can force text to be drawn normal or inverted. It can also move the cursor. I plan to add several more functions to the serial API such as scrolling and scaling, blitting and other high level graphics operations one might expect from a nice display driver. I would take the easy route and just upload full processed images but unfortunately I can't push the serial past 57600 baud or the interrupt can't keep up with the image refresh.

That isn't all, however. I plan to pick up an old laptop from a friend and put Linux on it. From there, I'll need to port the console application and add a web server. I want to put up a simple PHP script that allows poeple to upload images or text to the screen from the internet. Possibly, I also want it to take twitter updates or texts on a google voice number. Basically, I want this to be an interactive toy that guests who come to my parties can interact with using their phones. Stay tuned for more development!

Saturday, November 12, 2011

Wanted: Competent Video Game Sellers

So you want to sell some video games on craigslist? Maybe you have a few games you don't play anymore. Maybe you are a reseller. Maybe you are cleaning out your parents garage and find something you think is rare. Do all of us a favor when posting and follow these simple instructions so that you don't waste everyone's fucking time with the written equivalent of a crayon drawing of your dick.

First things first. Tell us what you are actually fucking selling! You'd think this is business 101 but there's probably a reason you are selling this on craigslist instead of opening your own game store. If you want to attract anybody at all except for the lowest of low-ballers you will need to specify exactly what you have and what condition it is in! I am not even going to bother replying to you when you leave a vague, poorly worded one sentence post about your Atari and a few games. "Sweetening" the deal by mentioning that you have rarities and not mentioning what they are only makes us suspect that you have no fucking clue what you are doing. It helps to list what accessories come with a system as well as what condition it and the games are in. Also nice to know is whether manuals, cases, boxes or anything else interesting comes with your sale. By the way, brand new means just that: BRAND NEW. If something is opened but not played, it is LIKE NEW. If something is played, it is USED. Don't bullshit me with brand new when it is not factory sealed.

Please actually do some fucking research before claiming rarity on games or systems! I understand that not everyone is a collector but do realize that when you scream on about your super rare Atari 2600 with 40 games, what you probably have is nothing more than $10-$20 worth of garbage that nobody will want to take off your hands. I've noticed a direct correlation between people who think they have amazing sales and notices in the sale about ignoring low-ballers. There's a fucking reason people are low-balling the price you set, buddy! It's because its TOO FUCKING HIGH. Nobody is going to spend $20 to buy your worn copy of Tetris for game boy. It doesn't matter if the system is 20 years old; it isn't fucking rare unless people are looking for it and can't find it!

Also, pictures! Craigslist lets you post pictures for a goddamned reason. Its hard enough to trust a random anonymous stranger on the internet as it is. Provide photographic backup to your description! Don't want to post a picture? You probably have no fucking idea what you are selling anyway. Don't tell me to email you for pictures. If you were too fucking lazy to snap one goddamn grainy cellphone picture, that doesn't lend much to the belief that you will respond at all let alone with pictures that will help me make a decision on your sale! By the way, STOCK PICTURES DO NOT FUCKING COUNT. I know what an Atari Jaguar is supposed to look like. I want to know what YOUR Atari Jaguar looks like.

The condition of your games and systems ACTUALLY DOES MATTER! Believe it or not, there are some people that buy games who want their games to look good. I know for a fact that your copy of Chrono Trigger plays like new. Cartridges don't go bad! But if its covered in permanent marker and barbecue stains complete with a torn label I am not going to pay full price for it, no matter how rare you read that it is. Look at it this way: any of these old games that you are selling can be emulated near perfectly on a computer FOR FREE, so what do your games have that makes them better? I am buying something to own, to show off and to cherish. You wouldn't expect me to pay Kelley Blue Book on a car that has dents and peeling paint, even if it runs just fine! So don't fucking pull that horse shit with video games. This also goes for manuals, cases, boxes and the like. If you expect to fetch a decent price on a video game that isn't rare, have all the pieces that it comes with! If you don't, realize that it is WORTH LESS.

Also, you'd think this would be a no-brainer with something that needs to function, but test your fucking games! If you can't test them for some reason, tell us that you couldn't test them! Expect to get a lower offer unless you are willing to help us test them on the spot during the sale! Do understand that if you do not mention testing the games, it is assumed that THEY WORK. Take the car analogy again: if a car is listed and the seller makes no mention of problems it is a valid assumption to believe that everything works fine!

Now, lets touch on pricing. As with ANYTHING on the market, video games are only worth what somebody is willing to pay for them! This is another business 101 concept that I wish more people would figure out. Just because you saw it go for $300 once on eBay does NOT mean that your used copy of Final Fantasy VII is worth that much. You probably made a mistake in reading the condition of the sale! Was it a sealed copy? Was it a rare misprint? Was it signed by the developer? Chances are your copy is not worth what the most expensive games go for on eBay. Also, nothing infuriates me more than seeing somebody justify ridiculous prices by pointing out that eBay sells it for that much. If you want to sell it for eBay prices, then go sell it on eBay. I know you are a cheap-ass who doesn't want to pay fees, but I am also a cheap-ass who doesn't want to pay eBay prices! The point of exploiting a local market is that things tend to be cheaper! I am not going to go out of my way to drive to your house all the way across town to pick up something that I could have shipped to me for the same price!

With all that in mind, I look forward to purchasing from you! After all, I love video games and I love getting excited about the games you are selling if only you'd allow me to. A well written advertisement for stuff that I want will get me to jump on the sale immediately. That way you can take my money and I can take your games and we can both go home happy. After all, the whole point of doing business is so that both parties walk away happy. Otherwise, what's the fucking point?

Wednesday, March 09, 2011

Beta Site Raffle!

I'm holding a raffle to help kick-start interest in the arcade and game store search features on my beta site. Any time a site member adds a new game store or arcade to the database, they will be entered once into a drawing currently slated for the end of the month. If not enough people have entered the raffle to perform a drawing at the end of the month, the drawing will be delayed until the end of the next month. To keep this from happening, tell people you know to add stores or arcades they know about as well. After a drawing, the raffle will reset and another drawing will happen at the end of the next month. You can enter as many times as you would like by adding as many arcades and game stores you know about. The winner of the drawing at the end of each month will receive their choice in up to $50 worth of Steam gifts. Make sure you have a valid email set in your profile so I can contact you if you win!

Sunday, February 20, 2011

DragonMedia Player 0.25

I have released another minor update to DragonMedia Player, this time with AAC/MP4/M4A support! Also included is the separation of your playlist and your file list. The interface remains the same, but files will continue to play while you browse other directories, and the next and previous track buttons will continue to work. Other minor changes included for stability and polish.

View the Wiki for More Information and a full changelist.

Thursday, January 06, 2011

DragonMedia Player 0.21 Alpha

I have released a minor update to DragonMedia Player that addresses a few of the stability issues present in 0.20. I don't think I got everything, but it seems to be a heck of a lot more stable now. There have been more changes under the hood than are visible to somebody upgrading from 0.20 to 0.21 but these will hopefully enable me to quickly integrate streaming mp3/ogg soon! When I get that finished, I'm going to look into getting aac/m4a integrated and working and then allow aac streaming as well.

View the Wiki for More Information and a full changelist.

Wednesday, December 29, 2010

Marketplace!

I have updated my beta site again to allow for a user-driven marketplace. I am going to get the ball rolling in the next few days with some semi-decent sales. If you have something that you want to sell and are willing to try out the new feature, have at it! For those of you who signed up or are on the fence, we need you to list your local game stores in the game store list as well! The more people that contribute, the better chance you have of finding a neat hole-in-the-wall video game store in your area.

Saturday, October 30, 2010

Game Store Feature!

I have updated my beta site to allow members to add and rate local game stores. My hope with this feature is to amass a decent list of local game stores around the country for those of us who want to find good games at decent prices. Give it a spin as it already has a few game stores that I have added from my travels. Game Stores.

Tuesday, October 12, 2010

Beta Site!

Hey all both of you that still read this! Been working on a social site for gamers, collectors, homebrewers and anybody else interested in video games. I'm scarce on detail as the site is scarce on content, but as I get momentum I'll be updating it more frequently. Check it out at beta.dragonminded.com.

Sunday, August 22, 2010

DragonMedia Player 0.2 Alpha

With time comes the resurrection of an old project of mine. I realized when I moved to my new place that I needed a decent player in my living room. So, instead of purchasing a computer or starting afresh, I grabbed my old DMP and started making fixes and modifications. What we have here is a new version that can play files off of up to 10 Samba shares, has no stuttering issues while browsing or playing off the internet, and allows for hot swappable USB and SD cards. Leave a (non-stupid) comment here or at WiiBrew to let me know how things work out.

View the Wiki for More Information and a full changelist.

Happy listening~

Thursday, July 15, 2010

Repairing a Millipede PCB

Recently, I've been getting into arcade cabinets. I have two of my own in my living room (a Neo Geo four slot and an original Centipede upright) and am in the market for more as space and money permits. I was talking about my recently acquired Centipede cabinet at work and my coworker mentioned that his fiancée had a Millipede PCB in her living room. I got in contact with her and she said that it was broken and was willing to sell it to me for $10. Considering the simplicity of early arcade boards I jumped on the offer, sure that I could repair the board myself.



The first thing to do when I got a hold of it was to plug it into the Centipede cabinet. The PCB had come with a wiring harness that allowed it to plug directly into my Centipede cabinet which saved me the hassle of ordering one online at around $40. I gave the board a once-over to ensure that there were no burned chips or leads and sprayed it with some compressed air to ensure no dust or debris and plugged it in. The following video shows what I got on screen.



The important part of the video is the beeps. The screen is just displaying random symbols as it tries to power up and test all of the components. A bit of Google searching revealed that the bad chip was located at 2M (each chip is labeled on the board). A bit more Googling provided the schematic that Atari provided with new PCBs when they were originally sold. The chip corresponded to the play field RAM and was easily located on the board. Curiously, rework had already been done on the board and several broken traces could be seen. So my first task was to verify that all traces were reworked correctly. I spent about two hours with the schematic in hand tracing every pin out from the RAM chip to every other location on the PCB and verified that all of them were good.

This left two problems: either the RAM chip itself was bad, or one of the chips it connected to was bad. Since the previous repairman had socketed the chip when he had worked on the board I decided to try replacing the RAM chip first. I ordered a few of the same chip (both Centipede and Millipede use the same chip in multiple places so I figured having some spares around would do no harm) and replaced the suspected faulty chip at 2M. After plugging the board back in, I got partial success!



However, the controls would not work. The PCB was probably not set to free play mode, so it was back to Google to retrieve the DIP settings to set the PCB up to the correct mode of operation. After twiddling with those for a good half hour, the cabinet was then on free play and the buttons started working. However as soon as the game started it was evident that the trackball was not working correctly. Moving the trackball steadily in one direction produced wild motions back and forth, and the player tended towards the upper left of the screen. I moved the wiring back to the Centipede PCB and fired it up to see if I hadn't wrecked the trackball circuit in the process but it worked just fine.

I pulled up the schematic again and looked at the trackball input and it was far more complex than simply tracing the RAM, so I fell back to assuming something was wrong with the conversion connectors. They were handmade so it was possible something got switched. After testing every single lead from the Millipede to the Centipede side, I identified two sets of crossed wires: the wires going to the sound board (these made no difference) and the horizontal and vertical position wires from trackball one (for non-cocktail cabinets). I snipped the wires on both pairs and uncrossed them before electrical taping the exposed wires away again and plugged the board back in. Success!



I now have a working Millipede PCB for around $50 (original purchase, a cheap multimeter since my other one broke and the RAM chip order). After verifying the functionality by way of a few games, I mounted the PCB above the Centipede PCB and put the cabinet back together again.



The Centipede board is left in because I like the idea of having an all-original Centipede cabinet, but I don't know when I'll get bored of millipede. For now, I'm out.