All Projects → coryjfowler → MCP_CAN_lib

coryjfowler / MCP_CAN_lib

Licence: LGPL-3.0 license
MCP_CAN Library

Projects that are alternatives of or similar to MCP CAN lib

asysbus
Arduino System Bus
Stars: ✭ 23 (-95.94%)
Mutual labels:  arduino-library, can-bus
SparkFun CAN-Bus Arduino Library
No description or website provided.
Stars: ✭ 132 (-76.72%)
Mutual labels:  arduino-library, can-bus
Twizy-Virtual-BMS
This is an Arduino library providing an emulation of the CAN communication protocol of the BMS (battery management system) on a Renault Twizy.
Stars: ✭ 57 (-89.95%)
Mutual labels:  arduino-library, can-bus
PsxNewLib
Playstation controller interface library for Arduino
Stars: ✭ 81 (-85.71%)
Mutual labels:  arduino-library
Adafruit-SSD1331-OLED-Driver-Library-for-Arduino
For 0.96" OLEDs in the Adafruit shop
Stars: ✭ 94 (-83.42%)
Mutual labels:  arduino-library
PCF8591 library
Library to use i2c analog IC with arduino and esp8266. Can read analog value and write analog value with only 2 wire (perfect for ESP-01).
Stars: ✭ 24 (-95.77%)
Mutual labels:  arduino-library
ArduZ80
The first Z80 emulation library for Arduino
Stars: ✭ 44 (-92.24%)
Mutual labels:  arduino-library
ATM90E32
Updated version of the ATM90E32 Arduino library
Stars: ✭ 22 (-96.12%)
Mutual labels:  arduino-library
arduino-remote-uploader
Over-the-air arduino programming via xbee, wifi or nordic
Stars: ✭ 31 (-94.53%)
Mutual labels:  arduino-library
Adafruit MP3
mp3 decoding on arduino
Stars: ✭ 29 (-94.89%)
Mutual labels:  arduino-library
Adafruit SI1145 Library
Arduino library for the SI1145 sensors in the Adafruit shop
Stars: ✭ 20 (-96.47%)
Mutual labels:  arduino-library
TLV493D-A1B6-3DMagnetic-Sensor
Library for the TLV493D-A1B6 3D magnetic sensor for Arduino.
Stars: ✭ 27 (-95.24%)
Mutual labels:  arduino-library
TractorHacking.github.io
Tractor Hacking GHPages
Stars: ✭ 34 (-94%)
Mutual labels:  can-bus
FastX9CXXX
Arduino library for digital potentiometers X9C102, X9C103, X9C104 and X9C504
Stars: ✭ 36 (-93.65%)
Mutual labels:  arduino-library
SparkFun MMA8452Q Arduino Library
SparkFun Triple Axis Accelerometer Breakout - MMA8452Q Arduino Library
Stars: ✭ 16 (-97.18%)
Mutual labels:  arduino-library
Syslog
An Arduino library for logging to Syslog server in IETF format (RFC 5424) and BSD format (RFC 3164)
Stars: ✭ 105 (-81.48%)
Mutual labels:  arduino-library
tfmini
An Arduino driver for the Benewake TFMini time-of-flight distance sensor
Stars: ✭ 32 (-94.36%)
Mutual labels:  arduino-library
SoftWire
Software I2C implementation for Arduino and other Wiring-type environments
Stars: ✭ 105 (-81.48%)
Mutual labels:  arduino-library
M5Stack-NMEA-2000-Display-CAN-BUS
This repository shows how to use the M5Stack as NMEA 2000 Display and WiFi Gateway.
Stars: ✭ 29 (-94.89%)
Mutual labels:  can-bus
ESP8266MQTTClient
No description or website provided.
Stars: ✭ 77 (-86.42%)
Mutual labels:  arduino-library

MCP_CAN Library for Arduino

MCP_CAN library v1.5 This library is compatible with any shield or board that uses the MCP2515 or MCP25625 CAN protocol controller.

This version supports setting the ID filter mode of the protocol controller, the BAUD rate with clock speed with the begin() function. Baudrates 5k, 10k, 20k, 50k, 100k, 125k, 250k, 500k, & 1000k using 16MHz clock on the MCP2515 are confirmed to work using a Peak-System PCAN-USB dongle as a reference. Baudrates for 8MHz and 20MHz crystals are yet to be confirmed but were calculated appropriately.

The readMsgBuf() functions bring in the message ID. The getCanId() function is obsolete and no longer exists, don't use it.

The readMsgBuf(*ID, *DLC, *DATA) function will return the ID type (extended or standard) and it will bring back the remote request status bit.
If the ID AND 0x80000000 EQUALS 0x80000000, the ID is of the Extended type, otherwise it is standard.
If the ID AND 0x40000000 EQUALS 0x40000000, the message is a remote request.

The readMsgBuf(*ID, *EXT, *DLC, *DATA) function will return the ID unaltered and doesn't inform us of a remote request.
If EXT is true, the ID is extended.

The sendMsgBuf(ID, DLC, DATA) function can send extended or standard IDs.
To mark an ID as extended, OR the ID with 0x80000000.
To send a remote request, OR the ID with 0x40000000.

The sendMsgBuf(ID, EXT, DLC, DATA) has not changed other than fixing return values.

Using the setMode() function the sketch can now put the protocol controller into sleep, loop-back, or listen-only modes as well as normal operation. Right now the code defaults to loop-back mode after the begin() function runs. I have found this to increase the stability of filtering when the controller is initialized while connected to an active bus.

User can enable and disable (default) One-Shot transmission mode from the sketch using enOneShotTX() or disOneShotTX() respectively.

To wake up from CAN bus activity while in sleep mode enable the wake up interrupt with setSleepWakeup(1). Passing 0 will disable the wakeup interrupt (default).

Installation

Copy this into the "[.../MySketches/]libraries/" folder and restart the Arduino editor.

NOTE: If an older version of the library exists (e.g. CAN_BUS_Shield) be sure to remove it from the libraries folder or replace the files with those in this library to avoid conflicts.

Help and Support

This is primarily for non-bug related issues: Please start a new thread in an appropriate area at Seeedstudio forums or Arduino.cc forums and then send me (coryjfowler) a link through the PM system, my user name is the same as it is here. I will receive an email about the PM. Keep in mind, I do this in my spare time.

Happy Coding!

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].