Friday, July 3, 2020

Programming a 48pin chip with a TOP Programmer

I have a TOP programmer. I got it because of its support for up to 48 pin chips, the wide variety of chips supported, and the cheap price point. I, like many TOP users, was extremely disappointed when I actually tried to program a 48pin chip, and had it immediately fail. I wrote it off as a bad EPROM and forgot about it, until I had a project.

I needed to flash a 48pin 29F400 TSOP to revive a CPS3 cartridge. I purchased a 48 pin TSOP to DIP adapter off of Ebay, and thought that would be it. I was wrong. I got the same error i received earlier with the EPROM.

The error I received said certain pins were disconnected. I checked and rechecked all the pins, and everything had a good connection. After reading every manual I could find on the thing, and hundreds of blog posts, I discovered the TOP programmer expected a different pin out. It wanted all pins to be shifted 13 places.  So I made a thing.

I started by taking apart my existing adapter, and rewiring all the traces. Which left me with this monstrosity:



It looks scary, but it worked. I, however, do not trust how well or for how long this will work. So I drew up a schematic so I could make a PCB.


I decided to add a socket to allow any existing 48 pin adapter or chip to be plugged in and converted.



The final product turned out a lot prettier than my prototype.
Sources will be up on my GitHub.
And you can purchase one pre-made from my Store.

Thursday, July 2, 2020

RGBS2VGA

I made this a while ago but never got around to posting it. I got tired of cutting a VGA cable to get a clean connection when converting an arcade cabinet to VGA. So i made a thing.






Ill post the Gerber and BOM on my GitHub.
These are also for sale at my store.




CPS3 Quick Solder Board for the cps2_digiav

I've been doing a lot of arcade system repairs and mods lately. One quite popular mod is the cps2_digiav by the talented marqs85. This mod gives ditital video and audio output over HDMI for Capcom Systems 1, 2, and 3. The design is quite elegant when installed on the CPS2, but can be a little messy on other systems. A sister board exists to make the install look a bit cleaner on the CPS1, but nothing exists to clean up the install for the CPS3. So I made a thing.




A decided to go with a small antenna connector for BCK, that way it would stay clean and small while keeping the signal clean. On the board itself I kept the BCK signal along the board edge paired with GND.



For the finished product I included a coax antenna cable, a wire harness, the 2 resistors needed for the cps2_digiav board itself, and all additional wires required, pre-cut and tinned.







I think it turned out pretty well, I'm happy with it at least.
Ill throw up Gerber and BOM files on my GitHub.
Premade kits available at my store.

Tuesday, April 7, 2020

CPS2 2-Player / 4-Player wiring switch

So I have this CPS2 (Capcom System II) Dungeons & Dragons: Shadow over Mystara cabinet with an absolutely awful button layout. I'm pretty sure whoever did the button placement on this thing was drunk, stoned, or both. Aside from the button layout being awful, the 4 player cabinets only have 4 buttons per player. This is no good, because I have a huge collection of 2 player CPS2 boards that require 6 buttons per player (that I've never been able to enjoy). Time for me to make a thing.

Now this should be easy, I just need to hook up the wires for the extra buttons, right? Wrong! That would be way too easy. A quick read of a few manuals, and its pretty clear to see that there are two different button configuration standards. One configuration for 2 player, and one for 4 player. The 2 player mode reuses some of the same wiring that's used for the 4 player mode. And to top it all off, each layout puts the buttons in different places. This looks like a job for relays, I just need to figure out how many, and how to hook it all up

After a few cups of coffee, and a headache, I came up with this:

It looks daunting, but its actually quite simple:
-14 Inputs
-14 Relays (i used 16 because its always nice to have spares)
-26 Outputs

I decided if I was going to rewire a bunch of stuff and drill new holes for the extra buttons, I might as well replace everything, and try to fix the horrible button layout (as best I can)


As you can see, the button layout is still... bad. But I didn't want to deal with moving the joysticks, and all i had to work with was a paddle bit and a Dremel. I plan on making a new top at some point anyway, so this will do.

I went with light up buttons, so I could see which buttons were active (those extra relays came in handy), and threw a switch in one of the holes left from the previous layout. Here it is in action:





Everything works! Does this mean were done? Of coarse not. This isn't good enough, I still have another problem to fix.

First, you need to hear a little back story. I have A LOT of CPS2 boards, a ridiculous amount for a single person to own for their personal arcade. Swapping out these boards every time I want to play a different game can be quite annoying, so I invested in Darksoft's CPS2 Multi Kit. This kit lets me convert one of my boards into a multi-cart system that contains all the games I own, on one board, on the original hardware, not emulated, as it should be. All I need to do to swap a game is select it from a 16x2 LCD screen, and click the load button. So lets figure out how to automatically switch the button configuration depending on which game is loaded.

I started by looking into the 16x2 LCD, as it displays which game is currently loaded. After reading every datasheet I could find, I discovered that, while there are lots of different 16x2 LCD's available, once you remove the backpack/controller, the LCD boards that look like this are mostly the same (with maybe difference in pinout).

There are 8 data pins (but only 4 are usually used). And among all the other pins, one stood out to me: the RW (read/write) pin. Setting this pin to LOW lets you write to the display. But setting this pin to HIGH lets you read whats currently being displayed on the LCD. I found an Arduino library and got to work writing something.


I used a LCD off of an Adafruit LCD Backpack, as I didn't want to hurt the one from my Multi-Kit. I quickly realized that the RW pin wasn't being held LOW by logic, but was just soldered straight to ground. So I did what anyone would do, and de-soldered that pin, and wired it directly to my Arduino.  This worked! I managed to write to the LCD, and successfully read back what I wrote. So I  moved onto the LCD from the Multi-Kit.

This LCD had the RW pin soldered directly to ground as well. No problem, we've been here before, just de-solder that pin, and take control of it with my Arduino. Here's were the fun kicked in; I could read and write to the LCD just fine, but most the time it put garbage on the LCD, and the data i got back was not consistent. I realized that the Multi-Kit was sending data pretty regularly, and we were stepping over each other. Another problem easily fixed.

I wired up the Arduino to sit in the middle of the Multi-Kit and the LCD. It would listen to data being sent from the Multi-Kit, and send that data back out. This gave me control of when the LCD would receive data from the Multi-Kit, so the Arduino could send data uninterrupted. This worked, but it was only a partial success. The Arduino would sometimes miss some of the data being sent, which would leave the LCD displaying garbage again. I tried overclocking the Arduino, playing with timing, checking connections, and changing my code. I had it running pretty well at this point, but it would still, on occasion, display garbage, which was unacceptable. I needed a different approach.

Then it hit me; I'm over engineering this; I don't need to read data from the LCD itself, I don't actually need to send any commands to the LCD at all. I can just read whats being sent from the Multi-Kit. This would take a lot less wires, as I'd just be tapping into whats being sent. And, bonus, I wouldn't have to de-solder that RW pin.

This worked on the first attempt. No errors, consistent data, and best of all, no garbage on the LCD. I poked around for a bit, logging all the data for each game, and creating large arrays identifying each game. After a while, this seemed to be a very inefficient way of doing things. This was taking up tons of my program space, and I didn't want to have to do this every time i got a new game. There had to be a simple fix, and there was.

The Multi-Kit looks on an SD card for the games to load, and along with each game is a file that contains what will be sent to the LCD. I modified all these files to include the numbers 2, 3, or 4, at the end, depending on how many players are supported on that game. Now I just needed to look at the last piece of data being sent; that's super easy. I just consistently read data, and looked for a slight pause in data being sent. Then I look at the last bits recorded, and that's all I needed. This worked great, but I didn't like that slight delay in detection. When I turn on the machine, I want those relays to trigger immediately.

Last and final step was speeding this up. I remembered from the datasheets that the EN pin on the LCD would switch states while data is being actively sent, then immediately switch back when its not (it might have helped me if i remembered this sooner). I hooked the EN pin to an interrupt on the Arduino, so when EN switched states, it would immediately read the last bits sent. And it worked. I made a thing.

And i shall name her CPS2 Lightning Kick, because, reasons.


Here's the final schematic:

Download the code here

Check it out on my Github for more: CPS2_Lightning_Kick

Monday, April 6, 2020

Beatmania controller using Arduino Leonardo

Im in the middle of a much needed rehab on my Dance Dance Revolution cabinet, which means its torn apart and unplayable at the moment. That's just no good, as I need some sort of BEMANI fix.

I have some Beatmania games I've never gotten around to playing, because I don't have a proper controller (and I cant just use a keyboard, because I'm some sort of purest or something). And I just finished a major project on one of my arcade cabinets (write-up soon to follow), which left me with a bunch of extra arcade buttons. So I might as well make something.

I started with a project box, drew a simple little layout, drilled some holes, and mounted the buttons.
(its not pretty, but it works)




Then wired it all up.




 And threw together some code.


Check it out on my GitHub for more: bemani_controller

I made a thing

This plague thing has me pretty bored.

Ive been doing tons of projects to try and keep busy, and I figured I might as well document it in some way. I have nothing better to do.

So welcome to my blog.

Programming a 48pin chip with a TOP Programmer

I have a TOP programmer. I got it because of its support for up to 48 pin chips, the wide variety of chips supported, and the cheap price po...