How does it work?
CAN FD 6 Click as its foundation uses the TCAN4550, a CAN transceiver that supports CAN and CAN FD protocols and provides an interface between the CAN bus and the CAN protocol controller up to 5 megabits per second (Mbps) from Texas Instruments. It is characterized by high-bandwidth and data-rate flexibility, provides an SPI interface between the CAN bus and the system processor, and supports wake-up features local and bus wake using the CAN bus. The device includes many protection features providing CAN bus robustness, including fail-safe mode, internal dominant state timeout, and wide bus operating range.
The TCAN4550 has one pin used for waking up the device from Sleep mode. This pin is connected to an external button labeled as WAKE and the PWM pin of the mikroBUS™ socket labeled as WKP to generate a local Wake-Up function. A Wake-Up event on the CAN bus switches the inhibit output pin INH to the high level. The INH pin provides an internal switch towards the battery supply voltage and control external voltage regulators, the MCP1804 from Microchip. Through SMD jumpers labeled as 3V3JMP and 5VJMP, the LDOs output voltages can be used to power up the mikroBUS™ 3.3V and 5V power rails. However, it should be noted that Mikroe does not advise powering up their systems this way. That is why these jumpers are left unpopulated by default.
CAN FD 6 Click communicates with MCU using a standard SPI interface supporting clock rates up to 18MHz to transmit and reception CAN frames. With an additional 40MHz crystal, the TCAN4550 can meet CAN FD rates up to 5 Mbps data rates to support higher data throughput and operates from a 6V to 24V external power supply header on the board’s right side. This feature makes the TCAN4550 device ideal for many different applications, including those in the automotive market.
This Click board™ comes equipped with the industry-standard DB-9 connector, making interfacing with the CAN bus simple and easy. Besides, the user can connect the CAN signals directly through the CAN External header located on the board’s left edge.
In addition to these features, the TCAN4550 also uses several GPIO pins connected to the mikroBUS™ socket. The RST pin the mikroBUS™ can perform the Hardware Reset function, which resets the device to the default settings and puts it into standby mode. This feature can also be achieved through the onboard push-button labeled as RST. Next to these pins, the ATA6571 uses the WKR pin as a dedicated wake-up request pin from a bus wake request and INT pin as an interrupt feature routed on the AN and INT pin of the mikroBUS™ socket. For interrupt purposes, the user can also use GPIO pins from the header positioned on the board’s right side.
This Click board™ can operate with both 3.3V and 5V logic voltage levels selected via the VIO SEL jumper. It allows for both 3.3V and 5V capable MCUs to use the UART 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 high-speed CAN networks in automotive and industrial applications, especially where low-power mode with wake-up capability via the CAN bus is required.
On-board modules
TCAN4550 – CAN FD controller that provides an interface between the CAN bus and the CAN protocol controller up to 5Mbps from Texas Instruments
Key Features
Low power consumption, classic CAN backwards compatible, wide operating range, optimized behavior when unpowered, high-bandwidth, data-rate flexibility, and more.
Interface
SPI
Feature
No ClickID
Compatibility
mikroBUS™
Click board size
L (57.15 x 25.4 mm)
Input Voltage
3.3V or 5V,External
Pinout diagram
This table shows how the pinout on CAN FD 6 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 | VIO SEL | Left | Logic Level Voltage Selection 3V3/5V: Left position 3V3, Right position 5V |
JMPR1 | 3V3 JMP | Unpopulated | 3V3 LDO Jumper |
JMPR2 | 5V JMP | Unpopulated | 5V LDO Jumper |
J1 | BATT | Unpopulated | External Power Supply Header |
J2 | GP | Unpopulated | Configurable GPIO Header |
J3 | CAN | Unpopulated | External CANH/CANL Lines Header |
CAN FD 6 Click electrical specifications
Description | Min | Typ | Max | Unit |
---|---|---|---|---|
Supply Voltage VIO | 3.3 | – | 5 | V |
External Supply Voltage BATT | 6 | – | 24 | V |
Data Rate | – | – | 5 | Mbps |
Operating Temperature Range | -40 | +25 | +125 | °C |
Software Support
We provide a library for the CAN FD 6 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 CAN FD 6 Click driver.
Key functions:
canfd6_cfg_setup
– Config Object Initialization function.canfd6_init
– Initialization function.canfd6_default_cfg
– Click Default Configuration function.
Examples description
The application is composed of three sections :
void application_task ( void ) { #ifdef APP_TRANSMITTER canfd6_mcan_transmit_buffer_contents( &canfd6, CANFD6_FIRST_MSG ); Delay_ms( 1000 ); canfd6_mcan_transmit_buffer_contents( &canfd6, CANFD6_SECOND_MSG ); Delay_ms( 3000 ); #endif #ifdef APP_RECEIVER uint8_t cnt = 0; if ( !canfd6_get_int_pin( &canfd6 ) ) { canfd6_device_interrupts_t canfd6_dev_ir = { 0 }; canfd6_mcan_interrupts_t canfd6_mcan_ir = { 0 }; canfd6_device_read_interrupts( &canfd6, &canfd6_dev_ir ); canfd6_mcan_read_interrupts( &canfd6, &canfd6_mcan_ir ); if ( canfd6_dev_ir.SPIERR ) { canfd6_device_clear_spierr( &canfd6 ); } if ( canfd6_mcan_ir.RF0N ) { canfd6_mcan_rx_header_t canfd6_msg_header = { 0 }; uint8_t num_bytes = 0; uint8_t data_payload[ 64 ] = { 0 }; canfd6_mcan_clear_interrupts( &canfd6, &canfd6_mcan_ir ); num_bytes = canfd6_mcan_read_nextfifo( &canfd6, CANFD6_RXFIFO0, &canfd6_msg_header, data_payload ); log_printf( &logger, "Message received ID[ 0x%X ]: ", canfd6_msg_header.ID ); while ( cnt < 64 ) { if ( data_payload[ cnt ] ) { log_printf( &logger, "%c", data_payload[ cnt ] ); cnt++; } else { log_printf( &logger, "rn" ); cnt = 64; } } } } #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.CANFD6
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. The terminal available in all MikroElektronika compilers, or any other terminal application of your choice, can be used to read the message.
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.