Jump to content
IGNORED

Bluetooth Controller Adapter?


Recommended Posts

ure Hi!

 

I have a couple of Arduino Nano boards with bluetooth which I'm eyeing for a project.  Thought I'd mention it here in case it's a stupid idea...

 

I was thinking I could connect one Nano to the Jaguar's controller port, and connect another Nano to a controller.  Then, via Bluetooth, replicate the controller's signals to the Jag, essentially turning any Jaguar controller wireless.

 

Now, technically there's nothing magic here.  The Arduino code's quite straightforward.  But I'm assuming that this won't work for reasons I don't yet know :)

 

I've been researching how the Jag's controller works, since there's clearly more buttons than signal lines on the port. So it would appear that the connection is bidirectional - the Jag sets pins 1-4 to choose what group of buttons it wants to read, then reads their state on other pins.  I'm not actually replicating a controller, rather, just trying to reflect the pin states between the two Arduinos over bluetooth -- so I don't really care about the nitty-gritty.  

 

So it would seem that the Jag-side Arduino should have pins 1-4 as inputs and the others as outputs, whilst the controller-side Arduino would have 1-4 as outputs and the others as inputs (to read from the controller).  All I need to do is watch for changes on the signals and ping BT messages back and forth to reflect those changes on the other end.

 

Has this been tried before?  Is there a glaring reason why it won't work?  If it does work, would anyone else be interested?  

 

