Coder Social home page Coder Social logo

Quick data exchange about due_can HOT 2 CLOSED

collin80 avatar collin80 commented on July 30, 2024
Quick data exchange

from due_can.

Comments (2)

collin80 avatar collin80 commented on July 30, 2024

I tried this out myself and it seems to work very rapidly. Here is my test setup (which was probably very different from your test setup): I used two EVTVDue boards connected together. I had both ends terminated. I put a kvaser leaf light in the middle tapping the CANH and CANL lines so I could monitor what was going on. Then I used the Can_SnooperCallback example included with the library as one end. I modified it such that instead of printing to the console it merely changes the received ID by adding one and resending the frame. On the other EVTVDue I put my GVRET sketch and used SavvyCAN to periodically send frames out. With the kvaser in the middle I was able to see both sides sending and measure how long it took for responses to happen. My result is that the CAN_SnooperCallback (modified) side would send the reply about 2-3 ten thousandths (0.0001) of a second after reception. That's pretty fast. Because of that I believe the library to be working properly.

So, the question is then, why is it working slowly for you. My best guess would be that you have debugging statements or some sort of serial or USB traffic going on. If you print things to Serial or SerialUSB you are likely to get severe pauses at seemingly random times. USB is polled and so you will find that sending too much will cause your sketch to block until the next time the USB is polled. This isn't long, perhaps 10ms but those 10ms could be a bad thing if you needed to reply sooner. Try running your code without any debugging or other sort of serial output and see what happens.

from due_can.

hannes93 avatar hannes93 commented on July 30, 2024

Your guess was correct. I used debugging to monitor the incoming messages over serial. When I remove the debugging statements I achieve a response within (0.0002 - 0.0003 sec). That's fast enough for me to achieve the things I want to do. Thanks a lot for your support!

from due_can.

Related Issues (20)

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.