Close
0%
0%

Digi:[S]NES

USB to SNES/NES controller using Digispark

Similar projects worth following
This project was created to allow playing games on the PC using original SNES controllers. It is based on a Digispark board but can also run on clone boards. The code uses the Digispark Joystick library and some glue code to shift in the data from the controller and maps the directional controllers to X and Y axes and the remaining switches to ordinary buttons. It will work on NES gamepads as well.

This project uses a DigiStump (or any of its clones, even homebuilt) altogether with the "DigiJoystick" library to allow the the use of a NES/SNES controller in games or emulators on a computer's USB port.

The most recent version have an auto-fire feature selectable for the action buttons just by helding it down until the USB controller device is recognized by the computer.

  • 1 × Digispark
  • 1 × Controller Mating connector

  • Bug Fixes

    danjovic02/26/2023 at 19:45 0 comments

    Fixed the ghost auto-fired buttons with original NES controllers.
    Found and fixed another bug: the missing pull-up on the DATA which caused the a similar ghosting when no controller was present.

    As an extra feature I have unified the button mapping. Now A,B,Sel,Start on NES activates the same PC buttons as the SNES controllers (1,2,7,8 respectively).

    //
    // USB Joystick Mapping
    //  
    //   USB       == SNES ==     == NES ==
    //  Y Axis   -  Up/Down    -   Up/Down  
    //  X Axis   - Left/Right  -  Left/Right
    //  Button 1 -     A       -      A     
    //  Button 2 -     B       -      B     
    //  Button 3 -     x       -      -     
    //  Button 4 -     Y       -      -     
    //  Button 5 -   Top L     -      -   
    //  Button 6     Top R     -      -   
    //  Button 7 -   Select    -    Select  
    //  Button 8 -   Start     -    Start

  • Human Interface Challenge Contest Entry

    danjovic07/19/2018 at 01:39 0 comments

    I have submitted this project to Human Interface Challenge  because of the Auto Fire feature.


    Some game controllers (like asciipad) have switches that allow the activation of auto-fire for some buttons.

    The innovation in Human interface in this project is to eliminate such switches. The Auto-Fire feature is activated by keeping the desired buttons pressed while the controller is plugged in (and hence powered on).


  • Autofire implemented!

    danjovic04/30/2016 at 02:28 0 comments

    Successfully implemented autofire to the sketch and updated code in github.

    The circuit was tested using #SILSpark and the #MAME USB board without the microcontroller as it has some 4021's in series just like the SNES controller.

    The autofire triggers at approximately 10Hz and can be assigned to any of the action buttons: (A,B,X,Y,TopL,TopR) just by holding down any of them and waiting for digispark to be detected as a joystick.

    (

  • Adding Auto-fire

    danjovic04/29/2016 at 22:34 0 comments

    Somebody suggested me adding programming features and auto-fire to the DIGI-SNES.

    The auto-fire is easy to implement, but it took me some minutes to find an elegant way of activating the auto-fire to the desired functions but the solution is quite simple:

    - Held the the desired buttons pressed while plug the DIGI-SNES on the USB port. Then the firmware will use the state of the activated buttons to initialize one variable that holds a mask to be applied over the button states at given intervals thus simulating sequential releases for a button that is continuously pressed.

    In the code below the button is active in '1' and the auto-fire mask bit is active in '0'.

    	// Modulate buttons with auto-fire 
    	if (++count & 2 )  {  
    		Buttons_low &= mask; 
    	}

    As for the programming I have to think it better because if I want to keep the functionality of all buttons and still can record some button sequences it will involve adding more keys to the project. Maybe a foot switch will suit to this function.

View all 4 project logs

Enjoy this project?

Share

Discussions

Schmurtz wrote 08/05/2017 at 07:07 point

Nice, thanks :)

Do you think possible to use one digispark for 2 nes controllers ?

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates