Custom Wireless N64 Controllers

Discussion in 'Modding and Hacking - Consoles and Electronics' started by jungerman, May 15, 2014.

  1. jungerman

    jungerman N64 Life

    Joined:
    Jul 18, 2013
    Messages:
    32
    Likes Received:
    0
    Hey all, long time no see.

    I started work this past year on designing a number of N64 mods. One of those was to make wireless controllers. There are already a number of solutions out there for doing this: Retro-Bit's Hypermode wireless controllers, severatius's wireless mods, and (ha) Doc's IR controllers. However, none of these were quite what I was looking for. I bought a Hypermode controller, but the quality is pretty bad. Severatius's mod, while great, takes up a lot of space and doesn't allow for any sort of expansion port use. Doc's... well, they tried.

    What I'm aiming to do is create a set of four wireless controllers, while maintaining full use of the expansion slot. Only official N64 controllers are used to maintain that distinctive look and feel. Here's a quick overview of the hardware:

    Receiver
    • Raspberry Pi - a cheap embedded computing platform (other mods being made need a computer with Linux)
    • nRF24L01+ - a super cheap 2.4GHz wireless transmitter with great libraries available for both AVR and the Raspberry Pi
    • Logic board from N64 controller - four of them. I attached headers to the one I'm currently working with. See here for the original board, and here for the board after I took a dremel to it.
    • Shift registers - to hold all the values being fed to the N64 controller. Each controller has 18 input pins (14 buttons + 4 pins for joystick). For four controllers, that's 72 pins of input.

    Controllers
    • ATMEGA328P-PU - the same thing that's in an Arduino. Cheap, plenty of I/O
    • nRF24L01+ - see above
    • Button contacts from N64 controller - so that button presses can actually be read
    • Multiplexers - to reduce the number of pins needed to read all the buttons
    • Potentiometer-based joystick - like this
    • Built-in rumble motor
    • Rechargeable batteries - specifics TBD

    The ATMEGA328 in the controller reads all the button inputs using multiplexers. The quadrature output from the replacement joystick I linked to is bypassed, and the potentiometer values are read directly from the joystick using the ATMEGA328's built in ADC. These values (along with the battery charge, eventually) are transmitted in a 4-byte payload to the Raspberry Pi through the wireless modules. The Pi then interprets this data, converts the potentiometer values to quadrature, and updates the shift registers appropriately. These shift registers are connected directly to the input pins on the main chip of the N64 controller, so this changes the buttons and joystick input values it reads, and that's sent to the console.

    I haven't put everything together yet, but the hardware for the proof-of-concept is done (aside from the rumble and rechargeable batteries). All that's left to get it working is a bit of coding.

    View the proof-of-concept construction videos here.

    All the peripherals (rumble pak, controller pak) will reside on the receiver end, since it's not feasible to transmit those communications wirelessly. The specifics of how the rumble pak's PWM signal will be transmitted back to the controller is still TBD.

    Look for more updates over the next few weeks.

    J
     
    Last edited: May 15, 2014
  2. Helder

    Helder Site Supporter 2014,2015

    Joined:
    Apr 6, 2013
    Messages:
    981
    Likes Received:
    54
  3. jungerman

    jungerman N64 Life

    Joined:
    Jul 18, 2013
    Messages:
    32
    Likes Received:
    0
    That's the video I linked to. Micro and severatius are the same person, from what I can tell. His method is a bit different from mine. While he just streams the encoded values from the data line on the on the N64 controller, I send the raw data from the controller in a 4-byte payload. This allows easy interpretation of the button presses on the receiving end. This way, one could set up the receiver (Raspberry Pi) to turn on the console when the start button is held down for a few seconds. That is one feature I wanted to include in the future, and the easiest way of doing that is to send the unencoded input from the controller.

    I've asked micro about the possibility of wireless rumble and controller paks. Using the method he implemented, it's not really possible, especially with the controller pak. The console expects data to be sent to and from the controller within a very short delay, which the wireless increases by an order of magnitude.
     
  4. Sonny_Jim

    Sonny_Jim Enthusiastic Member

    Joined:
    Apr 29, 2012
    Messages:
    525
    Likes Received:
    31
    I did a it of interfacing with the Pi and a SNES controller port. Not sure about the N64 controller protocol, but if you plan to use the GPIO and software bitbang it, forget about that approach. The GPIO just isn't fast enough.

    In fact I'm not convinced a Pi is right for the job, can't you just use an MCU an a pair of XBees?
     
  5. jungerman

    jungerman N64 Life

    Joined:
    Jul 18, 2013
    Messages:
    32
    Likes Received:
    0
    I guess I'm not good at advertising my design.

    All of my bits are remaining unbanged. If you look again, you'll see that I'm taking the easy route in implementing this. I took a dremel to the N64 controller circuit board, separating the section that handles all the logic from the sections that contain the contacts for the button. Each wire soldered onto the chip in the center of the board corresponds to a button. If one of those is pulled low, it's the equivalent of pressing the corresponding button. So whenever the Pi gets a command to push a button, it updates the shift registers such that the corresponding value is pulled low. That's all I have to do to press a button. If you look at the second video in the playlist I linked above, it should make sense.

    Here are a few pics of the current setup.

    XBees would work, yes, but the cost is an order of magnitude higher than the nRF24L01+ modules. The cheapest XBee modules you can find will run in you about $20 or so. The others can be had for $1 apiece. There's also a number of great libraries available for both the Pi and AVRs.

    I'm using a Pi for the reason I listed in my first post. Other mods I'm making need a fully-fledged linux computer. While you are right that the GPIO is slow, it can produce signals up to 20MHz while the N64 only requires 1MHz on the data line, though that isn't relevant to this conversation.
     
    Last edited: May 15, 2014
  6. Sonny_Jim

    Sonny_Jim Enthusiastic Member

    Joined:
    Apr 29, 2012
    Messages:
    525
    Likes Received:
    31
    Hah, you realise that page is using code that toggles the GPIO, rather than anything complicated?

    A schematic of how it all fits together is much easier to read than a wall of text.
     
  7. Helder

    Helder Site Supporter 2014,2015

    Joined:
    Apr 6, 2013
    Messages:
    981
    Likes Received:
    54
    Thats the same wireless receivers that Micro used in his mods right? I have a few I bought a while back when I was planning to do these but I guess I will wait to see how your project comes about and might do this instead. Any chance to make it work with other systems?
     
  8. jungerman

    jungerman N64 Life

    Joined:
    Jul 18, 2013
    Messages:
    32
    Likes Received:
    0
    1/20th of the maximum speed seems achievable to me, though I've never tried it. But you are right, it is relatively slow, and the software side of things wouldn't be easy. That's why I took the lazy route, using the original chip from the N64 controller to encode the buttons and joystick values for the console. I didn't want to open up that can of worms.

    Right. I had hoped the explanation and videos would be enough for now. I've been working on a blog post, I'll post the link and a few schematics back here when it gets finished for anyone interested.

    These are going to be a bit more complicated to put together than Micro's, and an optimistic estimate is that the design will be done by the end of the summer. I would go with his right now unless you specifically want wireless rumble, or you need something besides the N64 to read the output of the wireless controller. But yes, it is the same wireless module. They're great little parts.

    Sure. You would just need to be able to separate the logic of the circuit board from the buttons on it. For example, look at the sharpie line I drew to mark my dremel cut in this picture. Everything inside the line is part of the controller's logic, and is placed on the receiver side of things. The rest of the board just contains pads for the buttons. That stays in the controller. Wires run from each button to the multiplexers so that the ATMEGA328 can read them all. Any board that can be cut in a similar manner can be made wireless.

    Since I have a Raspberry Pi controlling the receiver, I could even hook up, say, an XBOX controller to control the N64. Though that's beyond the scope of what I'm currently doing.
     
    Last edited: May 15, 2014
  9. JAntonioGK

    JAntonioGK Member

    Joined:
    May 20, 2014
    Messages:
    6
    Likes Received:
    0
    Can't wait for this!
     
  10. jungerman

    jungerman N64 Life

    Joined:
    Jul 18, 2013
    Messages:
    32
    Likes Received:
    0
    Update coming soon. I've got everything working, including the wireless rumble. Only thing that's left for further developing this proof-of-concept is the circuit for the rechargeable batteries. In the next phase of development, everything spread out on the breadboard on the controller side will actually be inside the controller.

    I'll post details tomorrow.
     
  11. jungerman

    jungerman N64 Life

    Joined:
    Jul 18, 2013
    Messages:
    32
    Likes Received:
    0
  12. Helder

    Helder Site Supporter 2014,2015

    Joined:
    Apr 6, 2013
    Messages:
    981
    Likes Received:
    54
    Looks great! Maybe you should use a CPLD to handle the 74xx family chips to save yourself some space when you plan on designing the board to fit in the controller case. Is there any known clones of the Controller's CNT-NUS chip? if there is maybe it can be used also in the board design again to save space and also not need to cannibalize existing N64 Controllers.
     
  13. jungerman

    jungerman N64 Life

    Joined:
    Jul 18, 2013
    Messages:
    32
    Likes Received:
    0
    That's probably a more effective approach, though It works as it currently is. I like keeping things simple. There's actually plenty of space inside the controller with the logic section separated.

    I don't quite know, although that isn't necessary. I like using existing controllers because I need an actual controller body, and because the controller port is already wired up to the chip. It would just introduce extra work to try and minimize size like that.

    One interesting thing to note about that, though, is that it's pretty easy to strip the controller logic to a barebones form. Check out this video by ShockSlayer.
     
  14. Marmotta

    Marmotta Dauntless Member

    Joined:
    Apr 14, 2009
    Messages:
    755
    Likes Received:
    49
    Really good work so far. I've done micro's wireless mod on a Saturn pad, but wasn't sure about trying it with N64 pads for the same reasons you've outlined regarding using peripherals. Now if only someone could come up with a wireless Dreamcast pad...
     
sonicdude10
Draft saved Draft deleted
Insert every image as a...
  1.  0%

Share This Page