Code Monkey home page Code Monkey logo

servocontroller's People

Contributors

ftjuh avatar

Stargazers

 avatar

Watchers

 avatar

servocontroller's Issues

ESP8266 controller will crash the target firmware if addresses >=0x40 are used on the bus

ESP8266 as controller uses a very tight timing after a start condition. Analysis with a logic analyzer shows that the ESP8266 will pull SDA up very soon after pulling SCL low. Addresses >= 0x40 will result in a '1' bit sent immediately after that.

Logic Analyzer output from Pulseview (remove ".zip" from file extension): 0x40 24Mhz 20k samples.sr.zip

The original code will erroneously interpret this as a stop condition because it does not buffer the state of SDA between detecting a pin change and interpreting this change as a stop condition. Also, it ignores SCL in doing so.

        // Wait until end of start condition or begin of stop condition 
        while ((PINB & 128) && !(PINB & 32));

        // Break when a stop condition has been received while waiting
        if (PINB & 32) {
          break;
        }

After the false detection of a stop detection the above break; command will cause an exit from the main loop, putting the device in an undefined, non reactive state.

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.