![]() |
| Skin:
|
Raspberry PI Arcade Project |
Post Reply
|
| Author | |
RaveN
Senior Member
![]() ![]() Joined: 20 May 2012 Location: Essex Status: Offline Points: 9091 Feedback: 5 |
Post Options
Thanks(0)
Quote Reply
Topic: Raspberry PI Arcade ProjectPosted: 04 May 2013 at 1:19am |
|
Seeing as there's a lot of techies on this site, I thought some of you might have gone out and bought yourself a raspberry PI.
If so, I thought I'd share a project I'm working on at the moment. I'm in the midst of creating a cut down version of a Fluke. The general idea is to interface the Rpi with an arcade board so that it can perform a variety of tests, consisting of: 1) Check the accuracy of the clock. 2) Read the entire memory map and because it can do this: Read/check all eproms Read/Write check of the ram Test the ram/rom buffers. 3) Check RESET, interrupts and bus control lines. 4) Possibly - Attempt to display to screen by writing to the video ram. 5) A pin acting as a logic probe. The idea at the moment is to have enough input/outputs (both normal and High Imp capable) to cater for the older CPUs, so I have enough for Z80, 8080A, 6502 and 6509 etc.. Although the breadboard looks a mess of wires, a manufactured board with SMD components would be a fraction of the size. The chips you see simply perform the following functions: 1) I/O Expanders (to increase the I/O pins of the Rpi) 2) 3.3v (Rpi) - 5v interfacing 3) TTL / CMOS conversion. Whilst something like this won't ever come close to say a Fluke 9010A, it may be useful if it's cheap enough, more user friendly, expandable (i've already made a daughter board so it can program 2708/2716/TMS2532 eproms(the ones my mainstream eprom readers can't do)). A few years back I had a similar project using a PIC18F4550, it used USB to interface with a PC, the problem with that I found is a) you needed a degree in the USB stack to program it, and b) It was still OS specific and my C programming sucks. At least with this it can Rpi dependent, easy and cheap to buy, and it's written in simple Python. Sorry the photo is poor, I only have my phone on me at the moment: ![]() Anyway, what do you guys think, any tips or advice? Cheers, Andy
Edited by RaveN - 04 May 2013 at 1:26am |
|
![]() |
|
IDCHAPPY
Members Profile
Send Private Message
Find Members Posts
Visit Members Homepage
Add to Buddy List
View Feedback
Moderator Group
KANFU Master ![]() ![]() Joined: 01 May 2011 Location: Edinburgh Status: Offline Points: 21522 Feedback: 5 |
Post Options
Thanks(0)
Quote Reply
Posted: 04 May 2013 at 7:46am |
|
Awesome but nutz mate, well done
|
|
|
We are the 45
|
|
![]() |
|
grobda
Senior Member
"Look at the size of that thing!" Joined: 04 Aug 2010 Location: Glasgow Status: Offline Points: 1796 Feedback: 5 |
Post Options
Thanks(0)
Quote Reply
Posted: 04 May 2013 at 10:35am |
|
Sounds like a great idea, my pi is sat on the shelf at the mo.
|
|
![]() |
|
VectorGlow
Senior Member
Joined: 12 Aug 2010 Location: Wales, UK Status: Offline Points: 1040 Feedback: 5 |
Post Options
Thanks(0)
Quote Reply
Posted: 04 May 2013 at 12:09pm |
|
What a fantastic idea - excellent work RaveN.
![]() |
|
![]() |
|
guddler
Members Profile
Send Private Message
Find Members Posts
Visit Members Homepage
Add to Buddy List
View Feedback
Admin Group
Busting vectors like it's 1982! ![]() ![]() Joined: 24 Sep 2000 Location: W.Somerset Status: Offline Points: 38549 Feedback: 5 |
Post Options
Thanks(0)
Quote Reply
Posted: 04 May 2013 at 2:16pm |
|
OK, I was keeping quiet on this until such time as I've completed more than one processor and added more support in the software, then I was going to release it, probably under some form of open source but I've done similar with an entirely off the shelf Arduino.
I have written C# PC software that uses an Arduino as the interface between the PC and the UUT. I've currently implemented Z80 only and can do memory reads / writes and therefore RAM / ROM tests. Currently implementing 6502. There are many things mine cannot do in it's current form, but I'm basically only using the Arduino as a proof of concept. Once I've done that and have the basic PC software written the intention is to replace the Arduino with an FPGA based interface (which I've already got). I'm just struggling with the Verilog / VHDL, hence going for an alternative for the prototype.
I've not considered an rPI as it's a horribly underpowered piece of kit (IMO) for anything with a GUI, so I sold one of mine. I had two and kept my other one back just for RaspBMC...
My biggest problem is that what amuses me and keeps me busy (aka, what I enjoy most) is working out how to do things. Now I've worked out how to do it, actually finishing it may never happen. The Z80 solution has been sat on my dining room table since just after Xmas waiting for me to tear it down and rig up a 6502 based test UUT (an Acorn Electron!)
|
|
![]() |
|
VectorGlow
Senior Member
Joined: 12 Aug 2010 Location: Wales, UK Status: Offline Points: 1040 Feedback: 5 |
Post Options
Thanks(0)
Quote Reply
Posted: 04 May 2013 at 2:21pm |
|
Very nice, we'll be spoiled for choice.
![]() |
|
![]() |
|
Mitchell Gant
Senior Member
Joined: 25 Nov 2011 Location: Chez Vegas Status: Offline Points: 6131 Feedback: 5 |
Post Options
Thanks(0)
Quote Reply
Posted: 04 May 2013 at 5:17pm |
|
I'd better throw my hat in the ring too then!
I've made a similar device using a dsPIC33 demo board that I had laying around, and using just a couple of '573 latches managed to interface it to a 6502 socket on a bootleg Asteroids board. There's an RS232 serial port to connect to a PC running Hyperterminal, so I can send commands to the dsPIC. I can read/write data to addresses, and have part of a RAM test written up to now. I'd already done a 6502/POKEY and a 6809/POKEY emulator on this same dsPIC33 http://www.youtube.com/watch?v=GIcezrwN6RE so for me the next step was to try to plug it into some real hardware and see if I could read and write data. This Asteroids Frankenstein brain is the result. I'd like to get it running Asteroids using 6502 emulation, but it doesn't work properly yet. Though connecting it to a known faulty Asteroids PCB is probably a bad idea... The aim was going to be a 6809 interface running 6809 emulation, plus some maths hardware emulation that the dsPIC is quite good at. No prizes for working out what game that would be with a 6809 and math hardware! But I got this Asteroids PCB so that got connected up first. I did think of using an RPi myself for this, like RaveN has done, but I had the dsPIC board and running some 6502 emulation already, so for me it was easier to do it this way. The RPi will be a lot easier to expand on that's for sure! I like the idea of a logic probe fault finder though, great idea. I'll be following any progress with interest. Keep up the good work!
|
|
|
Boy, is this a machine!
|
|
![]() |
|
RaveN
Senior Member
![]() ![]() Joined: 20 May 2012 Location: Essex Status: Offline Points: 9091 Feedback: 5 |
Post Options
Thanks(0)
Quote Reply
Posted: 05 May 2013 at 10:20pm |
|
Haha, great to see some other guys attempting similar projects. It'll be interesting to find out what can be accomplished with different hardware.
I hadn't intended using the Rpi for this, but as I had one gathering dust on the shelf, and things like SPI drivers already coded for it, I thought it might cut down on the amount of programming. At the moment I'm not using a GUI, just command line and dumping stuff into files. The more I have delved into this, the more I depressingly discover the limitations of the project. It would have been so much better to use something like an Arduino (like guddler is using currently) and then an FPGA. Ideally you want a chip with open drain 5v capable inputs and lots of them (I/O expanders aren't a great idea as I have discovered), that's why my first attempt was with a PIC18 (although that didn't quite have enough I/O either). The reason why I am soldiering on with this is because I really like the idea of the Rpi turning it from just a basic interface into a user friendly system (easy to connect a monitor/keyboard/mouse), or running commands remotely over wifi/ethernet. Not being tied to a particular OS as well. Although it does mean you actually have to own a Pi. The main problem with mine is simply the speed. The I/O expanders I chose are Microchip MCP23S18s (simply as I had a ton of them already and they're pretty good). Using SPI I theoretically have a max serial speed of 10Mhz, although I'm only reliably getting 2Mhz (I'm having lots of fun with the scope and decoupling caps at the moment!) It's taking about 60 clock cycles just to put an address on and get the data, when it takes (for example) the Z80 just 3. One of the things most affected by this is tests on the DRAM, it has to be fine tuned so that it can write and read (for testing purposes) before the ram refresh limit is reached. Another example is the CLK, I thought it would be quite neat if it could analyse the CLK rate to see if it was accurate. I currently have this wired straight to the RPi (through a 74LVC245 to bring to 3.3v), and attempted to count the clocks by setting a RPi pin as an interrupt. This failed miserably and the Rpi b0rked due to the speed (and would need a counter with an overflow to work - yet more ICs). In short, not a bad project, but severe limitations, can perform some handy functions albeit in slow motion. I think that *if* it can at least read the mem map and test the ram, and doesn't require adapters for different older 40pin cpus, and is fairly cheap to make then I think it would be useful. I agree entirely Guddler, the best part is definitely working out how to do things, there's a real feeling of accomplishment when after designing everything and setting up all the electronics, you read a rom address, double check it with a mame rom and see it's spot on! Mitchell Grant: Nice! Xmas 2011 I got myself a PIC32MX and the I/O expansion board - I had considered using that, but again that would have involved using USB as the interface to a PC and I really struggled with coding that, I hope you have better luck as USB seems the only suitable way for proper emulation (unless you offload a lot of the code to the PIC). I have never used a dsPIC33, how do you find them? I've also got scope envy, I can't tell your model # from the photo but I've got the GDS-1102 and yours looks much more fancy :) It's nice to know that if there's at least 3 of us in just this forum with similar ideas, then a product like this is bound to be available at some point in the future. Looking forward to seeing how your projects pan out. Cheers, Andy
Edited by RaveN - 06 May 2013 at 1:06am |
|
![]() |
|
Mitchell Gant
Senior Member
Joined: 25 Nov 2011 Location: Chez Vegas Status: Offline Points: 6131 Feedback: 5 |
Post Options
Thanks(0)
Quote Reply
Posted: 06 May 2013 at 5:30pm |
|
I've done a bit more work on my "test brain" board and it's actually proved it's worth and found a fault today, showing that this sort of thing CAN be useful.
I thought I'd share what I've done with you guys here, as it's likely you'll be thinking about the same sort of thing. I'll be talking specifically about Asteroids hardware tests here, so apologies if this loses anyone technically, but the same principles will surely apply to other games. So my board can read and write anywhere in the address space, driven by a crude and simple command line from the PC terminal. After getting it working plugged into the Asteroids, I could read things like the DIP switch, button inputs, write to sound registers, etc. as I'm sure you've been doing too with your testers projects. Next I wanted to run some simple code in a loop so that it would keep the Asteroids watchdog happy, and read and update all switch inputs and show on the PC terminal screen. But with an Asteroids board, reading and writing RAM, button inputs, writing to sounds, etc is only about a third of the game hardware. The DVG vector generator has the rest of the chips, so how could this be tested from the dsPIC board? What I've done is made the dsPIC code read the DIP switch and use that value to select from a list of specific DVG tests. First test simply inserts a vector HALT instruction to 0x4000 (vector RAM, DVG address 0x0000) , then start the DVG running. It then checks to see if the DVG has halted, and repeats. Second test inserts a JMPL 0x0001 instruction at DVG 0x0000, then a HALT at DVG 0x0001, and runs that in the same way. So that will test a little bit more of the DVG circuit by exercising the JMPL state. I've then made a JSRL test to test the DVG stack to one level, which it passed OK an my board. After that I wrote another 3 test functions to do 2, 3 and 4 JRSL subroutine levels. On my board these all failed, only the single level JSRL would work, the deeper calls never halted the DVG. I assumed (wrongly!) that one of the three 74LS170 file registers that make up the DVG stack was faulty. Desoldering and changing them didn't help though. Next I looked at the '191 counter at K5 and could see by selecting my test functions that although it was getting a clock in, the outputs were not changing. Replacing the '191 now allows all 4 depths of JSRL instructions to pass the test. So it is useful! Of course I could have found this fault in other ways... like , er... well anyone suggest how I'd have found this without the test code? With just a 6502 and the Asteroids ROMs, I doubt you'd be able to narrow it down to that? I only have a logic probe and a 'scope, so not sure how I'd find that fault with just those. I've made test routines to do a simple draw vector for vertical, horizontal, short vertical, short horizontal and absolute position. Now I'm doing more devious vector tests, like: 0x0000 JMPL 0x0001 0x0001 JMPL 0x0002 0x0002 JMPL 0x0003 ... etc Then HALT as the last instruction in vector RAM. This would exercise the '191 counters at board locations F5, H5 and J5. With some careful thought and good knowledge of the game hardware, a suite of test routines could be built up to aid troubleshooting. Of course these tests are all specific to Asteroids, but should easily translate to other Atari vector games. I'm sure other games could also have test routines built up for them too. I guess you could do all this with a Fluke, but having never seen or used one I don't know how simple that would be? I think the idea of a test box based on FPGA, R-Pi, or whatever, would be to have such test functions built in, so even someone with less technical knowledge could manage to plug in the CPU socket, run the tests and see where a failure occured. RaveN: My scope is a GDS-2104 with 4 channel, it was bought for developing a 3 phase AC rectifier, based on a dsPIC33 controller for my day job, so I needed at least 3 channels. So you can see why I'm familiar with the dsPIC33 and why I've used it for this "test brain". Simply familiarity with the code and tools. The scope isn't really all mine, it's also my business partners too, but one of them would not know how to switch it on... so it seems a much better idea to leave it in my little workshop where it can be used for other things. Sadly, I'm also afflicted with the same problems as Guddler and RaveN. Working stuff out is fun until you've done it. Then finishing it off to be useful to someone else is not so much fun and it gets forgotten about. So don't expect some magic arcade test box to come out of all this discussion! |
|
|
Boy, is this a machine!
|
|
![]() |
|
guddler
Members Profile
Send Private Message
Find Members Posts
Visit Members Homepage
Add to Buddy List
View Feedback
Admin Group
Busting vectors like it's 1982! ![]() ![]() Joined: 24 Sep 2000 Location: W.Somerset Status: Offline Points: 38549 Feedback: 5 |
Post Options
Thanks(0)
Quote Reply
Posted: 06 May 2013 at 5:41pm |
|
Excellent work! I'll divulge it more later - just one minor comment regarding how you would diagnose the stack without something like this. Atari has those kind of tests built in to the board. Look on the schems and find the "DIAG STEP" pin. Each time you ground it you're basically executing a different test, just like you've done.
If you search the tech section back to Xmas two years ago there should be a thread where I went into a load of that kind of thing and also wrote some test code on asteroids hardware - it didn't do much, I think I just drew a cross hatch and a bunch of rotating asteroids or something
![]() |
|
![]() |
|
trm
Senior Members
Who loves you, and who do you love? Joined: 24 Jan 2008 Location: USSR Status: Offline Points: 5677 Feedback: 5 |
Post Options
Thanks(0)
Quote Reply
Posted: 06 May 2013 at 5:58pm |
|
Some excellent projects there guys - I can't wait for further updates. I figured I'd throw my hat in too
.I had an idea ages ago for a hardware cheat engine: something that ideally would attach to a CPU/RAM bus via a test clip and allow you to reproduce some of the MAME cheat functionality. The basic idea is to snoop the bus and look for reads or writes to magic locations such as #lives, energy level etc and then grab the bus and either stuff RAM with a fixed value or return the modified value to the CPU. My perfect end result would require no hardware modification to work; obviously that brings a host of challenges and I'm not sure it would ever be possible at least with my level of knowledge if electronics. It's Arduino based because my Verilog is so rough that I'd be undertaking two major challenges simultaneously, plus I had a ton of trouble finding a source for the SCA style connectors I'd need to get a chunk of IO to my Spartan dev board :( I still intend to turn this into an FPGA-based learning project once I've got the underlying hardware designed and proven. The current project state is much closer to a bunch of random source files and a breadboard feeding into a logic analyser than anything resembling the goal above, but it's good fun and sufficiently interesting that I keep coming back to it as time permits. And then shooting off at tangents like designing a library for it :) |
|
|
There'll be no accusations,
Just friendly crustaceans, Under the seaaaaaa! |
|
![]() |
|
Mitchell Gant
Senior Member
Joined: 25 Nov 2011 Location: Chez Vegas Status: Offline Points: 6131 Feedback: 5 |
Post Options
Thanks(0)
Quote Reply
Posted: 18 Aug 2013 at 9:00am |
|
I.ve made some progress with my plugin tester here: http://www.ukvac.com/forum/topic334781_post804497.html#804497
|
|
|
Boy, is this a machine!
|
|
![]() |
|
Post Reply
|
|
|
Tweet
|
| Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |