CPUWIZ Posted September 28, 2014 Author Share Posted September 28, 2014 Heh, I finally have one day off and nobody else is bugging me, so I just figured out that this is just a flavor of SPI. Not sure if I can support the PS2 Guitar Hero controller, it supposedly works at 250KHz and the normal sticks run at 500KHz. Not worrying about it for now. I have the controller talking back and telling me that it is in digital mode (0x41), this is the start for everything. I did not use the SPI module in the PIC, for several reasons I won't go into right now, I did it with bit banging the controller myself. Having a logic analyzer (Saleae 8 channel USB Chinese knock-off), is fantastic, it makes getting the timing right much easier. It's a start. EDIT: Got it pumping debug data back to the PC, through a 112kbps serial connection, via USB. People like pictures... 3 Link to comment Share on other sites More sharing options...
7800 Posted September 29, 2014 Share Posted September 29, 2014 I'm interested. Link to comment Share on other sites More sharing options...
CPUWIZ Posted September 29, 2014 Author Share Posted September 29, 2014 Got full control over what I care about now, I can read 16 digital button presses at once and 4 analog values at the same time. Vibration would require a 9V battery, so I am not concerned with it, at the moment. Funny that the "deadzone issue" is pretty much identical to what I had to deal with back in the PS2 developing days. LOL I have 11 pins for output left (after I ditch the UART debug output), that can feed into both joystick ports, I can do whatever with the input values and map them however I like. One could map this to have analog control, left and right, with the same resolution as the PS2. Without incurring extra cycles on the 7800, simply map the analog value of one of the horizontal analog sticks to UDLR on both ports and you get a full 8 bit analog value. Now I am thinking! There may be a way to make the button mapping programmable via USB. Hmm. 2 Link to comment Share on other sites More sharing options...
CPUWIZ Posted September 29, 2014 Author Share Posted September 29, 2014 Hmm, because of the deadzone issue, that has always been there and the fact of the 7800's limited resolution, reading one analog stick could be done with 4 bits each. $00 | | | $00 ------+------- $0F | | | $0F This could just map as 4bit values to both UDLR's and still be digital in nature of reading it. 1 Link to comment Share on other sites More sharing options...
CPUWIZ Posted October 5, 2014 Author Share Posted October 5, 2014 Video coming today... 1 Link to comment Share on other sites More sharing options...
gambler172 Posted October 5, 2014 Share Posted October 5, 2014 Hi CPUWIZ wanna have one haben wollen LMK,when available......greeeeaaat work greetings Walter Link to comment Share on other sites More sharing options...
Hyperboy Posted October 5, 2014 Share Posted October 5, 2014 F' Yea! Link to comment Share on other sites More sharing options...
PacManPlus Posted October 5, 2014 Share Posted October 5, 2014 Oh, I *will* be picking one of these up when they are available Link to comment Share on other sites More sharing options...
Trebor Posted October 6, 2014 Share Posted October 6, 2014 Amazing, but not surprising. The man delivers again! Awesome work as usual, CPUWIZ! Link to comment Share on other sites More sharing options...
Jinks Posted October 6, 2014 Share Posted October 6, 2014 Amazing!! Link to comment Share on other sites More sharing options...
CPUWIZ Posted October 6, 2014 Author Share Posted October 6, 2014 Hah, thanks guys. I really wanted to see if this would work the way I had it penciled on paper, seems like I was quite right. I picked up a wireless controller from Amazon last week, that thing is a piece of crap, I don't know how that would even be compatible with released games. To give you an idea: DualShock2: Identifier = 0x73 and 6 bytes of data (2 for all buttons and 4 for both analog UDLR's). Range of each analog value = 0x00->0x80->0xFF (0x80 is centered and jitters). Wireless: Identifier = 0xB9 and same 6 bytes as above, except 2 buttons don't work and the range for the analog values is 0x80->0xC0->0xFF I have some more ideas in mind, but one thing is for sure, I don't need a new PCB. Link to comment Share on other sites More sharing options...
CPUWIZ Posted October 6, 2014 Author Share Posted October 6, 2014 BTW, there is nothing 7800 about this interface, I can map this to all consoles that use a normally LOW enable line for their direction/button (2600/Genesis etc.). Adding support for digital only controllers now (arcade sticks, PS1 controller etc.). 1 Link to comment Share on other sites More sharing options...
CPUWIZ Posted October 6, 2014 Author Share Posted October 6, 2014 Nice, no problemo reading these and mapping them however I want. 1 Link to comment Share on other sites More sharing options...
CPUWIZ Posted October 6, 2014 Author Share Posted October 6, 2014 I got this one from someone a looong time ago, I never tried it until today (was digging for the DDR pad). Wicked, it has old school rapid fire for a shitload of buttons. All works. 3 Link to comment Share on other sites More sharing options...
AtariBuff Posted October 6, 2014 Share Posted October 6, 2014 Hmmm, ich möchte auch einen Link to comment Share on other sites More sharing options...
Master Phruby Posted October 6, 2014 Share Posted October 6, 2014 That's pretty cool! Great job man! Link to comment Share on other sites More sharing options...
Indiana Quack Posted October 7, 2014 Share Posted October 7, 2014 Hi Just have a controller question here. Does anyone know if this would work with a X Arcade. I have the ps2 adapter and would love to use my X Arcade on my 7800. So if yes I'm definitely interested in one. Thank you Link to comment Share on other sites More sharing options...
CPUWIZ Posted October 7, 2014 Author Share Posted October 7, 2014 I don't own one, so I couldn't tell you, I have no idea how this controller adapter you are talking about, identifies itself as. Sorry, the only way to find out, is to send it to me. LOL I just came across a controller for the PS1, that does not respond to protocol requests at all, last night. Some MadCatz PS1 controller with auto fire, it sends no response at all. Link to comment Share on other sites More sharing options...
+Stephen Moss Posted October 7, 2014 Share Posted October 7, 2014 Heh, I finally have one day off and nobody else is bugging me, so I just figured out that this is just a flavor of SPI. Not sure if I can support the PS2 Guitar Hero controller, it supposedly works at 250KHz and the normal sticks run at 500KHz. Not worrying about it for now. If you are talking about PS2 DualShock they actually switch speeds depending on which mode they are in. Hah, thanks guys. I really wanted to see if this would work the way I had it penciled on paper, seems like I was quite right. I picked up a wireless controller from Amazon last week, that thing is a piece of crap, I don't know how that would even be compatible with released games. To give you an idea: DualShock2: Identifier = 0x73 and 6 bytes of data (2 for all buttons and 4 for both analog UDLR's). Range of each analog value = 0x00->0x80->0xFF (0x80 is centered and jitters). Wireless: Identifier = 0xB9 and same 6 bytes as above, except 2 buttons don't work and the range for the analog values is 0x80->0xC0->0xFF <<< WTF? You might find that happens with wired controllers as well as I have encountered a similar problem using Sony controllers. Controllers from one factory (either A or H) will work but those from the other do not and you get what appears to be incorrect data back! Presumably software produces pay Sony for a driver that somehow gets around the problem which is why they all work fine when plugged into an actual PS2. 5 Link to comment Share on other sites More sharing options...
Trebor Posted October 7, 2014 Share Posted October 7, 2014 If you are talking about PS2 DualShock they actually switch speeds depending on which mode they are in. You might find that happens with wired controllers as well as I have encountered a similar problem using Sony controllers. Controllers from one factory (either A or H) will work but those from the other do not and you get what appears to be incorrect data back! Presumably software produces pay Sony for a driver that somehow gets around the problem which is why they all work fine when plugged into an actual PS2. Great info, Stephen. Thanks for sharing it! Incompatibility reports with newer PS2 revision controllers not working (fully) on anything but slim PS2 consoles are out there. This site provides a list of various (PS2) controller revisions. Interestingly, early in its cycle, they kept the same model 'A' letter while making changes to the internals of the controller: Playstation 2 Dual Shock A (Early Version with Resistor) Playstation 2 Dual Shock A (Early Version w/o Resistor) Playstation 2 Dual Shock A (Middle Version) Playstation 2 Dual Shock A (Late Version) Playstation 2 Dual Shock H Playstation 2 Dual Shock M Revision M shows a slightly different PIN layout than the other controllers, like a Late Version A. Revision H has an additional PIN not present in version A or M. Hopefully, most of the changes are not significant enough to impact adapter design(s); nonetheless, it would be prudent to take revisions and changes of the PS2 controller into consideration. For the curious, here are the various PS2 controller diagrams referenced in the above list: PS2_Controller_Diagrams.zip 1 Link to comment Share on other sites More sharing options...
RevEng Posted October 7, 2014 Share Posted October 7, 2014 Excellent and impressive work here from CPUWIZ, as always! DualShock2: Identifier = 0x73 and 6 bytes of data (2 for all buttons and 4 for both analog UDLR's). Range of each analog value = 0x00->0x80->0xFF (0x80 is centered and jitters). Wireless: Identifier = 0xB9 and same 6 bytes as above, except 2 buttons don't work and the range for the analog values is 0x80->0xC0->0xFF <<< WTF? I could be completely wrong here but after doing a bit of research, the 0x73 ID response seems to be a current-mode ID (ie.analog, vs 0x41 for digital mode) vs a controller ID. The microcontroller interface code I've come across keeps trying to stick the controller in analog mode until the mode ID comes back as 0x73. Maybe 0xB9 is a new enhanced mode, but if you keep sticking it in analog mode it will eventually go to classic 0x73 analog mode? Again, clueless if the advice applies to this controller or not, or how useful it is. Link to comment Share on other sites More sharing options...
CPUWIZ Posted October 8, 2014 Author Share Posted October 8, 2014 Yes, the normal controllers come up as 0x41, I then force it into configuration mode, select analog + lock (user can no longer use the analog button), then exit configuration mode. After that the device ID is 0x73. With that wireless controller, it comes up by default with 0xA0 and after I do the above, it returns 0xB9. The wireless controller may be operating at a different speed and something is shifted or some such thing. Not worried about a 12 dollar piece of crap from China. I'd love to test some more, anyone want to send me anything weird? I have a lot of PS2 peripherals, so I got some time. I just tested a PS2 DS Model H and it works fine. Also tested a PS1 DualShock, also works fine. I should have a JogCon and a NegCon somewhere too, since I worked for Namco at the height of all this. Still can't find my DDR pad, weird, it's pretty big. I need to find my PS1 mouse and make a demo of using a mouse on the 7800. LOL P.S. I dug up my PS1 GunCon (rare black version) Time Crisis bundle, it comes back with 0x63. I don't have a video modded 7800 though, so I can't really try to make a demo for it, since the GC requires a video pass through. 2 Link to comment Share on other sites More sharing options...
+swlovinist Posted October 8, 2014 Share Posted October 8, 2014 Amazing work, I am interested if they are ever made and sold. Link to comment Share on other sites More sharing options...
CPUWIZ Posted October 9, 2014 Author Share Posted October 9, 2014 Yeah baby, I found the mouse and the DDR pad (and a weird one handed steering wheel, I had to cut it out of it's original packaging). Don't have time to test right now, but next full compile, I might. Link to comment Share on other sites More sharing options...
atarian63 Posted October 9, 2014 Share Posted October 9, 2014 wow, this would be great, me want!! Link to comment Share on other sites More sharing options...
Recommended Posts