NOTE: This Click board™ represents an optimized version of the MCP2518FD Click with the aim of more efficient hardware, where the controller and transceiver, in this case, can be found in one package.
How does it work?
MCP251863 Click as its foundation uses the MCP251863, an IC representing a compact solution containing a CAN FD controller with an SPI interface and a high-speed CAN transceiver from Microchip. The high-speed CAN transceiver provides a physical connection with the CAN bus itself, while the CAN controller represents an interface between the MCU and the transceiver. The role of the CAN controller is to provide arbitration, message framing, message validation, error detection, message filtering, and more. Among all other tasks, it offers formatted CAN data for the application layer, running on the host MCU.
The MCP251863 communicates with MCU using the SPI interface, allowing communication speeds up to 5Mbps and supporting Normal and Standby operational modes. Normal mode is engaged when the STB pin, routed on the AN pin of the mikroBUS™ socket, is at the logic low level, while its transmit pin is held to a high logic level. While in the Normal mode, the data can be sent and received via the CAN H/L bus lines.
The mode selection can be performed by positioning the SMD jumper labeled as STBY to an appropriate position marked as STBY or ON. In Standby mode, if the STBY jumper is set to the STBY position, the user has the option of activating the Standby mode in two ways, where the selection is made by positioning the SMD jumper labeled as STBY SEL to an appropriate position marked as STBY or INT0. This way, the Standby mode can be activated via STB pin from the mikroBUS™ socket or by the MCP251863 interrupt signal IN0 routed to the TX pin of the mikroBUS™ socket (the IN0 pin can also be used to alert the MCU about the TX events).
In addition, this Click board™ also uses several pins of the mikroBUS™ socket. The CLK pin from the MCP251863 routed to the PWM pin of the mikroBUS™ socket can provide the clock output for the host MCU or represent the start of the frame signal. It is derived from the input clock generated by the onboard chip oscillators, where the onboard SMD jumpers allow frequency selection between 20MHz and 40MHz. Besides, it also uses two interrupt pins, INT and INT1 routed to the INT and RX pins of the mikroBUS™ socket, respectively. While the INT pin is always an interrupt pin, used to alert the MCU of the enabled interrupt event, the INT1 pin alert the MCU about the RX events (if these interrupts are enabled).
In addition, the user can connect the external TX/RX signals to the CAN FD transceiver and CAN bus signals directly through the onboard headers on the left and right sides of the board. This Click board™ comes equipped with the standard DB-9 connector, making interfacing with the CAN bus simple and easy.
This Click board™ can operate with both 3.3V and 5V logic voltage levels selected via the VIO SEL jumper. This way, it is allowed for both 3.3V and 5V capable MCUs to use the communication lines properly. However, the Click board™ comes equipped with a library containing easy-to-use functions and an example code that can be used, as a reference, for further development.
Specifications
Type
CAN,CAN FD
Applications
Can be used for developing a wide range of automotive diagnostic applications, even on MCUs that do not natively support CAN interface
On-board modules
MCP251863 – CAN FD controller with an SPI interface and a high-speed CAN transceiver from Microchip
Key Features
Expands the existing MCU with the reliable and robust CAN connectivity option, support for both CAN 2.0B and CAN FD frames, high speed CAN communication up to 5 Mbps, integrated DE-9 connector, and more
Interface
GPIO,PWM,SPI
Feature
No ClickID
Compatibility
mikroBUS™
Click board size
L (57.15 x 25.4 mm)
Input Voltage
3.3V or 5V
Pinout diagram
This table shows how the pinout on MCP251863 Click corresponds to the pinout on the mikroBUS™ socket (the latter shown in the two middle columns).
Onboard settings and indicators
Label | Name | Default | Description |
---|---|---|---|
LD1 | PWR | – | Power LED Indicator |
JP1-JP2 | CRY SEL | Right | External Crystal Selection 20MHz/40MHz: Left position 20MHz, Right position 40MHz |
JP3 | VIO SEL | Left | Logic Level Voltage Selection 3V3/5V: Left position 3V3, Right position 5V |
JP4 | STBY | Left | Operational Mode Selection STBY/ON: Left position STBY, Right position ON |
JP5 | STBY SEL | Left | Standby Mode Control Selection STBY/INT0: Left position STBY, Right position INT0 |
J1 | – | Unpopulated | TX/RX CAN Signals Connection Header |
J2 | – | Unpopulated | CAN Bus Lines Connection Header |
MCP251863 Click electrical specifications
Description | Min | Typ | Max | Unit |
---|---|---|---|---|
Supply Voltage | 3.3 | – | 5 | V |
Data Rate | – | – | 5 | Mbps |
Operating Temperature Range | -40 | +25 | +120 | °C |
Software Support
We provide a library for the MCP251863 Click as well as a demo application (example), developed using MikroElektronika compilers. The demo can run on all the main MikroElektronika development boards.
Package can be downloaded/installed directly from NECTO Studio Package Manager(recommended way), downloaded from our LibStock™ or found on Mikroe github account.
Library Description
This library contains API for MCP251863 Click driver.
Key functions
-
mcp251863_transmit_message
Transmits the desired message and checks is message successfully sent. -
mcp251863_receive_message
Receives the message and checks is message successfully received. -
mcp251863_operation_mode_select
Function for select operation mode.
Example Description
This example demonstrates the use of an MCP251863 Click board™ by showing the communication between the two click boards configured as a receiver and transmitter.
void application_task ( void )
{
#ifdef DEMO_APP_TRANSMITTER
if ( MCP251863_OK == mcp251863_transmit_message( &mcp251863, DEMO_TEXT_MESSAGE, strlen( DEMO_TEXT_MESSAGE ) ) )
{
log_printf( &logger, " The message "%s" has been sent!rn", ( char * ) DEMO_TEXT_MESSAGE );
}
Delay_ms( 2000 );
#else
uint8_t data_buf[ 256 ] = { 0 };
uint16_t data_len = 0;
if ( MCP251863_OK == mcp251863_receive_message( &mcp251863, data_buf, &data_len ) )
{
log_printf( &logger, " A new message has received: "" );
for ( uint16_t cnt = 0; cnt < data_len; cnt++ )
{
log_printf( &logger, "%c", data_buf[ cnt ] );
}
log_printf( &logger, ""rn" );
}
#endif
}
The full application code, and ready to use projects can be installed directly from NECTO Studio Package Manager(recommended way), downloaded from our LibStock™ or found on Mikroe github account.
Other Mikroe Libraries used in the example:
- MikroSDK.Board
- MikroSDK.Log
- Click.MCP251863
Additional notes and informations
Depending on the development board you are using, you may need USB UART click, USB UART 2 Click or RS232 Click to connect to your PC, for development systems with no UART to USB interface available on the board. UART terminal is available in all MikroElektronika compilers.
mikroSDK
This Click board™ is supported with mikroSDK – MikroElektronika Software Development Kit. To ensure proper operation of mikroSDK compliant Click board™ demo applications, mikroSDK should be downloaded from the LibStock and installed for the compiler you are using.
For more information about mikroSDK, visit the official page.