We strongly encourage users to use Package manager for sharing their code on Libstock website, because it boosts your efficiency and leaves the end user with no room for error. [more info]
Rating:
Author: MIKROE
Last Updated: 2020-01-24
Package Version: 1.0.0.0
mikroSDK Library: 1.0.0.0
Category: CAN
Downloaded: 3990 times
Not followed.
License: MIT license
CAN FD Click is a transceiver designed for HS CAN networks up to 5 Mbit/s in automotive and industrial applications. As an interface between the physical bus layer and the CAN protocol controller, the TLE9252V drives the signals to the bus and protects the microcontroller against interferences generated within the network.
Do you want to subscribe in order to receive notifications regarding "CAN FD click" changes.
Do you want to unsubscribe in order to stop receiving notifications regarding "CAN FD click" changes.
Do you want to report abuse regarding "CAN FD click".
Library Description
The library covers all the necessary functions to control CAN FD click board. Library performs a standard UART communication.
Key functions:
canfd_byte_ready( )
- Write Single Byteuint8_t canfd_read_byte( )
- Read Single Byte.void canfd_set_operating_mode ( uint8_t op_mode )
- Set operating mode function.Examples description
The application is composed of three sections :
void application_task ( )
{
char tmp;
uint8_t drdy_flag;
if ( app_mode == APP_MODE_RECEIVER )
{
// RECEIVER - UART polling
drdy_flag = canfd_byte_ready( );
if ( 1 == drdy_flag )
{
tmp = canfd_read_byte( );
mikrobus_logWrite( &tmp, _LOG_BYTE );
}
}
else
{
// TRANSMITER - TX each 2 sec
mikrobus_logWrite( " TX data: ", _LOG_TEXT );
Delay_ms( 1000 );
for ( tmp = 0; tmp < 9; tmp++ )
{
canfd_write_byte( demo_message_data[ tmp ] );
mikrobus_logWrite( &demo_message_data[ tmp ], _LOG_BYTE );
Delay_ms( 200 );
}
mikrobus_logWrite( "------------------", _LOG_LINE );
Delay_ms( 2000 );
}
}
Other mikroE Libraries used in the example:
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.