Fortec Star Diamond Systems DS-MPE-CAN2L Manual

Pcie minicardi/o expansion module with dual canbus ports

Advertisement

Quick Links

Advertisement

Table of Contents
loading

Summary of Contents for Fortec Star Diamond Systems DS-MPE-CAN2L

  • Page 2 Manual Diamond Systems DS-MPE-CAN2L PCIe MiniCardI/O Expansion Module with Dual CANbus Ports The information contained in this document has been carefully researched and is, to the best of our knowledge, accurate. However, we assume no liability for any product failures or damages, immediate or consequential, resulting from the use of the information provided herein.
  • Page 3 DS-MPE-CAN2L PCIe MiniCard Dual CAN 2.0 Port Module Rev A.1 April 2015 Revision Date Comment 4/25/2014 Initial release 4/09/2015 Updated Windows installation procedure Copyright 2015 FOR TECHNICAL SUPPORT Diamond Systems Corporation 555 Ellis Street PLEASE CONTACT: Mountain View, CA 94043 USA support@diamondsystems.com Tel 1-650-810-2500 Fax 1-650-810-2525...
  • Page 4: Table Of Contents

    CONTENTS Important Safe Handling Information ......................3 Introduction ...............................4 Description ..............................4 Features .................................4 Operating System Support ..........................4 Mechanical, Electrical, Environmental ......................4 Packing List ...............................4 Functional Overview ............................5 Functional Block Diagram ..........................5 Mechanical Board Drawing ..........................6 CAN Controllers .............................6 Transceivers ..............................7 Isolation .................................7 Power Supply ..............................7 Installation .................................7 Connector Pinout and Pin Description ......................8...
  • Page 5: Important Safe Handling Information

    1. IMPORTANT SAFE HANDLING INFORMATION WARNING! ESD-Sensitive Electronic Equipment Observe ESD-safe handling procedures when working with this product. Always use this product in a properly grounded work area and wear appropriate ESD-preventive clothing and/or accessories. Always store this product in ESD-protective packaging when not in use. Safe Handling Precautions This board contains a high density connector with many connections to sensitive electronic components.
  • Page 6: Introduction

    2. INTRODUCTION 2.1 Description DS-MPE-CAN2L implements a CAN protocol bus controller that performs serial communications according to the CAN 2.0A and CAN 2.0B specifications. The protocol uses a multi-master bus configuration for the transfer of frames between nodes of the network and manages error handling with no burden on the host processor. 2.2 Features 2 CAN 2.0B ports with a 1Mbps data rate and programmable interrupts 31 receive buffers for improved performance...
  • Page 7: Functional Overview

    4. FUNCTIONAL OVERVIEW 4.1 Functional Block Diagram The DS-MPE-CAN2L block diagram is shown below. www.diamondsystems.com DS-MPE-CAN2L User Manual Rev A.1 Page 5...
  • Page 8: Mechanical Board Drawing

    4.2 Mechanical Board Drawing The DS-MPE-CAN2L conforms to the PCIe MiniCard electromechanical specification revision 1.2, full size format. Overall dimensions are 50.95mm L x 30.00mm W. The two mounting holes are isolated from the CPU ground and not connected to any ground lines. 4.3 CAN Controllers The module offers two CAN controllers implemented as FPGA cores inside a Xilinx Spartan 6 FPGA.
  • Page 9: Transceivers

    4.4 Transceivers The transceivers are Analog Devices ADM3053 combination isolation and transceiver. It provides isolated +5V to power the isolated side of the transceiver. This isolated +5V is available on the I/O connector. 4.5 Isolation The module supports 500V isolation between each CAN port and the host, and between each CAN port and the other, via the ADM3053 isolated transceiver.
  • Page 10: Connector Pinout And Pin Description

    6. CONNECTOR PINOUT AND PIN DESCRIPTION 6.1 PCIe MiniCard Edge Connector (J1) The DS-MPE-CAN2L module is compatible with the standard Mini PCIe socket pinout as shown below. WAKE# +3.3VAUX_3 COEX1 GND9 COEX2 +1.5V_1 CLKREQ# UIM_PWR GND1 UIM_DATA REFCLK- UIM_CLK REFCLK+ UIM_RESET GND2 UIM_VPP...
  • Page 11: Jumper Configuration

    7. JUMPER CONFIGURATION The DS-MPE-CAN2L module has two line termination jumper blocks, one for each port. Jumper block J3 is for port J4, and jumper block J6 is for port J7. Jumper blocks J3 and J6 are identical. The default is no jumpers installed.
  • Page 12: Linux Driver Installation

    8. LINUX DRIVER INSTALLATION 8.1 Installing the Software The following steps are used to install the CAN interface utility software under the Linux operating system. Step-1: DSC_CAN2L_PCI_LINUX_V1.7 Download the .zip file from the DS-MPE-CAN2L webpage (http://www.diamondsystems.com/products/dsmpecan2l). Click on Linux driver package v1.0.7 in the Downloads section of the webpage.
  • Page 13: Setting The Baud Rate

    This command will open the CAN interface utility. To start the CAN utility in the future, follow Steps 4 and 5 only. 8.2 Setting the Baud Rate Using the CAN interface utility software, the baud rate for each port can be selected. On the desired CAN port, select the baud rate from the Baud Rate drop-down menu.
  • Page 14: Setting The Can Id And Message Length

    8.3 Setting the CAN ID and Message Length Set the CAN ID and CAN message length for each CAN port by entering the desired numbers into the ID and Len fields respectively for that port. www.diamondsystems.com DS-MPE-CAN2L User Manual Rev A.1 Page 12...
  • Page 15: Writing A Message

    8.4 Writing a Message To write a message on a CAN port, define the CAN message by entering the desired data into the Data (Hex) fields. Then click on “Write Message” as shown in the below figure. To transmit to a different CAN ID, change the data in the CAN ID field, enter the desired data into the Data (Hex) fields, and click on “Write Message”.
  • Page 16: Viewing Messages

    8.5 Viewing Messages Transmitted messages are listed in the CAN message box for the sending CAN port as shown in below figure. www.diamondsystems.com DS-MPE-CAN2L User Manual Rev A.1 Page 14...
  • Page 17 Received CAN messages are listed in the CAN message box for the CAN port receiving the message as shown in below figure. www.diamondsystems.com DS-MPE-CAN2L User Manual Rev A.1 Page 15...
  • Page 18: Configure And Manage The Ports In Linux

    9. CONFIGURE AND MANAGE THE PORTS IN LINUX The CANLib library provides the set of APIs to configure and manage the CAN ports. The CANLib library can be used to build the CAN user application. It is a shared library built on top of Linux platform and using the driver provided functionality.
  • Page 19 Baud Rate Configuration set_baudrate() : This function configures the baud rate for the specified CAN port. By default it will not configure any baud rate. Below code snippet describes the usage of setting baud rate to 500kbps. // Set 500k Baud rate for CAN#0 ret_val = set_baudrate(can0_fd, CAN_SPEED_500K ) ;...
  • Page 20 CAN Transmit Prototype int can_tx( int can_fd, unsigned char msgType, unsigned int can_id, int len,unsigned char *data) ; Assign the appropriate values, before calling the can_tx function. can0_fd: CAN descriptor, return value from init_can0() function msgType = MSG_STANDARD ; // or MSG_EXTENDED.
  • Page 21: Compiling User Application Using Canlib Library

    CAN Receive Prototype int can_rx(int can_fd, unsigned char *msgType, unsigned char *rx_data, unsigned int *can_id, unsigned char *can_msg_len) ; Pass the appropriate pointers for calling the can_rx function: if ( can_rx(can0_fd, &msgType, data, &can_id, &dlc) ) If (msgType == MSG_STANDARD ) // Received message is CAN Standard Message.
  • Page 22: Driver Installation And Demo Application For Windows

    10. DRIVER INSTALLATION AND DEMO APPLICATION FOR WINDOWS Download the DSC_CAN2_PCI_WIN_V1.0.3.zip file from the DS-MPE-CAN2L webpage (http://www.diamondsystems.com/products/dsmpecan2l). Click on Windows driver package v1.0.3 in the Downloads section of the webpage. Use the following command to unzip the files: Unzip DSC_CAN2L_PCI_WIN_V1.0.3.zip The “DSC_CAN2_PCI_WIN_V1.0.3”...
  • Page 23 Step-2: Change the working directory from the command prompt to the “DSC_CAN2_PCI_WIN_V1.0.3\ dsc_can2_pci_driver” directory where the software is copied. Step-3: Execute “install.bat”. Please see the below screenshot for details. After executing, follow the next steps to install the driver. Step-4: Restart the system.
  • Page 24 Step-5: Check whether the driver is installed properly or not by opening the device manager. Right Click on My Computer => Click on Properties => Device Manager. Please refer to the screenshot below. www.diamondsystems.com DS-MPE-CAN2L User Manual Rev A.1 Page 22...
  • Page 25 If the driver is installed properly then the device manager will show the device as “PCIe Sample device” under “Sample Device” as shown in the screenshot below. www.diamondsystems.com DS-MPE-CAN2L User Manual Rev A.1 Page 23...
  • Page 26: Run The Windows Application

    10.2 Run the Windows Application The application is stored in the “App” directory. Double click on “dsc_can2_pci.exe”. The application window will open as shown in the below screenshot. www.diamondsystems.com DS-MPE-CAN2L User Manual Rev A.1 Page 24...
  • Page 27: Setting The Baud Rate

    10.3 Setting the Baud Rate Using the CAN interface utility software, the baud rate for each port can be selected. On the desired CAN port, select the baud rate from the Baud Rate drop-down menu. After selecting the desired baud rate, press “Connect” to connect with specified baud rate as shown in below figure.
  • Page 28: Setting The Can Id And Message Length

    10.4 Setting the CAN ID and Message Length Set the CAN ID and CAN message length for each CAN port by entering the desired numbers into the ID and Len fields respectively for that port. www.diamondsystems.com DS-MPE-CAN2L User Manual Rev A.1 Page 26...
  • Page 29: Writing A Message

    10.5 Writing a Message To write a message on a CAN port, define the CAN message by entering the desired data into the Data (Hex) fields. Then click on “Write Message” as shown in the below figure. To transmit a different CAN ID, change data in the CAN ID field, enter the desired data into the Data (Hex) fields, and click on “Write Message”.
  • Page 30: Viewing Messages

    10.6 Viewing Messages Transmitted and received messages are listed in the CAN message box for the sending CAN port as shown in below figure. www.diamondsystems.com DS-MPE-CAN2L User Manual Rev A.1 Page 28...
  • Page 31: Api To Configure And Manage Can Ports On Windows

    11. API TO CONFIGURE AND MANAGE CAN PORTS ON WINDOWS The source code for all windows user APIs to configure and manage the CAN ports are stored in “dsc_can2_pci_src“ directory. User can include following files into their project directory. These API are dependent on CAN dll.
  • Page 32 The APIs are dependent on lib and dll. User has include the below APIs into their project. dscud.dll dscud.lib Project Settings -> Configuration Properties -> Linker -> Input -> Modify Additional Dependecies : dscud.lib;setupapi.lib;%(AdditionalDependencies) Opening the CAN device OpenDevice(&GUID_DEVINTERFACE_FP_GPIO96, FILE_FLAG_OVERLAPPED ); This function should be called only once during initiation.
  • Page 33 can_init (1); // Will initialize CAN#1 channel Baud rate configuration. set_baudrate(int can_ch, int baud rate): This API accepts the CAN interface number and the baudrate as arguments for configuring the baud rate of the specified CAN port. // Set 500k Baud rate for CAN#0, Corresponding CAN channel values should be passed. ret_val = set_baudrate(0, CAN_SPEED_500K) ;...
  • Page 34 The above sample code will transmit the CAN Standard message with CAN ID=0x12 of data length=4 and message data = {0x1A, 0xAB, 0x22, 0x4D} ; CAN Receive Prototype. int check_rx_msg( int can_ch, unsigned char *msgType, unsigned char *rx_data, unsigned int *can_id, unsigned char *can_msg_len);...
  • Page 35: Specifications

    12. SPECIFICATIONS Number of ports 2 CAN 2.0B Data rate 1Mbps Number of receive buffers 1 high priority Number of transmit buffers 16 standard priority Acceptance filters 16 programmable, 29-bit Identifiers 11-bit and 29-bit Modes Dual-independent Dual-redundant Isolation 500V port-to-port and input-to-output Input power +3.3VDC +/-5% Power consumption...
  • Page 36 Our company network supports you worldwide with offices in Germany, Austria, Switzerland, the UK and the USA. For more information please contact: Headquarters Germany FORTEC Elektronik AG Augsburger Str. 2b 82110 Germering Phone: +49 89 894450-0 E-Mail: info@fortecag.de Internet: www.fortecag.de Fortec Group Members Distec GmbH Office Vienna Austria...

Table of Contents