Main Site Documentation

PS2 controller


#1

Greetings!
Help to configure correctly SPI for work with PS2. Now I use such code, but always I read 255, in all 5 bytes read[].

I connect so: 7 - att, 13 - clock, 12 - data, 11 - command
I use this information:
http://store.curiousinventor.com/guides/PS2/

Thanks. Sorry for my English.


            byte[] config = new byte[] { 0x01, 0x43, 0x00, 0x01, 0x00 };
            byte[] read = new byte[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
            SPI.SPI_module spi_module = SPI.SPI_module.SPI2;

            spi = new SPI(
                new SPI.Configuration((Cpu.Pin)FEZ_Pin.Digital.Di7, 
                    false, 0, 0, false, true, 500, spi_module));
            Thread.Sleep(100);

            for (int i = 0; i < 5; i++)
            {
                spi.WriteRead(config, i, 1, read, i, 1, 0);
                //Thread.Sleep(1);
                //Debug.Print(r[i].ToString());
            }


#2

That is interesting. I didn’t know PS2 uses PSI bus.

I wish you had a domino then I would say just use a USB PS3 pr XBOX controller.


#3

So it became already better:


spi = new SPI(
                new SPI.Configuration((Cpu.Pin)FEZ_Pin.Digital.Di7,
                    true, 5, 0, false, true, 500, spi_module));
            Thread.Sleep(100);

            spi.WriteRead(config, read);

Output: 255;67;0;1;0
But should be: 255;121;90;255;255
(