Thursday, July 6, 2017

Interfacing PS3 controller to HC-05 Bluetooth module

This post will describe how I modified the HC-05 to work in HCI mode to connect to PS3 Controller.
Following steps have to be taken

1)Refer to this link to connect the HC-05 in SPI mode. Using this, it's possible to the change the onboard firmware and change PSKEY's. What I did was flash the HC-05 with RN-42 firmware.

2)Once flashed with RN-42 firmware, put your BT address back and change the following PSKEY's
using the PSTool.exe

  1. PSKEY_VM_DISABLE -> 0x0001
  2. PSKEY_ONCHIP_HCI_CLIENT -> 0x0000
  3. PSKEY_HOST_INTERFACE -> UART H4
  4. PSKEY_UART_BAUDRATE -> Same as USART on the micro
it's better to choose a high baud rate or there's a lag. I used 250,000bps by setting this PSKEY to 0x400. The formula to calculate this is given in the description of that 
PSKEY_UART_BAUDRATE. It's Baud = PSKEY_UART_BAUDRATE * 0.004096

3)Use this library for the code : 
https://github.com/Nero7991/HC-05-PS3-Controller-AVR

6 comments:

  1. I am trying to replicate your work. You seem to be the only person on the whole internet you has successfully managed to use a modified HC-05 bluetooth module to communicate with a PS3 wireless remote! I managed to successfully re-flash my HC-05 module with the RN42 firmware and all responded fine to enter $$$ command mode, etc. However when I modified the PSKEYs you've outline in step (2), I bricked my module (I bricked two modules in this way). Please could you re-check if you made an error with these, or explain why these keys are being changed so I can try to understand how to modify them myself?

    Also the github code appears incomplete, it seems you have forgot to include the PS3BT.cpp file?

    Thanks for any help in advance, it would be amazing to get this working.

    ReplyDelete
    Replies
    1. Any luck? Im at the same position lol

      Delete
    2. Hi Benny, no luck I'm afraid! I gave up after this. I'm tempted to think the best way is not to follow these instructions (as they appear wrong), but to follow these:

      https://forum.arduino.cc/index.php?topic=137747.0

      Good luck, let me know if you have any success that way :)

      Delete
    3. Thanks Duncan for sharing the above link. Hope I will succeed, since I need to use it in my thesis. Will let you know how I end up.

      Delete
  2. This comment has been removed by the author.

    ReplyDelete