[其他产品] 游名科技:MCP2518FD PRO:CANFD最高8M用户手册/原理图/参考代...

[复制链接]
58397|577
 楼主| mmuuss586 发表于 2020-1-17 14:46 | 显示全部楼层
ADDITIONAL PINS
Name        I/O        Description
TX_CAN        I        CAN transmit
RX_CAN        O        CAN receive
CANL        I/O        CAN low line
CANH        I/O        CAN high line
 楼主| mmuuss586 发表于 2020-1-17 14:47 | 显示全部楼层
JUMPERS AND SETTINGS








Designator        Name        Default Position        Description
JP1        VIO.SEL.        Left        Logic level voltage selection: left position 3V3, right position 5V
JP2        STBY        Right        Selection of the Standby function: left position - ON, right position - STBY SEL configuration
JP3        STBY SEL        Left        STBY input source selection: left position - STBY pin, right position - mikroBUS™ INT0 pin
JP4        20/40MHz        Right        Clock frequency selection: left position - 20MHz, right position - 40MHz
LEDS AND BUTTONS
 楼主| mmuuss586 发表于 2020-1-17 14:47 | 显示全部楼层
Designator        Name        Type        Description
J1        -        CONNECTOR        DB9 connector for CAN
SOFTWARE SUPPORT
 楼主| mmuuss586 发表于 2020-1-17 14:47 | 显示全部楼层
We provide a library for the MCP2518FD Pro on Microchip page
https://www.microchip.com/develo ... uctDetails/ADM00576
as well as a demo application (example), developed using. The demo can run on all the mainboard.
Library Description
Library offers a choice to exchange messages with the other device by using CAN communication. Library also offers a choice to access a control, status and RAM registers of the device. For more details check documentation.
Link:https://pan.baidu.com/s/1e59FCqLJ5nfmaGpXxILQHg
password:0mv2
 楼主| mmuuss586 发表于 2020-1-17 14:47 | 显示全部楼层
Key functions:
•        void MCP2518FD_transmitMessage( uint8_t numDataBytes, uint8_t *transmitFlag, uint8_t *dataIn ) - Transmits the desired message and checks is message successfully sent.
•        void MCP2518FD_receiveMessage( uint8_t *receiveFlag, uint8_t *dataOut ) - Receives the message and checks is message successfully received.
•        int8_t MCP2518FD_Configure(T_MCP2518FD_id index, T_MCP2518FD_cfg* config) - CAN Control register configuration.
•        int8_t MCP2518FD_ConfigureObjectReset(T_MCP2518FD_cfg* config) - Reset Configure object to reset values.
Examples description
The application is composed of the three sections :
•        System Initialization - Initializes peripherals and pins.
•        Application Initialization - Initializes SPI interface and performs the device configuration to work properly.
•        Application Task - (code snippet) - Always checks is new message in FIFO ready for receiving and when is message ready, receives a message from the other device. Also in this example we can sent the desired message via CAN communication to the other device. We can choose a message to be sent by sending the determined command to the UART. In this example the command, which determines a message, can be number from 1 to 7.
 楼主| mmuuss586 发表于 2020-1-17 14:47 | 显示全部楼层