(I'm imagining there being a little Arduino dongle that'll connect to and be powered by the Jag.  Then, a little box with a DB15 socket for the controller to plug into, and a micro-USB for charging a battery for the controller-side nano.  If it does work well, I could see if I could fit the 'duino and a battery pack inside the shell of the controller)

 

[edit: The glaring issue I can foresee is lag.  If the Jag sets pin1 and assumes it can scan other pins straight away to get button states, it may well not be happy about the delay introduced by bluetooth. The best way to find out is to try, I suppose!]

Edited by displaced
  • Like 4
Link to comment
https://forums.atariage.com/topic/294841-bluetooth-controller-adapter/
Share on other sites

displaced: This is will not work as-is, because the latency introduced by Bluetooth will be too large. Instead, keep the states of all buttons locally in the receiver, and update them periodically by getting the actual states from the emitter. That way, the delay between outputs changing states and inputs changing states is minimized.

 

Since the controller ports are polled in software, the maximum allowable delay may depend on the game. I haven't measured it but it may be quite short ; you're probably gonna need optimized code on the Arduino to keep up. (I did a related project in the past, and used a CPLD instead to avoid this problem.)

 

You can take advantage of the fact that games usually read the controllers only once per video frame, and synchronize so that the Bluetooth communication doesn't occur at the same time. Beware that some games only read 4 rows, while team-tap compatible games will read all 16 rows.

Edited by Zerosquare
  • Like 2

Thanks, Zerosquare!

 

All that makes sense. Slightly concerned about the team-tap bit, since if the jag and Arduino have differing ideas about pin directions, nastiness could happen. I don’t mind losing team-tap compatibility, so maybe I’ll use some diodes to prevent the jag outputting on pins that are nominally inputs.

 

Im using Bluetooth 4.0 LE which apparently has massively better latency. I’m not expecting my simple approach to work, but I’ll start with it just to see how badly it doesn’t work (if that makes sense!). Then I’ll fiddle with state caching to see what happens.

 

I want to try something similar with the simple CX40 joystick on my XEGS too. Perhaps I should start there to keep things simple!

  • Like 2
2 hours ago, displaced said:

Slightly concerned about the team-tap bit, since if the jag and Arduino have differing ideas about pin directions, nastiness could happen.

The team tap mode doesn't change which pins are input and which pins are outputs, so you're safe. All it does is use the other 12 possible states for the group of 4 outputs besides the 4 that are used in single-controller mode.

pads.thumb.png.4b0d20b9b269b7a13fa97d1fea27ad2f.png1979039920_teamtap.thumb.png.98b62146de0f7cd15288d7d77e7f9c5c.png

How many people really sit that far from their Jag that they would need a wireless controller?

 

It is not entirely clear how you intend to do this although I assume one Arduino plugs into in to the Jaguar controller port and the other plugs onto the controller/team tap cable. That way your only need two for up to to 4 controllers, plus if you plugged the Team Tap into the Jag not only would have increased the latency as you would need to add an address byte of some type to ensure only the correct controller responded. But you can only take 50mA from a Jaguar controller port, 10mA from a Team Tap port and the current consumption of the Nano will probable exceed 10mA and may exceed 50mA as Bluetooth transceivers can use anywhere between 8 and 50mA depending on data rate and range. 

 

Even if we assume that you are just using the two and that the power consumption is less than 50mA, how will you power them?

There is a 5V pin on the Arduino so for the one plugged into the Jag controller port you may be thinking of connecting the Jaguar 5V to that, however that is usually the output from the regulator and really meant for powering the shield boards, the regulator may not like having 5V sent to its output pin.

As for the one on the controller/Team Tap end there is not a lot of (I would say really no) room to fit a battery pack, charging IC, charging connector and the Nano inside either of them which probably means plugging controller/Team Tap Nano into the existing controller/Team Tap cable socket, so not only will you have the existing controller/Team Tap cable lying around but a second cable to power the Nano and controller(s) which kind of defeats the point of a "wireless" controller.

 

I am not saying it can't be done, I just think it will be difficult to a nice looking solution and will probably be more trouble than it is worth, and if it was worth doing someone will have done it by now.       

  • Like 1

Hi Stephen,

 

Like most of these ideas, it comes from my own desire. My Jaguar’s connected via an OSSC to a big TV that’s about 4 metres from where I sit, and I like to avoid extension cables if possible.

 

On my breadboard right now two idle BLE-Nano boards are taking 20mA according to my bench PSU, so the jag’s port should power the ‘receiver’ Nano fine.  The Nano has a VIN pin for power input which is regulated and accepts 6V to 20V.  5V may be a little low for that, but they’re behaving fine on the bench.

 

On the controller side, I’d be happy with the jagpad’s lead shortened and plugged into a box containing the Nano, battery and charge controller.  I could even forego the battery and power via Micro USB (my chair on the other side of the room has a USB multi-way charger beside it).  Sure, it wouldn’t be wireless, but stowing away a 0.5m micro usb lead is neater than finding somewhere for 4 metres of 15-way cable that would otherwise be draped across the room.

 

As for team-taps, I’m very unlikely to ever want one - pretty much just building this for my own convenience.  And it gives me an excuse to play with some Arduinos and, if it all works out, design and 3D print some enclosures.

I’ve got the code finished, with pin state changes being properly reflected on each Arduino via Bluetooth LE. Pins 1-4 on the Jag side set pins 1-4 on the controller, with all other pins operating in the other direction.

 

Just soldering up the DB15HD plug and socket, plus the Arduino to some veroboard.  Words can’t quite express how much I hate soldering a full DB15!

 

On the subject of powering the Jag-side Arduino. Although they work fine with 5V on the VIN pin, the board’s regulator is indeed lowering the voltage on the digital pins to ~3.5V, which is too low for TTL.

 

The Nano doc’s show that already-regulated power can be fed to the 5V pin, which bypasses the nano’s regulator.  If the 5V on the controller port is stable enough for the Jaguar, it should be fine for the Nano, so I’ll switch to using that pin.  Gives a stable 5V on the digital pins when running with the bench PSU.

 

  • Like 2
  • 2 years later...
On 8/18/2019 at 1:04 PM, displaced said:

I’ve got the code finished, with pin state changes being properly reflected on each Arduino via Bluetooth LE. Pins 1-4 on the Jag side set pins 1-4 on the controller, with all other pins operating in the other direction.

 

Just soldering up the DB15HD plug and socket, plus the Arduino to some veroboard.  Words can’t quite express how much I hate soldering a full DB15!

 

On the subject of powering the Jag-side Arduino. Although they work fine with 5V on the VIN pin, the board’s regulator is indeed lowering the voltage on the digital pins to ~3.5V, which is too low for TTL.

 

The Nano doc’s show that already-regulated power can be fed to the 5V pin, which bypasses the nano’s regulator.  If the 5V on the controller port is stable enough for the Jaguar, it should be fine for the Nano, so I’ll switch to using that pin.  Gives a stable 5V on the digital pins when running with the bench PSU.

 

I take it this never went any further? 

 

Necrobump I know, but I'd love a wireless Jag pad. 

The Jag being the only console I have that lacks a wireless pad. 

I even cobbled one together for my Neo Geo. Hate those wires! 

  • 2 weeks later...
On 12/2/2021 at 5:07 PM, Gummy Bear said:

I take it this never went any further? 

 

Necrobump I know, but I'd love a wireless Jag pad. 

The Jag being the only console I have that lacks a wireless pad. 

I even cobbled one together for my Neo Geo. Hate those wires! 

The Jag is my #1 favorite retro console and honestly the only one I have that does not have a wireless controller now. I think it would be a good seller in the community if it were possible! I dont know jack about electronics but someone on here that does may have it in the works. I know you are one of the ones that made that sweet modded LED light rotary controller. Jump on it man!

  • 2 weeks later...

Check my project BlueRetro which is a Bluetooth controller adapter for retro console including Jaguar.

 

https://github.com/darthcloud/BlueRetro

 

This is essentially DIY but I think @Doomy Doomer will build some:

My previous AA thread:

 

  • Like 4
  • 1 month later...

Grabbed a couple myself, trying to think what games would work well without the number pad.  Maybe there is a BT controller with enough buttons? How do you assign buttons?

 

edit: I see there are instructions linked now.

 

A bit concerned there is mention of issues with the Game Drive, Atari Karts, and Missile Command. Hopefully they can be worked out.

Edited by BeefMan

Not to put down the great work that’s been done with this adapter. But to build on it, would be cool if there was something you could plug into a Jag controller, at the end of the plug, to make it BT compatible.  It would require batteries of course to power it. Seems like that would be possible.

Edited by BeefMan
  • Like 5
13 minutes ago, BeefMan said:

Not to put down the great work that’s been done with this adapter. But to build on it, would be cool if there was something you could plug into a Jag controller, at the end of the plug, to make it BT compatible.  It would require batteries of course to power it. Seems like that would be possible.

That would definitely be a game changer and ultra useful!

  • Like 1
9 minutes ago, JagChris said:

Yeah I don't see a real huge use for this until there is actual Bluetooth Jag controllers.

Gotta be a few games that would play just fine, and you could map some of the number pad buttons to quite a few other buttons available on an Xbox or PS controller I’m sure.  But yah here’s hoping!

A bit concerned there is mention of issues with the Game Drive, Atari Karts, and Missile Command. Hopefully they can be worked out.


There’s issues with the Game Drive? What seems to be the issue exactly? I see the other games listed as having issues on the product page but not the GD.
7 minutes ago, schnuth said:

 


There’s issues with the Game Drive? What seems to be the issue exactly? I see the other games listed as having issues on the product page but not the GD.

 

I think I might of misread the GitHub. Maybe he’s talking about a way to patch the three games with issues and play them on the GD?

7 hours ago, JagChris said:

Yeah I don't see a real huge use for this until there is actual Bluetooth Jag controllers.

You can map the number pad to the analog stick directions. It won’t work for games that require multiple numbers to be pressed at once but it will work for almost all.

  • Like 1

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...