ProSoft PCL-841 Manual

Dual-port can interface card

Advertisement

Quick Links

PCL 841
Dual Port CAN
Interface Card

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the PCL-841 and is the answer not in the manual?

Questions and answers

Summary of Contents for ProSoft PCL-841

  • Page 1 PCL 841 Dual Port CAN Interface Card...
  • Page 2 C o p y r i g h t This documentation is copyrighted 1996 by Advantech Co., Ltd. All rights are reserved. Advantech Co., Ltd. reserves the right to make improvements in the products described in this manual at any time without notice.
  • Page 3: Table Of Contents

    C o n t e n t s Chapter 1 Introduction ................1 Introduction ..................2 Features ..................3 Specifications.................3 Chapter 2 Hardware Installation ............5 Initial inspection ................6 Jumper and switch locations ............7 Card configuration .................8 Chapter 3 Software Programming ............13 Library functions .................14 Example program .................19 Chapter 4...
  • Page 4: Introduction

    I n t r o d u c t i o n Chapter 1 General Information...
  • Page 5: Introduction

    I n t r o d u c t i o n The PCL-841 is a special purpose communication card that brings the Control Area Network to your PC. With the built-in CAN controller, the PCL-841 provides bus arbitration and error detection with automatic transmission repeat function.
  • Page 6: Features

    F e a t u r e s • Operates two separate CAN networks at the same time • High speed transmission up to 1 Mbps • 16 MHz CAN controller frequency • Takes a 4 KB address space, 40 base address adjustable in steps from C800H up to EF00H •...
  • Page 7 PCL 841 User's Manual...
  • Page 8: Hardware Installation

    H a r d w a r e I n s t a l l a t i o n Chapter 2 Hardware Installation...
  • Page 9: Initial Inspection

    It should be free of marks and scratches and in perfect working order upon receipt. As you unpack the PCL-841, check it for signs of shipping damage (damaged box, scratches, dents, etc.). If it is damaged or it fails to meet specifications, notify our service department or your local representative immediately.
  • Page 10: Jumper And Switch Locations

    Jumper and switch locations Port 1 Termination Resistor Port 2 Termination Resistor D I P S W A 1 7 A 1 6 A 1 5 A 1 4 A 1 3 A 1 2 Ports 1 and 2 Memory Port 1 IRQ Select Port 2 IRQ Select Base Address...
  • Page 11: Card Configuration

    Card configuration The PCL-841 has two ports, each with one jumper. The jumpers set the IRQ for the ports, which can be configured separately. A DIP switch sets the memory base address for each port. The following chart shows the function of the jumper and the switch (see the previous page for jumper and switch locations).
  • Page 12 ¡ ¡ Memory base address (SW1) The memory base address for the PCL-841, which requires 4 KB of address space, is made up of the memory segment and its associated offset. The address for the memory segment is set through SW1, a six- position DIP switch.
  • Page 13 Memory address configuration (SW1) cont'd Address/DIP switch A12 D 0 0 0 H o ff D100H D 2 0 0 H o f f o f f D 3 0 0 H o f f o f f o f f D 4 0 0 H o f f of f...
  • Page 14 Memory area Once the memory segment for the base address is selected, the offset will be automatically assigned for Port 1, Port 2, and hardware reset. The following table shows the base addresses of the CAN controllers. Base address (hex) CAN controller base:0000h base:00FFh...
  • Page 15 PCL 841 User's Manual...
  • Page 16: Software Programming

    Software Programming Chapter 3 Software Programming...
  • Page 17: Library Functions

    Library functions Quick reference table The following table lists the available functions and their correspond- ing syntax and descriptions. Library functions Function Syntax (in C) Description canInitHW() Sets IRQs canExitHW() Releases settings canReset() Resets CAN port canConfig() Controls CAN port settings canNormalRun() Sets mode canSendMsg()
  • Page 18 0=fail Example #include "can841.h" main() UI gSegment=0xDA00; BYTE CAN1_IRQ, CAN2_IRQ; CAN1_IRQ=12; CAN2_IRQ=15; if (canInitHW (gSegment, CAN1_IRQ, CAN2_IRQ)==0) printf ("HARDWARE INITIALIZATION ERROR!\n"); Function 2 Releases all settings of the CAN card. Command canExitHW() Argument None Response 1=successful 0=fail Example #include "can841.h" main() if (canExitHW()==0) printf ("CAN RELEASE FAIL!\n");...
  • Page 19 Example #include "can841.h" main() if (canReset (0)==0) printf ("RESET PORT 1 FAIL!\n"); Function 4 Controls the setting of the CAN port's acceptance code, acceptance mask, and bus timing register. Command canConfig (BYTE port, CAN_STRUCT can); Argument BYTE port, CAN_STRUCT can; port= port number (0 or 1) can= CAN struct pointer Response...
  • Page 20 Response 1=successful 0=fail Example #include "can841.h" main() if (canNormalRun(0)==0) printf ("CAN Port 1 can't change to Normal Mode!\n"); Function 6 Tells the CAN port to send a message. Command canSendMsg (BYTE port, MSG_STRUCT send_msg); Argument BYTE port, MSG_STRUCT send_msg; port= port number (0 or 1) send_msg= send buffer pointer Response 1=successful...
  • Page 21 Function 7 Read data from CAN port input buffer. Command int canReceiveMsg (BYTE port, MSG_STRUCT *msg_ptr); Argument BYTE port, MSG_STRUCT *msg_ptr; port= port number (0 or 1) *msg_ptr= input buffer pointer Response 1=message received 0=no message received Example #include "can841.h" main() MSG_STRUCT rmsg2;...
  • Page 22: Example Program

    Example program The following example program, can841.lib, implements the sending and receiving of messages over the CAN controller. The program is written in C. #include “can841.h” /*Library function declaration*/ /* CAN controller interrupt connection */ #define CAN1_IRQ 12 /* 0 means polling */ #define CAN2_IRQ 15 /* 0 means polling */ #define...
  • Page 23 memcpy(&can2, &can1, sizeof(CAN_STRUCT)); if(canConfig(PORT2,can2)==FAIL) clrscr(); cprintf("\n\n CAN Port %d Configuration Error", 2); return; canNormalRun(PORT1); /* Put CAN1 into normal mode. */ canNormalRun(PORT2); /* Put CAN2 into normal mode. */ clrscr(); smsg1.id = 0x015; /* Set ID =8 smsg1.rtr=1; /* Data lengths =8 */ smsg1.dlen=8;...
  • Page 24: Datamonitor Utility

    DataMonitor Utility Chapter 4 DataMonitor Utility...
  • Page 25: Software Overview

    Software overview The PCL-841 comes with a utility disk with the following software capabilities: • CAN controller configuration • CAN transmission monitoring • Terminal emulation Main Menu Run DataMonitor at the DOS prompt. DataMonitor's main menu screen will appear as shown below: The main screen consists of: A.
  • Page 26 C o n f i g u r a t i o n Before you transmit a CAN object, you must configure the CAN controller by selecting the <Config> menu with the cursor keys and pressing <Enter>. The Configuration function determines the ports to be used and their communication parameters.
  • Page 27 The shown acceptance filter will accept every received message. Interrupt: Sets the interrupt for each port. Be sure that this setting matches the IRQ already selected for the PCL-841, which accepts values between IRQ3 to IRQ15, except 8 and 13. Running mode: During the normal configuration and communica- tion process, select Normal Mode.
  • Page 28 Status Fields Status fields at the right of the screen display the status of the two ports: The status fields show information including the Mode (Normal or Reset), Acceptance Code, Acceptance Mask, BTR0, BTR1, Output Control Register, and Status Register. The normal value of the Status Register is: 0 0 0 0 1 1 0 0 Receive Buffer Status...
  • Page 29 To test CAN transmission without actually sending, connect Port 1 to Port 2 on the PCL-841. Select <Terminal> and enter port 1 as trans- mitting port. Port 2 will therefore be designated as receiving port. Note: To send Data Frame (Transmit), enter "0" for RTR. If you want to send Remote Frame (Request), enter "1"...
  • Page 30: Chapter 5 Wiring

    W i r i n g Chapter 5 Wiring...
  • Page 31: Pin Assignments

    assignments The following figure shows the pin assignments for the card's DB-9 connectors. CAN-L 7 CAN-H Termination resistor setup Terminal resistors are factory installed to allow for impedence matching. These resistors can be enabled by utilizing jumpers number 9 and 10 (shown below). Jumper 9 enables the terminal resistor for port one, while jumper number 10 enables the terminal resistor for port two.
  • Page 32: Can Signal Wiring

    CAN signal wiring The CAN standard supports half-duplex communication. This means that just two wires are used to transmit and receive data. D.T.E D.T.E D.T.E Transceiver Transceiver Transceiver CAN-H CAN-H CAN-L CAN-H 120 ohms 120 ohms CAN-L CAN-L CAN wiring topology Wiring connections are as follows: PCL 841 DTE (male DB 9) Terminal...
  • Page 33 PCL 841 User's Manual...
  • Page 34: Appendix A Register Structure

    Register Structure Appendix A Register Structure 31...
  • Page 35: Can Controller Address Allocation

    This appendix gives a brief description of the CAN controller regis- ters. For more detailed information, please refer to the Stand-alone CAN-controller Data Book from Philips Semiconductors Microcon- troller Products. (You may also find the information on the enclosed disk under the "Manual" directory, in the Word 6.0 file: REGISTER.DOC.) CAN controller address allocation Philips PCX82C200 CAN controller...
  • Page 36: Register Address Map

    Register address map TITLE ADDR Control Segment Overrun Error Transmit Receive Control Test Reset Sync Reserve Interrupt Interrupt Interrupt Interrupt Register Mode Request Enable Enable Enable Enable Clear Release Command Goto Abort Transmissio Reserve Reserve Reserve Overrun Receive Register Sleep Transmissio Request Status...
  • Page 37: Register Descriptions

    Register descriptions Control Register (CR) The Control Register is used to change the behavior of the PCX82C200. Control bits may be set or reset by the attatched micro- controller, which uses the Control Register as a read/write memory. Command Register (CMR) A command bit initiates an action within the transfer layer of the PCX82C200.
  • Page 38 Transmit Buffer layout, except that the addresses start at 20 instead of 10. Москва: Телефон: (095) 234 0636 (4 линии) Факс: (095) 234 0640 BBS: (095) 336 2500 Web: http://www.prosoft.ru Appendix A Register Structure 35 E mail: root@prosoftmpc.msk.su Для писем: 117313, Москва, а/я 81 б...

Table of Contents