I don't know what happened to the last post...
I'm trying to use an Arduino as a PSX/PS2 controller emulator. I know that the PSX/PS2 work via a modified SPI interface. I'm pretty sure it would be very easy to do, the hard part, I guess, is getting the timing down pat.
I've seen lots of documentation on how to use PSX/PS2 controllers with the Arduino, so the command language is there. Has anyone done this? Do you have any source code?
I've only done the reverse (emulating a hosts to communicate with PS2 controllers). Since the emulated pad would need to respond to the given clock, I would imagine this would be heavily driven by pin interrupts.
Is there any specific part of the development you are struggling with?
I really have two ways to do this, and I'm trying to decide which would be better.
There's the option where I just output at a certain timing, and hope it meshes. (use delays to emulate a clock, ugly but easy) I guess this is called bit banging.
The other option is to use an interrupt pin for the CLK and ATT lines. Which is way above my level of confidence.
Has anyone made an Arduino a SPI Slave device? It would be extremely similar to that.
Though I haven't seen for myself, several websites presenting logic analyzer patterns gave me the impression that using delays and hoping they will sync may be difficult.
The duration of a cycles and blanks between bytes (not "commands" but the spacing between each byte) seemed to drift.
While working on the host emulator, I also had the impression that PS2 controllers were a lot strict on timing. You may have an easier time getting a "controller emulator" working with a PS1, then boil down the timings to also work with PS2.
The other option is to use an interrupt pin for the CLK
and ATT lines. Which is way above my level of confidence.
Personally I think this is a much better way to go.
I haven't tried on the actual board, but can present pseudo code which should work by theory.
It may also help if you specify what your input is, and what key commands you are trying to emulate.