Coder Social home page Coder Social logo

Comments (4)

nordblick2 avatar nordblick2 commented on May 17, 2024

And here some additional information from the logic analyser (same code, different board):

Arduino Wemos D1
Setup Write to [0xA4] + ACK Setup Write to [0xA4] + ACK
0xF0 + ACK 0xF0 + ACK
0x55 + ACK 0x55 + ACK
Setup Write to [0xA4] + ACK Setup Write to [0xA4] + ACK
0xFB + ACK 0xFB + ACK
0x00 + ACK 0x00 + ACK
Setup Write to [0xA4] + ACK Setup Write to [0xA4] + ACK
0xFA + ACK 0xFA + ACK
Setup Read to [0xA5] + ACK Setup Read to [0xA5] + ACK
0x00 + ACK 0x00 + ACK
0x00 + ACK Setup Write to [0xFE] + NAK
0xA4 + ACK 0xFE + NAK
0x20 + ACK 0xFE + NAK
0x01 + ACK 0xFE + NAK
0x01 + NAK 0xFF + Missing ACK/NAK
Setup Write to [0xA4] + ACK  
0x00 + ACK  
Setup Read to [0xA5] + ACK  
0x20 + ACK  
0x20 + ACK  
0x10 + ACK  
0x00 + ACK  
0xFF + ACK  
0xFF + NAK  

from nintendoextensionctrl.

nordblick2 avatar nordblick2 commented on May 17, 2024

OK, I guess, I resolved it: Wemos D1 (all ESPs?) seems just to be on speed 😜. ESPs/D1's default i2s speed is 400k. Everything's working with

Wire.begin();
Wire.setClock(10000L);
controller.begin();
// ...

Will do further test tomorrow and (probably) close that issue.

from nintendoextensionctrl.

dmadison avatar dmadison commented on May 17, 2024

I don't have a D1, but I just tested with a NodeMCU ESP8266 and didn't find any issues.

My guess is that it's a pull-up problem, particularly if reducing the speed helps. All of the Nintendo extension controllers use pull-ups on the controller itself rather than the host because the wire length (bus capacitance) varies wildly depending on the controller. Chinese controllers are notorious for foregoing these pull-ups. I'd recommend using a multimeter to check the pull-ups on your own Classic Controller.

You mentioned trying some 4.7k pull-ups so you may have the opposite problem with the pull-ups being too strong, particularly if you have another device on the same bus with its own pull-ups.

The AVR Arduinos also enable their internal pull-ups for the I2C bus by default (~30K) while other microcontrollers don't. Because the primary pull-ups are on the controller and not the master, some microcontrollers like the Teensy will hang waiting for I2C response if the controller is disconnected since it leaves the bus floating. A weak pull-up fixes this - I've had good results with ~47K.

Lastly, the genuine Classic Controllers don't like being re-initialized. If you reset the microcontroller without powering down the controller, the connect function may return false because the controller's identity string no longer matches the Classic Controller. Power cycle the controller to fix the issue. I don't think that's your problem, but that issue may interfere with your testing.

Do you have access to an oscilloscope? I would look at the signal directly if you can.

from nintendoextensionctrl.

dmadison avatar dmadison commented on May 17, 2024

It's been two weeks without an update, I'm assuming this is solved. Feel free to re-open if you still have issues.

from nintendoextensionctrl.

Related Issues (16)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.