Advertisement

Introduction ........................................................................... 1
Introduction .......................................................................................... 2
Features ................................................................................................ 3
Specifications ....................................................................................... 3

Hardware Installation ........................................................... 5

Initial inspection ................................................................................... 6
Jumper and switch locations ................................................................ 7
Card configuration ................................................................................ 8
Software Programming ....................................................... 13
Library functions ................................................................................ 14
Example program ................................................................................. 19
DataMonitor Utility ............................................................ 21
Software overview .............................................................................. 22
Main Menu ......................................................................................... 22
Wiring .................................................................................. 27
Pin assignments .................................................................................. 28
CAN signal wiring .............................................................................. 29
Register structure ............................................................... 31
CAN controller address allocation ..................................................... 32
Register address map .......................................................................... 33
Register descriptions .......................................................................... 34

Advertisement

Table of Contents
loading
Need help?

Need help?

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

Questions and answers

Summary of Contents for Advantech PCL-841 Series

  • Page 1: Hardware Installation

    Introduction ................1 Introduction ..................2 Features ....................3 Specifications ..................3 Hardware Installation ............5 Initial inspection ................... 6 Jumper and switch locations ..............7 Card configuration ................8 Software Programming ............13 Library functions ................14 Example program ................. 19 DataMonitor Utility ............
  • Page 3 CAN controller. This is the simplest and fastest way of programming any board in a PC because the board is regarded as standard RAM. On-board optical isolators protect your PC and equipment against damage from ground ioops, increasing system reliability in harsh environments. PCL-841 Series User's Manual...
  • Page 4 • Operates two separate CAN networks at the same time • High speed transmission up to I Mbps • 16 MHz CAN controller frequency • Takes a 4 KB address space, 40 base address adjustable in steps from C800H up to EFOOH •...
  • Page 5 PCL-841 Series User's Manual...
  • Page 7: Specifications

    At the very least, touch the back of the grounded chassis of the system unit (metal) before you handle the board. Avoid contact with materials that hold a static charge, such as styrofoam. Do not touch the exposed circuit connectors. PCL-841 Series User's Manual...
  • Page 8: Hardware Installation

    Chapter 2 Hardware Installation...
  • Page 9: Jumper And Switch Locations

    If you need to change these settings, see the following sections. Otherwise, you can simply install the card. Note that you will need to disable your CPU card’s on-board COM ports, if any, or set them to alternate addresses/IRQs. PCL-841 Series User's Manual...
  • Page 10 Jumpers JPI and JP2 set the interrupts for Port I and Port 2, respec- tively. You can choose any IRQ from 3 to 15, except 8, 13 and 14. When you choose IRQs, make sure they are not used for other cards in the system.
  • Page 11 Mennory address configUration (SW1) cont'd Address/DIP switch DOOOH D100H D200H D300H D400H DSOOH D600H D700H D800H D9OOH DAOOH DBOOH DCOOH DDOOH DEOOH DFOOH EOOOH E100H E200H E300H E400H ESOOH E600H E700H E800H E9OOH EAOOH EBOOH ECOOH EDOOH EEOOH EFOOH PCL-841 Series User's Manual...
  • Page 12 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 Basic- Port 1 base:0100h - base:01FFh...
  • Page 13 PCL-841 Series User's Manual...
  • Page 15 3, 4, 5, 6, 7, 8, 9, 10, 1 1, 12, 14, 15 IRQ2=Port 2 IRQ number 0 (polling), 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 14, 15 0: polling Response l=successful 0=fail PCL-841 Series User's Manual...
  • Page 16: Software Programming

    Example #include "can841.h" main() Ul gSegment=0xDA00; BYTE CANl_IRQ, CAN2 IRQ; CANI_IRQ=12; CAN2_IRQ= 15; if (canluitHW (gSegment, CANI_IRQ, CAN2_IRQ)==0) printf ("HARDWARE INITIALIZATION ERROR!\n"); Releases all seuings of the CAN card. Command canExitHW() Argument None Response l=successful 0=fail Example #include "can84 1.h" main() if (canExitHW()==0) printf (“CAN RELEASE FAIL!\n”);...
  • Page 17 1.bt I =0x 1 c; if (canConfig(0,canl)==0) printf ("CAN PORT I CONFIGURE ERROR!\n"); Sets a CAN port to normal mode for normal operation. Command canNormalRun (BYTE port); Argument BYTE port; port= port number (0 or 1) PCL-841 Series User's Manual...
  • Page 18 Response l=successful 0=fail Example #include "can84 1.h" main() if (canNormalRun(0)==0) printf ("CAN Port I can’t change to Normal Mode!\n"); 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 (O or 1) send msg= send buffer pointer Response l=successful...
  • Page 19 (O or 1) *msg_ptr= input buffer pointer Response l=message received 0=no message received Example #include "can841.h" main() MSG_STRUCT rmsg2; if(canReceiveMSG, *rmsg2)==1) printf ("Port2 receive: ID=%3X RTR=%ld Length=%ld”, rmsg2.id rmsg2.rtr, rmsg2.dlen); for (i=0; i<rmsg2.dlen; i++) cprintf (" %2X", rmsg2.data[i]); PCL-841 Series User's Manual...
  • Page 20: Library Functions

    The following example program, can84 I.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 PORT1 0 #define PORT2 1...
  • Page 21 /* Send to CAN1 */ if(canReceiveMsg(PORT2, &rmsg2)==1) cprintf("PORT2 receive:ID=%3X RTR=%ld Length=%ld", rmsg2.id,rmsg2.rtr, rmsg2.dlen); for(i=0; i< rmsg2.dlen; i++) cprintf(" %2X",rmsg2.data[il); printf("\n"); if (kbLit()) getch(); break; /* Reset CAN controller. */ canReset(PORTl); canReset(PORT2); canExitHW(); clrscr(); PCL-841 Series User's Manual...
  • Page 23 CAN device ID, data length, and data. C. Status fields: Display the status of the two ports and the stanus register of the CAN controllers. D. On-line help/message bar: Shows various key commands and states the function of the currently highlighted item. PCL-841 Series User's Manual...
  • Page 24: Datamonitor Utility

    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. The port configuration window is shown below. The parameters below need to be configured for each CAN controller: Address segment: The base address (address segment) of the PCL-...
  • Page 25: Main Menu

    The monitored data for a selected port appears in the monitor screen (see area B in the diagram under Main Menu section.) If the CAN controller is configured correctly and the transmission has been successfully completed, every CAN object will be shown inorder of appearance. PCL-841 Series User's Manual...
  • Page 26 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, BTRI, 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 27 Port 2 on the PCL-841. Select <Terminal> and enter port I as trans mitting port. Port 2 will therefore be designated as receiving port. Note: To send Data Frame (Transmit), enter “O” for RTR. If you want to send Remote Frame (Request), enter "1" for RTR. PCL-841 Series User's Manual...
  • Page 29 10 enables the terminal resistor for port two. The value of the resistor should equal the characteristic impedance of the signal wires (approximately 120 Q). The following figure shows resistor placements. PCL-841 Series User's Manual...
  • Page 30: Wiring

    The CAN standard supports half-duplex communication. This means that just two wires are used to transmit and receive data. Wiring connections are as follows: PCL-841 DTE (male DB=9) Terminal DTE Signal Signal CAN-H CAN-H CAN-L CAN-L Chapter 5 Wiring...
  • Page 31 PCL-841 Series User's Manual...
  • Page 33 For more detailed information, please refer to the Stand-alone C~4N-eontmller 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.) PCL-841 Series User's Manual...
  • Page 34: Register Structure

    TITLE ADDR Control Segment Appendix A Register structure...
  • Page 35 Receive Buffer, then the respective Descriptor and Data Field are sequentially stored in ~1:} this empty buffer. In the case that there is no empty Receive Buffer, the Data Overrun bit is set HIGH (overrun). PCL-841 Series User's Manual...
  • Page 36 The Acceptance Mask Register is part of the acceptance filter of the PCX82C200. This register can be accessed (read write) if the Reset Request bit is set HIGH (present). The Acceptance Mask Register classifies the corresponding bits of the acceptance code as “relevant” or “don’t care”...
  • Page 37 PCL-841 Series User's Manual...

Table of Contents