| Main > Main Forum |
| USB vs PS/2 vs COM vs LPT |
| << < (5/43) > >> |
| KagatoAMV:
This thread reminds me of trying to get the bi-directional parallel ports working properly between some Compaq desktops and some R&D Equipment. Driver-man, have you observed the problem you brought up in your earlier post when using keyboard emulator based controls? Or are you approaching this from the logic/mathematical point of view? I'm curious if there is a practical difference in input methods, detectable by either the game emulator or the player. I suppose you could set up a double blind test... that's a fun experiment to consider. ;D |
| JustMichael:
--- Quote from: Driver-Man on September 20, 2010, 08:45:02 am --- --- Quote from: JustMichael ---You seem to think transmitting data 1 bit at a time is a bad thing. If you haven't noticed, hard drives have gone from parallel ATA to serial ATA. They transmits the data 1 bit at a time. They have smaller cables (due to fewer wires needed) and even more data comes through in the same amount of time. Did you know that a lot of the "internet" is transmitted 1 bit at a time? One pulse of laser light in that fiber optic at a time. Just because a method transmits 1 bit at a time doesn't necessarily make it slower. --- End quote --- Having the same frequency, 8 bits at the time is faster than 1 bit at the time. Serial communication is popular becasue it's cheaper (less wires) and we can even-up the difference by increasing the frequency. On the other hand, brain for example works in parallel which makes it possible to achieve high information bandwidth while still operating at low frequency ~500Hz (mine works @ 1000Hz.... but it's overheating often, heh). It's not about good and bad, just better or worse for some given application, were "worse" might just as well be "good enough". --- End quote --- But the reality of the situation is they don't have the same frequency. One of the big reasons of going to serial is that as the frequency gets higher a parallel system starts picking up interference even more and even interfering with itself. Yes I am sure they could build parallel cables to do the job but in reality the cables would be extremely expensive. --- Quote --- --- Quote ---You do realize that the windows default polling rate for HID (Human Interface Device) USB devices is 125hz (125 times per second). You said Mame looks for input 60 times per second. Hmmm, looks like USB exceeds this. Now let's look and see if USB can transmit all the keys pressed at once. Let's use the slowest USB specification USB 1.0, which transmits around 1.5Mhz which translates into about 180 kilobytes per second. Lets divide that 180K by 125 (default polling rate in windows) and we get 1.44K or 1,440 bytes. Now let's toss away 1/2 of that to "overhead" (yes I know overhead stuff is nowhere near that high). That leaves 720 bytes. I think 720 bytes is more than enough room to transmit what keys are being pressed. --- End quote --- Yes, that's one part of it. But, it's not about USB speed at all, it's about controller clock frequency and computer sampling rate of the port, as you said. USB is fast, for the sake of simplicity we can even say the transmission is instantaneous, this is not what matters much and I am not talking about it at all. If animation is at 60FPS, then 720 bytes per second would give us 12 scan codes per frame, which can be less than 12 inputs as some keys, such as 'arrow keys', use two scan codes, and what is worse there needs to be a delay between each code... but, again, this is not the real bottleneck here. --- End quote --- In the example I listed 180K per second not 720 bytes per second. I listed 720 bytes being transmitted each time the USB device is scanned. Let's say every key has 4 scan codes (or bytes). This would mean that the USB device could send up to 180 keys every time it is asked. --- Quote ---The bottleneck is 125Hz (windows default polling rate for HID), although I think it's 250Hz, with the possibility to go up to 1000Hz, but I find it hard to Google a good source for these numbers and confirm it. Anyway, if animation is at 60FPS, then 125Hz would give us only 2 scan codes per frame, which is only one input if the key you pressed was arrow key. --- End quote --- USB does not transmit just 1 key each time it is polled like you are trying to suggest. The USB device transmits a block of data each time it is asked. The computer takes the USB data and determines which keys are being press and tells Mame all the keys that are being pressed each time Mame asks. --- Quote --- --- Quote ---Just so you know, devices like the I-PAC read their inputs in parallel to avoid any possible ghosting and they even read their inputs more than 60 times a second. So a USB device like an I-PAC will report what keys are being pressed 2 times for each time that Mame asks for inputs. It looks like USB devices exceed what Mame needs. --- End quote --- There it is, the second part, another frequency that matters. Now we have: a.) controller clock frequency - rate (not speed) at which data is sent b.) windows sampling frequency - rate at which data is read from the port Do you say I-Pac can generate scan codes at maximum of 120Hz? If so, than that's your new bottleneck, but not much worse than 125Hz you said it's Windows default sampling rate of HID. Anyhow, if animation is at 60FPS, then 120Hz would again give us only 2 scan codes per frame, which is just one input if the key you pressed was arrow key. PS1 controller port clock is at 250kHz, and PS2 at 500kHz, that's kilo hertz. I do not know at what rate PS1 and PS2 DualShock controllers can send the data, though I would certainly expect it to be above 900Hz. --- End quote --- The I-PAC detects which keys are being pressed way way more that 120 times per second. The I-PAC sends all the keys that are being pressed whenever windows asks. The I-PAC does NOT send only 1 key each time windows asks it. It sends all of them as a block of data. --- Quote --- --- Quote --- --- Quote ---Only LPT can communicate *instantaneous* state of the port at any given time and as often as the CPU clock ticks, 8 bits at the time, in parallel, which means you can read the state of 16 buttons in just two instructions. --- End quote --- Doesn't matter one bit (pun intended). The state of the port only matters when you are looking at it. If you look at it 60 times a second, its state only matters during those 60 times. USB gets checked twice as often. --- End quote --- Of course it matters. Yes, I suppose you could say it only matters when you are looking at it, but that is exactly how you handle input, you look (read) the current state of input. Waiting for input to come is no good. So, if USB gets checked 120 times per second, that will give us only 2 inputs per frame, which means that if you press DOWN+RIGHT, you will not be able to fire until the next frame. That sounds too bad, so I think we do not have correct numbers. Anyway, if you look at some older source of MAME you can see this: --- Code: ---input.c /* since the keyboard controller is slow, it is not capable of reporting multiple key presses fast enough. We have to delay them in order not to lose special moves tied to simultaneous button presses. */ --- End code --- --- End quote --- Again you seem to think USB devices sends only 1 key each time they are asked. They don't. USB devices send a block of data which will contain all the keys that are being pressed. --- Quote --- --- Quote ---You seemed to have forgotten to add in a very nasty cost. The cost of someone's "Time". Simply put when you add in the time for us to search around to find out how to interface to the LPT port, time to decide what parts we will need and time to go and buy them and time to try to assemble the whole thing (even if we don't fry anything). Now personally I would rather buy an I-PAC knowing that it will work and spend the few hours I saved having fun with my children. Is the LPT interface cheaper? IMHO, money-wise yes but overall no (especially if you fry something). --- End quote --- It took me about 25 min to solder 11 wires, and that was it. I guarantee it will work. Do you think MAME would support it just like that? This very well tested and documented interface. I do not see how could you possibly fry anything, it's very low current and voltage on parallel port, plus all the pins are designed to carry it, you do not need any external source of power, or anything. There is nothing to search for, here you have it all: http://www2.burg-halle.de/~schwenke/parport.html There is 9 data lines which you connect to one end of the microswitch (5 buttons + 4 directions), the other end of the microswitch you connect with "ground pin", just like with real arcade harness. The best part is that to add another joystick (9 more inputs) you only need to add one more ground wire, and that's all. There is maximum of 7 grounds, so maximum of 9x7 = 63 inputs. I explained it here in more detail: http://forum.arcadecontrols.com/index.php?topic=105222.0 --- Quote ---Highly depended upon manufacturer of the LPT port. I would recommend sticking to whatever is the accepted method of interfacing to the LPT port and not using "just wires". --- End quote --- I don't know what you mean. All the LPT ports simply must have these lines used in this interface, otherwise they would not work with printers either. -- I tested this on 5 computers, from old to new, including one laptop, it worked perfectly everywhere. -- Where is your sense of adventure? Where did your "Build Your Own" from "Build Your Own Arcade Controls" go? --- End quote --- The website you posted as an example shows a device with resistors and diodes but yet you say you don't need any of that stuff. This makes my Rule #1 alarm bell go off. Rule #1: Don't believe everything you read on the internet. Sub-rule #1a: Even if you are willing to believe what you read, take it with a block of salt. Since you state something other than what your example shows I would have to check around and see what information I could come up with to confirm or deny your supposition. Even if you stated the same thing as your example stated, I would still have to check around to determine the facts for myself before I risk my computer. Before you say "What risk? There is no risk!", about 5 years ago a friend of mine tried wiring a couple joysticks to his printer port. He had me there to test them out with him. When he powered on the pc, we heard a muffled pop and then smelled a funny smell (not funny in a good way either). His machine never booted up. I can only guess he miss wired something or the plans he followed were incorrect. Either way, after that day I just leave well enough alone. |
| RandyT:
--- Quote from: Driver-Man on September 19, 2010, 09:39:16 pm ---In fact, of all the parallel ports drivers and joysticks there is only one you want to use - TurboGraFX or "tgxlpt1". http://www2.burg-halle.de/~schwenke/parport.html Good news is MAME already supports this interface, even better news is that this just happens to be the CHEAPEST one you can build. You only need the wires to connect microswithes with your LPT port, that's all. In my experience you DO NOT even need any resistors or diodes. --- End quote --- Without the pull-up resistors, the method will not work at all on parallel ports where they weren't built in. Some were, and some weren't. Now consider the following, where the green dots are switch closures; Without diodes, what do you think happens at junction [ACK, Data 0] ? If you don't know, you have no place in this community to direct others as to what is and isn't the best way to interface their controls. RandyT |
| JustMichael:
--- Quote from: RandyT on September 20, 2010, 04:32:34 pm --- --- Quote from: Driver-Man on September 19, 2010, 09:39:16 pm ---In fact, of all the parallel ports drivers and joysticks there is only one you want to use - TurboGraFX or "tgxlpt1". http://www2.burg-halle.de/~schwenke/parport.html Good news is MAME already supports this interface, even better news is that this just happens to be the CHEAPEST one you can build. You only need the wires to connect microswithes with your LPT port, that's all. In my experience you DO NOT even need any resistors or diodes. --- End quote --- Without the pull-up resistors, the method will not work at all on parallel ports where they weren't built in. Some were, and some weren't. Now consider the following, where the green dots are switch closures; Without diodes, what do you think happens at junction [ACK, Data 0] ? If you don't know, you have no place in this community to direct others as to what is and isn't the best way to interface their controls. RandyT --- End quote --- Amen! |
| AndyWarne:
--- Quote from: JustMichael on September 20, 2010, 03:37:34 pm --- USB does not transmit just 1 key each time it is polled like you are trying to suggest. The USB device transmits a block of data each time it is asked. The computer takes the USB data and determines which keys are being press and tells Mame all the keys that are being pressed each time Mame asks. --- End quote --- Spot on. Furthermore the I-PAC is polled at 500Hz . There is just no issue here. The way in which all pressed keys are sent, in virtually no time (12 Mbps), as a packet, and processed as such on the PC is the closest you will get to a game board. |
| Navigation |
| Message Index |
| Next page |
| Previous page |