GithubHelp home page GithubHelp logo

speters / nmea2000_can2040 Goto Github PK

View Code? Open in Web Editor NEW
7.0 3.0 0.0 839 KB

NMEA2000_can2040 library for Raspberry Pi Pico using CAN2040 PIO implementation

License: MIT License

C++ 9.11% C 90.89%
boat nmea2000 open-boat-projects rp2040 rpi-pico can canbus n2k nmea2k

nmea2000_can2040's Introduction

alpha status

sending does still not work

NMEA2000_can2040 library for Raspberry Pi Pico / RP2040

NMEA2000_can2040 is a driver supplement to NMEA2000 library by Timo Lappalainen.

It is based on the CAN2040 implementation by Kevin O'Connor which makes use of the Raspberry Pi Pico's PIO.

Besides the Raspberry Pi Pico, only a CAN transceiver with 3.3V IO like the SN65HVD230 (marking code VP230) is necessary.

Usage

// include NMEA2000_can2040.h header instead of NMEA2000_CAN.h
#include <NMEA2000_can2040.h>
#include <N2kMsg.h>
#include <NMEA2000.h>

// set NMEA2000 class
tNMEA2000_can2040 NMEA2000;

You can set PIO, TX-Pin & RX-Pin as follows:

  /// @brief NMEA2000 constructor
  /// @param _Pio PIO to use, either 0 or 1
  /// @param _TxPin TX pin, default defined CAN2040_TX_PIN 3
  /// @param _RxPin RX pin, default defined CAN2040_RX_PIN 4
  tNMEA2000_can2040(uint32_t _Pio = CAN2040_PIO, uint32_t _TxPin = CAN2040_TX_PIN, uint32_t _RxPin = CAN2040_RX_PIN);

Or use the preprocessor defines CAN2040_PIO, CAN2040_TX_PIN, CAN2040_RX_PIN before the inclusion of NMEA2000_can2040.h.

Hardware setup

You should use a CAN transceiver with 3.3V I/O, as the Pico RP2040 is a 3.3V device.

Connection example following the default setup: CAN transceiver connection to Raspberry Pi Pico

Make sure your bus termination is correct.

Licenses

CAN2040 is released under GPLv3.

NMEA2000_can2040 is released under MIT License (now get that sorted...).

nmea2000_can2040's People

Contributors

speters avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

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.