Home
PCM-3680 PC/104 Dual Port CAN Interface Module
Contents
1. CDO0H of on off on on off on 1 5 1 CFOOH off off on on D000H on on on off on Card Configuration D100H of on on off The PCM 3680 has two ports each with one jumper The D200H 9n 9 0 eno jumpers set the IRQ for the ports which can be configured D300H off off on on off separately A DIP switch sets the memory base address for D400H on on off on off on each port The following chart shows the function of the D500H i ff i jumper and the switch see the previous page for jumper 0 2 0 One 8 on and switch locations D600H on o off on off D700H 0 0 off off Switch jumper functions D800H on on on off off on IRQ Setup D900H 0 on on off off JP1 Port 1 DAO0H on on of off on JP2 Port 2 on of off Memory base address on on off off off SW1 Port 1 Port 2 DDOOH on off of off on Detaut seni DEOOH on o off off off on efault Settings d DFOOH off off off off off on Port 1 is set for COM1 IRQ 12 Memory address DA00 0000 E000H on on on on off Port2 is set for IRQ 15 Memory address E100H off on off DA00 0200 E200H on off on off If you need to change these settings see the following E300H off off on off sections Otherwise you can simply install the card Note E400H oie om RO ore fone vati that you will need to disable your CPU card s on
2. 0 Argument BYTE port MSG STRUCT msg ptr port port number 0 or 1 msg ptr input buffer pointer Response 1 message received message received Example stinclude 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 lt rmsg2 dlen i cprintf 2X rmsg2 data i 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 IRO 12 0 means polling define CAN2 IRO 15 0 means polling define PORT1 0 define PORT2 1 define FAIL 0 define SUCCESS 1 void main void Declare the CAN card segment address UI gSegment 0xDA00 CAN_STRUCT canl can2 MSG_STRUCT smsgl smsg2 MSG STRUCT rmsgl rmsg2 UI id if canInitHW gSegment CAN1 IRQ CAN2 IRQ FAIL MESSE TEY cprintf n n Hardware Initializa tion Error return Reset CAN controller canReset PORT1 canReset PORT2 canl acc code 0 canl acc mask 0xff canl bt0 03 baud rate 1Mbps canl bti1 0x1c if canConfig PORT1 1 FAIL elrscr cprintf n n CAN Port d Configuration Error 1 return memcpy amp 2 amp canl sizeof CAN_ST
3. Acce ptance ask AM AM6 AM 5 AMA AM 2 Register Bus TES swo BRP 5 BRP4 BRP 3 LE Bus Timing TSEG2 2 TSEG2 1 TSEG2 0 TSEG1 3 TSEG1 2 5 01 1 TSEG1 0 Co tput Register Connect Map Access ister RX Connect TX Normal RAM Float Output Reserved Reserved Internal Buffer 0 Buffer CPU Internal Conncet Register CPU Bus Transmit Buffer is oa oe or ms ws m ms See ee babe be HN ME RN NN Receive Buffer 0 1 is oa os or os ws m ma ES ID 2 ID 1 ERES DLC 3 DLC 2 DLC 1 DLC 0 eneste zm Oma Dm Daa Daa PCM 3680 User s Manual 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 microcontroller 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 If a read access is performed to this address the byte 11111111 binary is returned Status Register SR The Status Register reflects the status of the PCX82C200 bus controller The Status Register appears to the microcontroller as a read only memory Interrupt Register IR The Interrupt Register allows identification of an interrupt source When one or more of this register s bits are set the INT pin is activated
4. The shown acceptance filter will accept every received message Interrupt Sets the interrupt for eech port Be sure that this setting matches the IRQ alreacy selected for the PCM 3860 which accepts values between IRQ3 to IRQ15 except 8 and 13 Running mode During the normal configuration and communication process select Normal Mode When the system fails you can hit Enter to reset the CAN controller Hit Enter again to return to Normal Mode to further execute your configuration Monitor Select the port to be monitored from the Monitor pull down menu Press to start and stop the monitoring process PCM 3680 User s Manual Monitor Screen 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 in order of appearance Status Fields Status fields at the right of the screen display the status of the two ports 1111111 a 1 11111018 The status fields show information including the Mode Normal or Reset Acceptance Code Acceptance Mask BTRO BTR1 Output Control Register and Status Register The normal value of the Status Register is 00001100 L_ Receive Buffer Status Data Overrun Status Transmit Buffer Access Transmission Complete Status Receive Status Transmit Status Error
5. Request enter 1 for RTR PCM 3680 User s Manual LINEEMEKERKEROKNEN Register Structure Pin Assignments The following figure shows the pin assignments for the card s DB 9 connectors Termination Resistor Setup Termination restistors are factory installed to allow for impedance matching These resistors can be enabled by using jumpers number 5 and 6 shown below Jumper 5 enables the terminal resistor for port 1 while jumper 6 enables the terminal resistor for port 2 The value of the resistor equals the characteristic impedence of the signal wires approximately 120 Q The following figure shows resistor placements Port TR1 enables jumper JP5 and TR2 enables jumper JP6 JP5 1200 TR1 JP6 1200 TR2 CAN termination resistor installation 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 CAN CAN Transceiver Transceiver Wiring topograhpy Wiring connections are as follows PCM 3860 DTE male DB 9 Terminal DTE Pin Signal Signal 7 CAN H CAN H 3 GND GND 2 CAN L CAN L This appendix gives a brief description of the CAN controller registers For more detailed information please refer to the Stand alone CAN controller Data Book from Philips Semiconductors Microcontroller Products You may also find
6. All bits are reset by the PCX82C200 after this register is read by the microcontroller This register appears to the microcontoller as a read only memory Acceptance Code Register ACR The Acceptance Code 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 When a message which passes the acceptance test is received and if there is an empty Receive Buffer then the respective Descriptor and Data Field are sequentially stored in this empty buffer In the case that there is no empty Receive Buffer the Data Overrun bit is set HIGH overrun Acceptance Mask Register AMR 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 correspond ing bits of the acceptance code as relevant or don t care for acceptance filtering Bus Timing Register 0 BTRO The Bus Timing Register 0 defines the values of the Baud Rate Prescaler BRP and the Synchronization Jump Width SJW This register can be accessed read write if the Reset Request bit is set HIGH present Bus Timing Register 1 BTR1 The Bus Timing Register 1 defines the length of the bit period the location of the sample point and the number of samples to be taken at each sample point This register can be accessed read
7. 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 0 Argument BYTE port CAN STRUCT can port port number 0 or 1 can CAN struct pointer Response 1 successful O fail 0 Example include can841 h main CAN_STRUCT can1 can2 cani acc code 0 can1 acc_mask Oxff can1 bt0 0 can1 bt1 0x1c if canConfig 0 can1 0 printf PORT 1 CONFIGURE ERRORI n PCM 3680 User s Manual Function 5 Sets a CAN port to normal mode for normal operation canNormalRun BYTE port BYTE port port port number 0 or 1 Command Argument Response 1 successful O fail Example stinclude can841 h main if canNormalRun 0 2 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 BYTE port MSG STRUCT send msg port port number 0 or 1 send msg send buffer pointer Argument 1 successful O fail Response Example stinclude can841 h main MSG STRUCT smsgt Ul i smsg1 id 0x015 smsg1 rtr 0 smsg1 dlen 8 for i 0 i lt smsg1 dlen i smsqg1 data i i if CanSendMsg 0 smsg1 1 printf TRANSMISSION SUCCESSFULI n Function 7 Read data from CAN port input buffer Command int canReceiveMsg BYTE port MSG STRUCT msg ptr
8. PCM 3680 PC 104 Dual Port CAN Interface Module Jumper Setting The PCM 3680 is a special purpose communication card that brings the Control Area Network to your PC With the built in CAN controller the PCM 3680 provides bus arbitration and error detection with automatic transmission repeat function This drastically avoids data loss and ensures system reliability The on board CAN controllers are located at different positions in the memory You can run both CAN controllers at the same time independently The PCM 3680 operates at baud rates up to 1 Mbps and can be installed directly into the expansion slot of your PC Control Area Network The CAN Control Area Network is a serial bus system especially suited for networking intelligent I O devices as well as sensors and actuators within a machine or plant Characterized by its multi master protocol real time capability error correction high noise immunity and the existence of many different silicon components the CAN serial bus system originally developed by Bosch for use in automobiles is increasingly being used in industrial automation Direct Memory Mapping The PCM 3680 is assigned with memory address which allows direct access to the CAN controller This is the simplest and fastest way of programming any board in a PC because the board is regarded as standard RAM Optical Isolation Protection On board optical isolators protect your PC and equipment against dama
9. RUCT if canConfig PORT2 can2 FAIL clrscr cprintf n n CAN Port d Configuration Brror 2 return canNormalRun PORT1 Put CANI into normal mode canNormalRun PORT2 Put CAN2 into normal mode clrscrt Set ID 8 ep Data lengths 8 smsgl id 0x015 smsgl rtr 1 smsgl dlen 8 for i 0 i smsgl dlen 1 smsgl data i i while 1 canSendMsg PORT1 smsgl Send to CAN1 if canReceiveMsg PORT2 amp rmsg2 1 cprintf PORT2 receive ID 3X RTR 1d Length 1d rmsg2 id rmsg2 rtr rmsg2 dlen PCM 3680 User s Manual for i 0 i rmsg2 dlen cprintf 2X rmsg2 data i printf Nn if kbhit getch break Reset CAN controller canReset PORT1 canReset PORT2 canExitHW clrscr DataMonitor Utility Software Overview The PCM 3680 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 will appear as shown below The main screen consists of A Menu bar Lists the available functions From the main menu you can select Configuration Monitoring and Terminal B Monitor screen Shows monitored data including message index CAN device ID data length and data C Status fields Display the status of the two ports and the
10. Status Bus Status The registers can only be read if the CAN controller is in Normal mode If the CAN controller operates correctly and the transmission has been completed successfully the status register will show as the normal value 00001100 If the Error Status and or the Bus Status is 1 you have selected the wrong baud rate or the CAN cable is damaged Also check the correct bus terminator Terminal This function provides a direct way to 1 Send data over the CAN network 2 Test CAN transmission Select lt Terminal gt from the menu bar for the following screen eum Um ir m Transmitting Data To transmit data the PCM 3680 must be connected to a CAN network with at least one node and the configuration for the card must be complete First select Terminal to edit the data Enter the port the object ID and the data bytes as hexadecimal value Press Enter to begin data transmission If the CAN controller is configured correctly and the transmission has been successfully completed every CAN object will be shown in order of appearance at the left side of the screen Testing Data Transmission To test CAN transmission without actually sending connect Port 1 to Port 2 on the PCM 3680 Select Terminal and enter port 1 as transmitting 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
11. board COM ports if any or set them to alternate addresses IRQs 500H off on off on off E600H on of off on off J umpers and Switches E700H off off off on off Jumpers JP1 and JP2 set the interrupts for Port 1 and Port E800H on on on off on off 2 respectively You can choose any IRQ from 3 to 15 E900H i i except 8 13 and 14 When you choose IRQs make sure 0 OMe 0 9n 10 they are not used for other cards in the system The EA00H on off off off following figures show the card s default settings EBOOH off off on off on off JP1 Port 1 IRQ Default JP2 Port 2 IRQ Default ECOOH on on off off on off o KG m m EDOOH off on off off on off Elo 2 0 EEOOH on off off off on off 6 7 loo EFOOH off off off off on off 9 10 lOO 12 15 OO PCM 3680 User s Manual 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 Basic Port 1 base 0100h base 01FFh HW reset Basic Port 1 base 0200h base 02FFh Basic Port 2 base 0300h base 03FFh HW reset Basic Port 2 base 0400h base 0FFFh Not used Software Programming Quick Reference Table The following table lists the available functions and their correspo
12. ge from ground loops increasing system reliability in harsh environments Specifications Ports 2 controller 82C200 CAN transceiver 82C250 Signal support CAN L CAN H Memory address From C800H to EFOOH IRQ 3 4 5 6 7 9 10 11 12 15 Isolation voltage 1000 V Power consumption 5 V 400 mA typical 950 mA max Connectors Dual DB 9 male connectors Operating temperature 32 to 122 F 0 to 50 C PC 104 form factor 3 6 x 3 8 90 mm x 96 mm Shipping weight 0 9 Ib 0 4 kg Features Operates 2 separate CAN networks at the same time High speed transmission up to 1 Mbps e 16 MHz CAN controller frequency Takes a 4 KB address space 40 base address adjustable in steps from C800H up to EFOOH Optical isolation protection of 1000 V ensures system reliability Wide IRQ selection for each port includes IRQ 3 4 5 6 7 9 10 11 12 15 LED indicates Transmit Receive status on each port Direct memory mapping enables speedy access to the CAN controllers Clibrary and examples included Jumper amp Switch Locations CH 1 CH 1 IRQ 1 2 E ES lo 12 0 1 1 PCM 3680 REV 1 Y o y mh A Jg 2 Y o gt 2 5 h t 2 E 104 and the PC 104 logo are trademarks of the 104 Consor
13. nding syntax and descriptions Library functions Function Syntax in C Description 1 caninitHW Sets IRQs 2 canExitHW Releases settings 3 canReset Resets CAN port 4 canConfig Controls CAN port settings 5 canNormalRun Sets mode 6 canSendMsg Sends message 7 canReceiveMsg Reads data Complete Function Description Function 1 Sets an IRQ number for Port1 and Port 2 lj Command caninitHW UI segment BYTE IRQ1 BYTE IRQ2 UI segment BYTE IRQ1 BYTE IRQ2 segment c000 df00 step 0x100 IRQ1 Port 1 IRQ number 0 polling 3 4 5 6 7 8 9 10 11 12 14 15 IRQ2 Port 2 IRQ number 0 polling 4 5 6 7 8 9 10 11 12 14 15 0 Argument 0 polling 0 Response 1 successful O 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 Function 2 Releases all settings of the CAN card Command canExitHW Argument None 0 Response 1 successful O fail Example stinclude can841 h main if canExitHW 0 printf RELEASE FAIL Function 3 Resets CAN port and flushes the TX RX buffers l Command intcanReset BYTE port 0 Argument BYTE port port port number 0 or 1 j Response 1 successful O fail 0 Example include can841 h main if canReset 0 0 printf RESET PORT 1
14. status register of the CAN controllers D On line help message bar Shows various key commands and states the function of the currently highlighted item Configuration Before you transmit a CAN object you must configure the CAN controller by selecting the lt Config gt menu with the cursor keys and pressing lt Enter gt The Configuration function determines the ports to be used and their communication parameters The port configuration window is shown below S d prr The parameters below need to be configured for each CAN controller Address segment The base address address segment of the PCM 3680 is normally adjusted during the installation process The selection of the address segment needs to be the same as that of the hardware configuration Port Select the port you want to configure Baud rate The baud rate must be coordinated with the CAN network Choose the appropriate one from the list of baud rates Acceptance code Specifies the value of the 8 most significant bits of the identifier ID10 ID 3 Acceptance mask Specifies the bit positions which are relevant for acceptance filtering Note The acceptance code and acceptance mask are configured through eight digits 1 digit per bit using 0 or 1 Value Definition 0 This bit position will accept only a relevant message 1 This bit position will not screen messages Example Acc Code 11111111 Acc Mask 211111111
15. 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 ADDRESS Register address map 0 CONTROL 1 COMMAND 2 STATUS 3 INTERRUPT 4 5 ACCEPTANCE CODE control segment ACCEPTANCE MASK 6 BUS TIMINGO 7 BUS TIMING 1 8 OUTPUT CONTROL 9 TEST 10 IDENTIFIER 11 RTR BIT DATA LENGTH CODE 12 BYTE I 13 BYTE2 14 BYTE3 transmit 15 BYTE 4 data buffer 16 5 field 17 BYTE 18 BYTE 7 19 BYTE8 descriptor IDENTIFIER RTR BIT DATA LENGTH CODE BYTE BYTE2 BYTE3 BYTE4 data BYTES field BYTE6 BYTE 7 BYTE 8 descriptor receive buffers PCM 3680 User s Manual COC e e e Control Segment Overrun Error Transmit Receive ontrol Test Reset Sync Reserved Interrupt Interrupt Interrupt Interrupt Rester o BE ome remna Enable Enable Enable Enable Request Clear Release Command Go to Abort Transmission Status Transmission Transmit Error Transmit Receive Receive 2 Complete Buffer Data Overrun Register EE Status Status Status Status Status Access a Buffer Status Interrupt Acce Code Reg Ou E Overrun Wa Transmit Receive Register Reed Interrupt Interrupt Interrupt ptance AC 7 AC 6 AC 5 Register
16. tium Part no 2000368000 1st Edition Printed in Taiwan May 1996 Initial Inspection In addition to this user s manual your shipping box should contain the following items PCM 3680 Dual port CAN Interface Card C Driver and DataMonitor Utility Diskette WARNING Discharge your body s static electric charge by touching the back of the grounded chassis of the system unit metal before handling the board You Memory Base Address SW1 The memory base address for the PCM 3680 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 You can choose any base address from C800 to EFOO The following table shows the DIP switch settings and the corresponding base addresses Memory address configuration SW1 Address DIP switch 12 A13 14 15 16 17 C800H on on on on on should avoid contact with materials that C900H i hold a static charge such as plastic 0 OMe 2 UR vinyl and styrofoam The board should on o on o on on be handled only by its edges to avoid CBOOH off off on off on on static damage to its integrated circuits Avoid touching the exposed circuit CC00H on off
17. write if the Reset Request bit is set HIGH present Output Control Register OCR The Output Control Register allows under software control the setup of different driver configurations This register may be accessed read write if the Reset Request bit is set HIGH present Test Register TR The Test Register is used only for production testing Transmit Buffer The Transmit Buffer stores a message from the microcon troller to be transmitted by the PCX82C200 It is subdivided into the Descriptor and Data Field The Transmit Buffer can be written to and read from by the microcontroller Receive Buffer The layout of the Receive Buffer and the individual bytes correspond to the definitions given for the Transmit Buffer layout except that the addresses start at 20 instead of 10 PCM 3680 User s Manual 10 PCM 3680 User s Manual
Download Pdf Manuals
Related Search
Related Contents
Sony D-265 User's Manual User Manual T'nB Rubby Soldier`s Manual And Trainer`s Guide, Mos 25c, Radio SIMATIC HMI Panel de operador OP 73, OP 77A 第 13 期 定 時 株 主 総 会 招 集 ご 通 知 Samsung GALAXY S Comfort Open WB 500 Bedienungsanleitung Thermic 10 Copyright © All rights reserved.
Failed to retrieve file