Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MCP2515 and receive mask and filter (Arduino Uno) #143

Closed
olliiiver opened this issue Jul 14, 2019 · 1 comment
Closed

MCP2515 and receive mask and filter (Arduino Uno) #143

olliiiver opened this issue Jul 14, 2019 · 1 comment

Comments

@olliiiver
Copy link

olliiiver commented Jul 14, 2019

Hi.

Thanks for providing a library for the NMEA 2000 bus.

I tried to use an atmega328p (Arduino Uno). Why? Because pdip package provides easy soldering.

I was able to use the library for sending data to the bus:

// set N2K_NO_HEARTBEAT_SUPPORT, N2K_NO_GROUP_FUNCTION_SUPPORT
#define SlowDataUpdatePeriod 1000
void loop() {
  SendN2kSlowData();
// NMEA2000.ParseMessages();
}
void SendN2kSlowData() {
  static unsigned long SlowDataUpdated=millis();
  tN2kMsg N2kMsg;
  if (SlowDataUpdated+SlowDataUpdatePeriod<millis()) {
    SlowDataUpdated=millis();
    SetN2kFluidLevel(N2kMsg, 1, N2kft_Fuel, 50, 60);
    NMEA2000.SendMsg(N2kMsg);
  }
}

Also I was trying to receive data by using minimal version of DataDisplay2, but without any luck. Maybe the bus is too crowded. Seems the loop gets stuck in NMEA2000.ParseMessages(). Without parsing any messages sending works.

Has somebody get this to work on an Arduino Uno?

Would it help to set a receive filter for only messages I need (a feature from the MCP2515)?

@ttlappalainen
Copy link
Owner

Please read https://github.com/ttlappalainen/NMEA2000#memory-requirements. Also check issue #20.

Filtering does not help and I do not support that on my library.

The biggest problem is that UNO just does not have enough memory. There is no sense to take any headache with these small memory devices, when there are devices like Teensy 3.x and ESP32 available for nearly same or even cheaper price.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants