Xbox 360 rf-module to PC

If you have an old broken Xbox 360 or just spare parts just like me, you have the chance to convert that built in module in the front, to be used with a PC and sync your wireless xbox 360 controllers to your computer. It works great with games from Steam for example!

 

The rf-module in the Xbox 360 can easily be changed to work with USB on your computer, however the module runs on 3.3V instead of the standard 5V USB has. There are several way to easily fix this, you could a 5V Zener diod, using two 1N4001 diodes or use a regulator such as LM1117-33 that can handle various input and give you 3.3V output.IMG_6159

 

But there is still one problem, you have no syncing button on the PC and neither on the rf-module. One way to sync is to use the “Play and charge”-kit, but if you don’t have that there is a relative easy and cheap way to reuse the powerbutton on the rf-module to work as a sync-button. Basic knowledge with Arduino will come in handy with this solution.

 

I original got the idea from http://techocd.blogspot.se/2014/01/xbox-360-wireless-controller-to-pc-via.html and found the information on how to program a ATtiny 85 chip from http://www.instructables.com/id/Program-an-ATtiny-with-Arduino/. Please give them a visit!

 

Things for the project:

  • Old Xbox 360 rf-modul
  • PCB board
    • PCB software and PCB layout
    • Laser printer
    • Photo glossy paper (I used 240g/m²)
    • Iron
    • Etching powder (I used Sodium persulfate, Na2S2O8)
    • Safety googles and gloves (Please read the safety instructions on the ethcing powder you choose!)
    • Smaller saw
    • File for the edges
  • Mini USB B connector (SMD)
  • LM1117-3.3 SOT-223 regulator (SMD)
  • ATtiny 85 20SU (SMD)
  • Plastic case/enclosure box
  • Solder iron
    • Solder flux
    • Solder tin
    • Some methanol to clean with after soldering
  • Some tweezers (optional)
  • Some wires (I used copper wires from an old ethernet cable)
  • An Arduino to program the ATtiny 85 chip with. My choice was Arduino Nano v3.0
  • Some time.

I started with ordering the needed parts from ebay, since I had PCB at home already I started to design a layout in KiCad, I did one 1.0 version which I later on adjusted when I had gotten all the parts, the final version is 1.1. The “Reset” signal is missing on version 1.0, which is needed to program the ATtiny 85 chip.

3D_02     3D_01     2D_01
 

I’m not gonna show you the progress on how I made my PCB, frankly I forgott to take photos of that part. However you can follow this link or google it yourself on how to etch and make your own PCB. I might later on make my own guide on how to.

 

IMG_6176

I have my solder station sett to ~300-350 degrees Celsius and after getting all the parts on the PCB it looks like this ->

 

Now the ATtiny 85 needs to be programed, but first you need to program your Arduino as an ISP programer. In the Arduino IDE, go to File->Examples->ArduinoISP
An example code will pop up and you can just write that to your arduino. Make sure you have correct serial port and board selected under Tools.

Close your Arduino IDE and download the needed files to be able to write to the ATtiny 85. ATtiny master.zip
Go to Documents->Arduino on your desktop (C:\Users\<your-username>\Documents\Arduino), create a folder named “hardware”. Unpack the folder “attiny” from the zip-file to the “hardware” directory. If you open up Arduino IDE you will now see under Tools->Board that you have a lot of ATtiny chips to select, select ATtiny85 (internal 1 MHz clock). You will also need to select Tools->Programmer->Arduino as ISP. Now we can connect the board to the Arduino.

IMG_6172

You will use the pins 10-13 and GND on the Arduino, they should be connected as followed:
10 -> Reset
11 -> PB0
12 -> PB1
13 -> PB2
GND -> GND (Optional)
 

And you will need to connect USB to the board so ATtiny85 get 5V.

Open up an empty sheet in Arduino and paste this code:

/* Arduino code to communicate with xbox 360 RF module.
Original work by (yaywoop) / additional ideas from Alexander Martinez – modified by dilandou (www.dilandou.com, www.diru.org/wordpress)
First sends LED initialisation code followed by LED startup animation code, then sleeps until a button press for sync command.
RF module must be powered with 3.3V, two diodes in series with USB 5v will do. Connect the USB wires to a host computer, and the data and serial wires to Arduino.
of course, make sure to have a common ground */

#include <avr/sleep.h>

#define sync_pin 2 //power button repurposed for sync button (pin 5 on the module)
#define data_pin 1 //data line (pin 6 on the module)
#define clock_pin 0 //clock line (pin 7 on module)

int led_cmd[10] =  {0,0,1,0,0,0,0,1,0,0}; //Activates/initialises the LEDs, leaving the center LED lit.
int anim_cmd[10] = {0,0,1,0,0,0,0,1,0,1}; //Makes the startup animation on the ring of light.
int sync_cmd[10] = {0,0,0,0,0,0,0,1,0,0}; //Initiates the sync process.
volatile boolean sync_enable = 0;

void sendData(int cmd_do[]) {
pinMode(data_pin, OUTPUT);
digitalWrite(data_pin, LOW);    //start sending data.
int prev = 1;
for(int i = 0; i < 10; i++){

while (prev == digitalRead(clock_pin)){} //detects change in clock
prev = digitalRead(clock_pin);
// should be after downward edge of clock, so send bit of data now
digitalWrite(data_pin, cmd_do[i]);

while (prev == digitalRead(clock_pin)){} //detects upward edge of clock
prev = digitalRead(clock_pin);
}
digitalWrite(data_pin, HIGH);
pinMode(data_pin, INPUT);
}

void initLEDs(){
sendData(led_cmd);
delay(50);
sendData(anim_cmd);
delay(50);
}

void wakeUp(){
sync_enable = 1;
}

void sleepNow() {
set_sleep_mode(SLEEP_MODE_PWR_DOWN); // set sleep mode
sleep_enable(); //enable sleep bit
attachInterrupt(0, wakeUp, LOW);
sleep_mode();
sleep_disable(); //disable sleep bit
detachInterrupt(0); // disables interrupt 0 on pin 2
}

void setup() {
pinMode(sync_pin, INPUT);
digitalWrite(sync_pin,HIGH);
pinMode(data_pin, INPUT);
pinMode(clock_pin, INPUT);
delay(2000);

initLEDs();
//  sendData(sync_cmd);
}

void loop(){
sleepNow();
delay(200);
if(sync_enable==1) {
sendData(sync_cmd);
sync_enable = 0;
}
}

You can also download the Arduino file with this code here.

Now press Upload as usual and wait a few seconds before it is done. If you would encounter error code as “stk500_getsync(): not in sync: resp=0x15” or ending with 0x00 or 0xf0, you could need to use a 10µf 16V capacitor between GND and Reset on the Arduino, I used 47µf which worked fine also. If success you should see this message twice and only this message:

avrdude: please define PAGEL and BS2 signals in the configuration file for part ATtiny85
avrdude: please define PAGEL and BS2 signals in the configuration file for part ATtiny85

Now you can connect the board to the Xbox 360 rf-module.

IMG_6166    336
Please note that this is the Ver 1.0 board in the picture. Reset should not be connected, it is only used for programing.

 

IMG_6254I found quite the perfect housing for the rf-module, I’ve made holes for the sync-button on the top and for USB connector. Sadly I can’t see the leds to good, but looking trough the hole shows me it is alive. I’m gonna modify it better but for practice it works good!IMG_6255

 

 

 

 

 

Now you can connect your Xbox 360 rf-module to your computer with a simple USB mini cable. But, before you can use it you will need to download the drivers for it, you can download it directly from Microsoft website: http://www.microsoft.com/hardware/en-us/p/xbox-360-wireless-controller-for-windows#support

Install the drivers, open up the Device Manager and find the rf-module in the list. Right click and update driver, select path manually to “C:\Program Files\Microsoft Xbox 360 Accessories\” and select yes to use driver even do it is not recommended.

More info to come.

 

Creative Commons License
Xbox 360 rf-module to PC by Tobias Åkerblom is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
Based on a work at http://techocd.blogspot.se/2014/01/xbox-360-wireless-controller-to-pc-via.html.

Categories: Electronic Projects

Leave a Reply

Your email address will not be published. Required fields are marked *