Video Game Controllers: A bit rate question

Status
Not open for further replies.

DigiTan

New Member
I'm programming an AVR micro to use as an interpreter for **broken link removed**. I plan to use these controllers as a "standard keypad" for some of my future projects. I did some searces and found a few places that explain things like the pinouts, serialized polling, and all that jazz. But they never mention what bit rate I need to shoot for. Can anyone tell what bitrate they use?

So far I can only guess.

BTW- Does anyone know what the Playstation "NegCon" controller is? I can't find any pictures and I'm still trying to figure out what the heck this thing does. Apparently, some of its buttons are pressure-sensitive.
 
Are you planning to use a PS one controller or a PS 2 controller. There is a difference. I have been working on a similar project. The ps controller that I am using is an official Playstation controller. Not sure what the max data rate is but I am checking the joystick at roughly times per second. The chip is running of a 4Mhz clock so data transfer clock is roughly 50kHz or about 50kbps.

Never heard of a NegCon either. PS 2 controllers use pressure sensative buttons. PS 1 use straight digital buttons.

Hope that helps.
 
Yep. That helps alot. I was mostly worried about going over the max rate. Right now I'm planning to use all four PS 1 controllers types (digital, negcon, analog red and green). I tried some more sleuthing and finally found **broken link removed** of a NegCon. Still trying to figure out exactly what it does.
 
That thing in the pic is a horrible controller, it has a joint in the middle so that you can 'TWIST' the controller - imagine they horrible cheap radio control cars, the conroller with the wheel on the side, its kind of like that action, on you can twist it both ways.
 
 
Thanks for the help Jem (it took me a while to locate your message in the quote box though). The NegCon controller sounds like an odd piece of eqipment. I guess the twisting action is the "steering" byte they refer to in the taables. Any idea of what "I Button", "II Button", and "L1 Button" are used for or why they have psuedo-analog outputs as well?

Code:
    NegCon

    BYTE    CMND    DATA

     01     0x01    idle
     02     0x42    0x23
     03     idle    0x5A    Bit0 Bit1 Bit2 Bit3 Bit4 Bit5 Bit6 Bit7
     04     idle    data                   STRT UP   RGHT DOWN LEFT
     05     idle    data                   R1   A    B
     06     idle    data    Steering  0x00 = Right 0xFF = Left
     07     idle    data    I  Button 0x00 = Out   0xFF = In
     08     idle    data    II Button 0x00 = Out   0xFF = In
     09     idle    data    L1 Button 0x00 = Out   0xFF = In
 
Here's an interesting story I stumbled across...


I also have one more question. Are any of the PS2 controllers compatible with the PS1 systems (same serialized polling method)? Can't find any data on them.
 
Okay, I've been working on this all week and I finally got things to work. More or less....

I'm experiencing a very bizzare problem with the incoming key data. As far as I'm able to detect, my outgoing commands are intact and noise-free, however the key information doesn't make sence. According to the internet sources, each key is supposed to affect the incoming bits in this fashion...

Code:
Analogue Controller in Red Mode

BYTE    CMND    DATA

01     0x01    idle
02     0x42    0x73
03     idle    0x5A    Bit0 Bit1 Bit2 Bit3 Bit4 Bit5 Bit6 Bit7
04     idle    data    SLCT JOYR JOYL STRT UP   RGHT DOWN LEFT
05     idle    data    L2   R2   L1   R1   /\   O    X    |_|
06     idle    data    Right Joy 0x00 = Left  0xFF = Right
07     idle    data    Right Joy 0x00 = Up    0xFF = Down
08     idle    data    Left Joy  0x00 = Left  0xFF = Right
09     idle    data    Left Joy  0x00 = Up    0xFF = Down

...This works for the joysticks (lines 6,7,8, and 9), however the keys (lines 4 and 5) will influence the bits incorrectly. For example, when I press "Right," the bits for "Right", "Down", and "Left" will be affected. And when I press "Up" the bits for "Up", "Right", and "Down" are affected. Basically, when one of my bits goes low, it seems to "pull" two higher bits into the same state. What's worse is that if the "Left" button is pressed, the problem will 'spill over' and affect the bits for "L2" and "R2" in Line 5.

At first I assumed this was happening because my bit rate was too high to allow the input lines to settle. But this doesn't account for the Joysticks working.

Right now, I'm sampling the controller 60 times each second at a bit rate of ~9600bps. The microcontroller is an AVR 2313 running off a 5volt regulator. The keypad runs off the same regulator. There are 0.22uf capacitors on both sides of the regulator, plus a few more noise counter-measures.

I should also probably mention that the PSX controller was used, and I've recently discovered that it had been unscrewed by the previous owner.

Any theories?
 
Okay, I finally did some more sleuthing and it turns out it was the bitrate all along! It appears that the 9600bps sample rate was causing single incoming cleared bits to be seen as 3 consecutive bits. Appearantly, this was no problem for the keypad's controller, as it was able to understand my outgoing commands.

Anyway, I cut the bit period down to roughly 216us to run at 2400bps and now it works perfectly. Hopefully, I'll be able to operate a higher rates again with more testing. Here's the AVR-based test circuit to monitor the 1st row of keys:
**broken link removed**
...if anyone wants a copy of the source code, just PM me and I'll send you the PSX interrupt. :wink:
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…