DFR0370

DFR0370 Datasheet


Shield V2 SKU DFR0370

Part Datasheet
DFR0370 DFR0370 DFR0370 (pdf)
PDF Datasheet Preview
Shield V2 SKU DFR0370

Introduction

The CAN-BUS arduino shield v2.0 is designed for the Arduino Microcontroller. It is compatible with the Arduino standard interface and can be stacked on an Arduino UNO, arduino Leonardo or arduino MEGA board. The shield integrates an MCP2515 CAN-BUS chip on the shield and has a CAN-BUS transceiver function. With an on-board DB9 and CAN-BUS connector you can choose a suitable port according to your host device. There is also an integrated MicroSD socket for data storage - a perfect solution for data logging applications.
• Capable of transmitting and receiving both standard and remote frames
• Supports rotational and interrupt detection reception methods
• Supports UART, i2C and DB9 terminal interfaces
• Supports SD card data storage
• Supports Arduino mainboard power supply or DB9 power supply Switch

Specification
• Chip MCP2515
• Power supply ~ 5V Arduino board power supply or DB9 interface power supply
• Dimension 76x54x19mm / 2.99x2.12x0.75 inches
• Weight 40g

Board Overview

Two power-supply modes Power switch "ON", powered by DB9 port Power switch "OFF", powered by Arduino board Note The Arduino board can be powered from a 7V source, the switch should be "ON" The Arduino board can be powered from the USB and DB9 simultaneously but if the Arduino board is powered by DC-Vin port, the power switch should be turned off to avoid damage to the shield and the board.

How to Configure the Node

This section will detail how to configure the CAN-BUS Node CAN-BUS Node Device What is CAN-BUS Node? The CAN-bus is a local area network control protocol. In a local area network there are multiple devices connected. Each device is called "Node". There is a CAN-bus protocol controller on each node control chip . Refer to CAN-BUS WIKIPEDIA

CAN-BUS nodes can be used as a data receiver or data transmitter. So we call the CAN-bus node a "transceiver" There is no concept of "Address" in CAN-BUS protocol, instead each device is distinguished by an "ID". Every device has a special ID in the node. The CAN-BUS node relies on its hardware proof function to implement a selective receipt of Data frame from special ID at initialization time. We can call the following command to configure the special ID init_Mask Masker_t Masker_num, INT8U ext, INT32U ulData and init_Filter Filter_t Filter_num, INT8U ext, INT32U Data The data sent by any node in the network can be selectively received by the other nodes. This node can also selectively receive data sent by other ones.

The following is a simple scenario to demonstrate how it works There are 5 nodes in the network A, B, C, D and E. If Node B can only receive data from ID 0x06, when Node A wants to send "Hello world" to Node B, you can call sendMsgBuf 0x06, 0, 12, "hello world" function to implement this process. Meanwhile, what about the other nodes circumstance?

Assumption:

Node B data frame receiving ID 0x06 Node C data frame receiving ID 0x06 and 0x08 Node D data frame receiving ID 0x07 Node E data frame receiving ID Anyone

Then,

When Node A send data frame to ID 0x06, the available Node B, C, E When Node A send data frame to ID 0x07, the available Node D, E When Node A send data frame to ID 0x08, the available Node C, E When Node A send data frame to ID 0x12, the available Node E

Arduino Library Function

MCPCAN INT8U _CS Description Constructor, specify the CAN-BUS Shield V1.0 SPI chip select pin. Parameter:
• _CS Chip select

Return None Example:

MCPCAN CAN 4 //Instantiate a Object with MCPCAN class, D4 is Arduino SP I CS pin.
void init void Description Initialize SPI module reset MCP2515. None Return None Example:

This function should be called at first, initialize CAN-BUS MCU.

INT8U begin INT8U speedset Description Initialize setting CAN-BUS buadrate, follow the init function. Parameter:
• speedset Baudrate CAN_5KBPS, CAN_10KBPS, CAN_20KBPS, CAN_31K25BPS, CAN_33KBPS, CAN_40KBPS, CAN_50KBPS, CAN_80KBPS, CAN_83K3BPS, CAN_95KBPS, CAN_100KBPS, CAN_125KBPS, CAN_200KBPS, CAN_250KBPS, CAN_500KBPS, CAN_1000KBPS.

Return If the initialization is successful, return "CAN_OK" if initialization fails, return "CAN_FAILINIT". Example:
begin CAN_500KBPS ;

INT8U sendMsgBuf INT32U id, INT8U ext, INT8U len, INT8U *buf Introduction Send a set of data frame Parameter:
• id Data frame ID
• ext "ext = 0", it is a standard frame "ext = 1", it is an extended frame.
• len data length, len < 8
• buf Data buffer point

Return If success, returns "CAN_OK" if timeout, returns "CAN_SENDMSGTIMEOUT" If you fail to get the next free buffer, it returns "CAN_GETTXBFTIMEOUT". Example:
unsigned char data[8] = 'F', 'R', 'O', 'B', 'O', 'T', sendMsgBuf 0x06, 0, sizeof data , data ;

INT8U MCPCAN::setMsg INT32U id, INT8U ext, INT8U len, INT8U rtr, INT8U *pData Introduction Send remote sending request message. Parameter:
• id Data frame ID
• ext "ext = 0", it is a standard frame "ext = 1", it is an extended frame.
• len data length, len < 8
• rtr "rtr = 1", it is a Remote sending request frame "rtr = 0", it is a data frame.
• buf Data buffer point

Return If success, returns "CAN_OK" if timeout, returns "CAN_SENDMSGTIMEOUT" If you fail to get the next free buffer, it returns "CAN_GETTXBFTIMEOUT". Example:
unsigned char data[8] = 'F', 'R', 'O', 'B', 'O', 'T', setMsg 0x06, 0, sizeof data , 0, data ;

INT8U isRemoteRequest void Introduction Check whether it is a remote frame Parameter None Return "1", Yes "0", No

INT8U init_Mask Masker_t Masker_num, INT8U ext, INT32U Data Introduction Initialize the mask register Parameter:
• Masker_num mask register name If Masker_num = MCP_RXM0, initialize the mask register 0 mask register 0 receives data from buffer0 if Masker_num = MCP_RXM1, initialize the mask register 1 mask register 1 receives data from buffer1 .
• ext "ext=0", configure standard frame with mask register setting "ext = 1", configure extended frame with mask register setting.
• Data Write this data into mask register, to configure which register will be blocked.

Returns if success, returns "MCP_OK" if fail, returns "MCP_FAIL" Example:
More datasheets: SP600-02 | SP600-114 | SP600-104 | SP600-43 | SP600-54 | SP600-58 | 74LVQ32SJ | 74LVQ32SCX | 74LVQ32SJX | 74LVQ32SC


Notice: we do not provide any warranties that information, datasheets, application notes, circuit diagrams, or software stored on this website are up-to-date or error free. The archived DFR0370 Datasheet file may be downloaded here without warranties.

Datasheet ID: DFR0370 508741