Emulating thrustmaster SF1000 rim

Hi, I have read some posts and blogs ( https://rr-m.org/blog/wp-content/uploads/2018/12/arduino_nano_thrustmaster_t300_ps_wheel_emulation_1600x1800.jpg)

And Im trying to replicate the same process, but instead of using the PS-Wheel that has 3 registers, Im trying to first, read and then, emulate SF1000 rim.

Im new using SPI, so, inspite of testing some codes (even from here Nano in SPI slave mode not able to write SPDR during SPI ISR routine) Im not able to get a good reading.

Setup is:

SF1000 conected as usual to T300 servo.
Arduino nano conected to t300 servo too (

D12 MISO
D13 SCK
D11 MOSI
D10 SS
GND

And my current coding attempt goes as:

#include<SPI.h>
byte myData[16] = {0x00};
void setup()
{
  Serial.begin(9600);
  SPI.begin();
  SPI.setClockDivider(SPI_CLOCK_DIV16);//1 MBits/s
  digitalWrite(SS, LOW);  //Slave is selected
  //--------------------
}

void loop()
{

  for (int i = 0; i < 16; i++)
  {
    myData[i] = SPI.transfer(myData[i]);
    delayMicroseconds(100); //allows Slave to process received byte
    Serial.print(myData[i], BIN);
    Serial.print(" ");
  }
  Serial.println(" ");
  delay(3000);  

}

That, gives me a this:

11011101 11011101 11111111 11111111 11111111 11111110 1001010 0 0 0 0 10011100 1001010 11100010 1110000 10000101

1000000 0 0 11111111 11100000 0 10000000 0 0 10000000 0 0 0 0 0 0

And then, after those lines, all zeros, until close the serial monitor and reopen again.

Other attemp was using a code something like the rr-m blog, which consists in interfacing the rim with the arduino (the arduino is now the servo) with this code:

/* This sketch provided "AS IS" under the BSD New license.
http://opensource.org/licenses/BSD-3-Clause
April 2015 © blog@rr-m.org

download tx_rw_wheel_reader.ino above - it has more comments */
#include <SPI.h>
#include <Arduino.h>

const int slaveSelectPin = 7;

void setup() {
 Serial.begin(9600);
 SPCR |= _BV(CPHA);
 SPCR |= _BV(CPOL);
 SPI.beginTransaction(SPISettings(400000, MSBFIRST, SPI_MODE1));
 SPI.begin();
 pinMode(slaveSelectPin, OUTPUT);
}

void loop() {
 // tell the wheel, that we gonna read the data now
 digitalWrite(slaveSelectPin, LOW);

 // read 3 bytes and output them to Arduino Serial monitor
 // as binaries 11000001 11111111 11111111
 // last 17 bits are buttons. 1 - released, 0 - pressed.
 for(int i=1; i<=8; i++) {
   delayMicroseconds(100);
   printBinary(SPI.transfer(0x00));
 }
 Serial.println();

 // release the wheel
 digitalWrite(slaveSelectPin, HIGH);

 // wait 1 second, then read data from wheel again
 delay(1000);
}

// print byte as binary, zero padded if needed
// "127" -> "01111111"
void printBinary(byte data) {
 for(int i=7; i>0; i--) {
   if (data >> i == 0) {
     Serial.print("0");
   } else {
     break;
   }
 }
 Serial.print(data,BIN);
 Serial.print(" ");
}

But, that gives a nonsense.

What im 100% positive, is that the first 5 bytes are:

11011101 11111111 11111111 11111111 11111110

but after that, nothing is logic. I have tried to put that bytes in arduino (from the same page) and the SF1000 is detected, but any push button is detected.

So, my questions are:

Which is better? trying to interface the sf1000 with arduino directly or keep connecting arduino as SPI slave to the t300 servo and read the sf1000 info?

Im at a dead end, as said, I dont have many knowledge about SPI, so, any help, or explanation on how to set

SPI.beginTransaction(SPISettings(MaxSpeed, MSBFIRST, SPI_MODEX));

Will be very appreciated.

Thanks in advance

1 Like

Sorry to say, I don't have a solution to your problem. However, I do have the same problem. :wink:

Mainly just making a comment to BUMP this topic.

Here T-GT readed values(from Taras):
Thrustmaster T-GT Wheel Arduino Reader Values

Regarding the rotaries/encoders, the push buttons is set to the first 3 bytes however the rotations are given a set 4 bits each per byte on the ninth and tenth bytes. Calculating the rotations is done in steps just like binary. There can be a maximum of seven clicks per direction with there seeming to be a stop at eight clicks for anti-clockwise.

############

No Input

############
BYTE 1 BYTE 2 BYTE 3 BYTE 4 BYTE 5 BYTE 6 BYTE 7 BYTE 8 BYTE 9 BYTE 10
11001001 11111111 11111111 11100000 00000001 00000001 00000001 00000001 00000000 00000000

###################

In Button Order

###################

BUTTON BYTE DATA

Circle 3 11111101
Cross 4 11000000
Square 4 10100000
Triangle 3 11111011

L1 (Paddle) 2 11110111
L2 2 01111111
R1 (Paddle) 4 01100000
R2 3 11110111

LS X- 5 00000000
LS X+ 5 11111111
LS Y- 6 11111111
LS Y+ 6 00000000
RS X- 7 00000000
RS X+ 7 11111111
RS Y- 8 11111111
RS Y+ 8 00000000

Option 3 11111110
Share 2 11101111
PS 3 01111111

Rot Green 1 11001000
Rot Red 3 11101111
Rot Ylw 3 11011111
Rot Blue 2 11111110

Rot G Anti 9 11110000 to 00010000 (1111 0111 1011 0011 1101 0101 1001 0001)
Rot G Clock 9 10000000 to 11100000 (1000 0100 1100 0010 1010 0110 1110)
Rot R Anti 9 00001111 to 00000001 (1111 0111 1011 0011 1101 0101 1001 0001)
Rot R Clock 9 00001000 to 00001110 (1000 0100 1100 0010 1010 0110 1110)
Rot B Anti 10 11110000 to 00010000 (1111 0111 1011 0011 1101 0101 1001 0001)
Rot B Clock 10 10000000 to 11100000 (1000 0100 1100 0010 1010 0110 1110)
Rot Y Anti 10 00001111 to 00000001 (1111 0111 1011 0011 1101 0101 1001 0001)
Rot Y Clock 10 00001000 to 00001110 (1000 0100 1100 0010 1010 0110 1110)

Hat Up 2 10111111
Hat Down 2 11111011
Hat Left 2 11011111
Hat Right 2 11111101

#################

In BYTE order

#################

BUTTON BYTE DATA

Rot Green 1 11001000
L2 2 01111111
Hat Up 2 10111111
Hat Left 2 11011111
Share 2 11101111
L1 (Paddle) 2 11110111
Hat Down 2 11111011
Hat Right 2 11111101
Rot Blue 2 11111110
PS 3 01111111
Rot Ylw 3 11011111
Rot Red 3 11101111
R2 3 11110111
Triangle 3 11111011
Circle 3 11111101
Option 3 11111110
R1 (Paddle) 4 01100000
Square 4 10100000
Cross 4 11000000
LS X- 5 00000000
LS X+ 5 11111111
LS Y- 6 11111111
LS Y+ 6 00000000
RS X- 7 00000000
RS X+ 7 11111111
RS Y- 8 11111111
RS Y+ 8 00000000
Rot G Clock 9 10000000
Rot G Anti 9 11110000
Rot R Clock 9 00001000
Rot R Anti 9 00001111
Rot B Clock 10 10000000
Rot B Anti 10 11110000
Rot Y Clock 10 00001000
Rot Y Anti 10 00001111

1 Like

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.