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:
[url]http://store.curiousinventor.com/guides/PS2/[/url]
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());
}