Code Monkey home page Code Monkey logo

Comments (2)

knopfcol avatar knopfcol commented on May 30, 2024

I made progress by placing the following code within the IF statements that pertain to them.

lcd.setCursor(0,0);
lcd.print("Set Speed");
lcd.setCursor(11,0);
lcd.print(" ");
lcd.setCursor(0,3);
lcd.print(" ");
lcd.setCursor(11,0);
lcd.print(TrlCtlSetSpd,0);
lcd.setCursor(0,3);
lcd.print(RPMStatus);

Along with this I eliminated the printing of blanks to erase previous text. This now applies all the filters to the canbus.

It is interesting though because I receive some messages much more frequently than others even though they should be sending at the same rate.

Could I just be overloading the arduino with how many messages it is receiving?

from arduino_can_bus_mcp2515.

coryjfowler avatar coryjfowler commented on May 30, 2024

I am able to get the first mask to work which corresponds to the first 2 filters. The issue is with the second mask and second set of filters (3-6). Is there something in the library I need to change to enable both masks?

There is no way to disable certain masks or filters. It is possible your program is doing too much in the receive if statement that messages are overflowing the first receive buffer in the protocol controller which moves that message to the second buffer, overwriting its contents. If you want to turn this off, you will need to modify the .cpp file of the library to disable the bukt bit, see below.

        //Change this
        mcp2515_modifyRegister(MCP_RXB0CTRL,
        MCP_RXB_RX_MASK | MCP_RXB_BUKT_MASK,
        MCP_RXB_RX_ANY | MCP_RXB_BUKT_MASK);

        //To this
        mcp2515_modifyRegister(MCP_RXB0CTRL,
        MCP_RXB_RX_MASK | MCP_RXB_BUKT_MASK,
        MCP_RXB_RX_ANY);

Could I just be overloading the arduino with how many messages it is receiving?

That is definitely possible. You are also updating the LCD with every received message. There are places where elseif statements would improve performance. I'd also suggest implementing a modified version of the "blink without delay" sketch included with the Ardunio IDE to update your LCD at a specific rate outside of the receive if statement.

It is interesting though because I receive some messages much more frequently than others even though they should be sending at the same rate.

I've explored CAN on several vehicles and I've never seen messages come at the same rate. Some are 10Hz, some at 1Hz and a few at 20Hz or faster.

from arduino_can_bus_mcp2515.

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.