void applicationTask()
{
    if (UART_Rdy_Ptr())
    {
rxDat = UART_Rd_Ptr();
chPtr = &txd[0];

        switch (rxDat)
        {
            case '1' :
            {
                _strcpy( chPtr, &txtMessage1[0] );
                MCP2518FD_transmitMessage( 5, &checkFlag, &txd[0] );
                if (checkFlag == 1)
                {
mikrobus_logWrite( "Message Sent", _LOG_LINE );
                }
            break;
            }
            case '2' :
            {
                _strcpy( chPtr, &txtMessage2[0] );
                MCP2518FD_transmitMessage( 7, &checkFlag, &txd[0] );
                if (checkFlag == 1)
                {
mikrobus_logWrite( "Message Sent", _LOG_LINE );
                }
            break;
            }
            case '3' :
            {
                _strcpy( chPtr, &txtMessage3[0] );
                MCP2518FD_transmitMessage( 2, &checkFlag, &txd[0] );
                if (checkFlag == 1)
                {
mikrobus_logWrite( "Message Sent", _LOG_LINE );
                }
            break;
            }
            case '4' :
            {
                _strcpy( chPtr, &txtMessage4[0] );
                MCP2518FD_transmitMessage( 4, &checkFlag, &txd[0] );
                if (checkFlag == 1)
                {
mikrobus_logWrite( "Message Sent", _LOG_LINE );
                }
            break;
            }
            case '5' :
            {
                _strcpy( chPtr, &txtMessage5[0] );
                MCP2518FD_transmitMessage( 3, &checkFlag, &txd[0] );
                if (checkFlag == 1)
                {
mikrobus_logWrite( "Message Sent", _LOG_LINE );
                }
            break;
            }
            case '6' :
            {
                _strcpy( chPtr, &txtMessage6[0] );
                MCP2518FD_transmitMessage( 3, &checkFlag, &txd[0] );
                if (checkFlag == 1)
                {
mikrobus_logWrite( "Message Sent", _LOG_LINE );
                }
            break;
            }
            case '7' :
            {
                _strcpy( chPtr, &txtMessage7[0] );
                MCP2518FD_transmitMessage( 7, &checkFlag, &txd[0] );
                if (checkFlag == 1)
                {
mikrobus_logWrite( "Message Sent", _LOG_LINE );
                }
            break;
            }
            default :
            {
            break;
            }
        }
    }

    MCP2518FD_receiveMessage( &checkFlag, &rxd[0] );
    if (checkFlag == 1)
    {
chPtr = &rxd[0];
mikrobus_logWrite( "Received Message : ", _LOG_TEXT );
mikrobus_logWrite( chPtr, _LOG_LINE );
    }
}
 楼主| mmuuss586 发表于 2020-1-17 14:48 | 显示全部楼层
Additional Functions :
•        char * _strcpy( char * _to, char * _from ) - String copy function.
The full application code, and ready to use projects can be found on our LibStock page.
Other mikroE Libraries used in the exampl
 楼主| mmuuss586 发表于 2020-1-17 14:48 | 显示全部楼层
PI
•        UART
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.
 楼主| mmuuss586 发表于 2020-1-17 14:48 | 显示全部楼层
THIRD PARTY SUPPORT
TheMCP2518FDProiscompatible with MCP2518FD Click.
https://www.mikroe.com/mcp2518fd-click
 楼主| mmuuss586 发表于 2020-1-17 14:48 | 显示全部楼层
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.
 楼主| mmuuss586 发表于 2020-1-17 14:50 | 显示全部楼层
For more information about mikroSDK, visit the official page.
RESOURCES
mikroBUS™ Standard specification
LibStock: mikroSDK
Click board catalog
 楼主| mmuuss586 发表于 2020-1-17 14:50 | 显示全部楼层
DOWNLOADS
MCP2518FD Pro example on Libstock
MCP2518FD Pro schematic
MCP2518FD Pro: 2D and 3D files
ATA6560/1 datasheet
MCP2518FD datasheet
https://www.microchip.com/develo ... uctDetails/ADM00576
https://www.microchip.com/design-centers/can

 楼主| mmuuss586 发表于 2020-1-17 14:50 | 显示全部楼层
 楼主| mmuuss586 发表于 2020-1-17 14:50 | 显示全部楼层
玛尼玛尼哄 发表于 2020-1-17 21:21 | 显示全部楼层
这种接口的难搞了
 楼主| mmuuss586 发表于 2020-1-19 11:17 | 显示全部楼层

CANFD不会啊,和CAN用法差不多
 楼主| mmuuss586 发表于 2020-1-19 11:18 | 显示全部楼层
 楼主| mmuuss586 发表于 2020-1-30 13:46 | 显示全部楼层
 楼主| mmuuss586 发表于 2020-2-2 16:33 | 显示全部楼层
 楼主| mmuuss586 发表于 2020-2-5 12:33 | 显示全部楼层
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 在线客服 返回列表 返回顶部