Home
ECAN527HR Isolated 1 Mb/s CAN interface board User`s Manual
Contents
1. na eget NER Ed 7 PHYSICAL INTERFACE 5 eere Dot delti 7 MECHANICAL DESCRIPTION need 8 CONNECTOR DESCRIPTION naiera oreet VA n Roe dna repete eren dei 8 AVHAT COMES WITH EX e Y egest dna 8 BOARD ACCESSORIES 2 die e e aie e e A eei c e OI Fea uei te dij va RA 8 USING THIS MANUAL eds etes o arto dod dives itte ie e o gx P Ee E 9 WHEN YOU NEED iiec oA Re aite oie desee e sre i to Ia eiut AE di 9 BOARD SETTINGS cete eteounedetos am e eite ee T iae iei ee dudes 9 BASE ADDRESS JUMPERS FACTORY SETTING DOOOOH aanne nennen nnne enne nennen enne 11 CHAPTER 2 BOARD INSTALLATION neenvenvenveonenneencenvenvennennennennennenneenvenvenvennennennenneeneeneenvenvensennensenneen 15 BOARD INSTALLATION fe e o PERRO RUE ROREM I CN es 15 General installation guidelines i iecit eto ite ee e ere 15 Installation integrated with a PC 104 module stack 15 30 rack installation with a EUROCARD CPU containing one ECANS27 essere 16 EXTERNAL I O CONNECTIONS eee reet EGER Pr OU Ee n n P te reet EES a 17 General purpose digital UO vs 5 a teet eet eate detect eme
2. P2 6 P2 7 LED2 CLK DATA DIO3 DIO4 DIOS DIO6 Table 5 Digital I O configuration of port P2 of the 82527 chip ECANS27 User s Manual 23 BDM 610020019 rev C Chapter 4 BOARD OPERATION AND PROGRAMMING This chapter shows you how to program and use your ECAN527HR It provides a complete detailed description of the memory map and a detailed discussion of programming operations to aid you in programming The full functionality of the ECAN527HR is described in the datasheet reprint from Intel on the 82527 CAN controller chip Defining the Memory Map The memory map of the ECAN527HR occupies 256 bytes of host PC low memory space This window is freely selectable by the user as described in Chapter 1 table 2 After setting the base address you have access to the internal resources of the 82527 CAN controller chip as is described in the next sections reprinted from the Intel 82527 manual Bit timing registers These are the recommended bit timing register values for reliable communication at IMBps for 500Kbps change BIT TIMO to 01h BIT TIMO 00h BIT TIMI C6h For more information on these and other control registers of the CAN controller chip please refer to the component specific datasheet reprinted from Intel attached Interrupts What is an interrupt An interrupt is an event that causes the processor in your computer to temporarily halt its current process and execute another routine Upon completion of the new routi
3. 10 9 B 890000000006 Fig 2 Base address jumpers illustrating D8000h base address Interrupt Channel Factory setting IRQ 5 The header connector shown in Figure 3 lets you connect the onboard 82527 CAN controller interrupt output to one of the interrupt channels available on the host XT AT bus If your board has no AT bus extension interrupts 10 15 are not available VDS Fb B 432 Fig Interrupt jumpers set to IRQ 5 DHI Note Interrupt sharing is not supported on the current ECAN527 hardware revisions ECANS27 User s Manual 13 BDM 610020019 rev C ECANS27 User s Manual 14 BDM 610020019 rev C Chapter 2 BOARD INSTALLATION The ECAN527HR CAN bus interface board is very easy to connect to your industrial distributed control system Direct interface to PC 104 systems as well as EUROCARD boards is achieved This chapter tells you step by step how to install the ECAN527HR into your system After completing the installation use the diagnostic and test software to fully verify that your board is working The latest versions of the test software as well drivers are available on our website at lt www rtd com gt Board Installation Keep your board in its antistatic bag until you are ready to install it to your system When removing it from the bag hold the board at the edges and do not touch the components or connectors Please handle the board in an antistatic environment and use a grounded workbench for testing and handling
4. main program check for the flag Note If you choose to write your ISR in in line Assembly you must push and pop registers correctly and exit the routine with the IRET instruction instead of the RET instruction There are a few precautions you must consider when writing ISRs The most important is do not use any DOS functions or functions that call DOS functions from an interrupt routine DOS is not reentrant that is a DOS function cannot call itself In typical programming this will not happen because of the way DOS is written But what about using interrupts Then you could have the situation such as this in your program If DOS function X is being executed when an interrupt occurs and the interrupt routine makes a call to the DOS function X then function X is essentially being called while active Such cases will cause the computer to crash DOS does not support such operation A general rule is that do not call any functions that use the screen read keyboard input and any file I O routines should not be used in ISRs The same problem of reentrancy exists for many floating point emulators as well meaning you should avoid floating point mathematical operations in your ISR Note that the problem of reentrancy exists no matter what programming language you use Even if you are writing your ISR in Assembly language DOS and many floating point emulators are not reentrant Of course there are ways to avoid this problem such as those
5. the startup IMR saved and the interrupts temporarily disabled you can assign the interrupt vector to point to your ISR Again you can overwrite the appropriate entry in the vector table with a direct memory write but this is not recommended Instead use the DOS function 25h Set Interrupt Vector or if your compiler provides it the library routine for setting up interrupt vectors Remember that interrupt vector 8 corresponds to IRQO vector 9 for etc If you need to program the source of your interrupts do that next For example if you are using transmitted or received messages as an interrupt source program it to do that Finally clear the mask bit for your IRQ in the IMR This will enable your IRQ Common Interrupt mistakes e Remember hardware interrupts are from 0 15 Forgetting to clear the IRQ mask bit in the IMR Forgetting to send the EOI command after ISR code Disables further interrupts ECAN527 User s Manual 28 BDM 610020019 rev C Example on Interrupt vector table setup in C code void far interrupt new IRO1 handler void ISR function prototype define IRO1 VECTOR 3 Name for IRQ void interrupt far old_IRQ1_dispatcher es ds di si bp sp 1 Variable to store old IRQ Vector void far interrupt new IRO1 handler void Function init handlers Inputs Nothing Returns Nothing Purpose Set th
6. 17 Galvanically isolated CAN bus connector eese eene nennen nne nnnm eren nennen enne nnne enne 18 CHAPTER 3 HARDWARE DESCRIPTION nnenseavenneoneoneoncenvensenrennennennenneenvenvenvennennennennenneenvenvensennensenneen 20 Galva nicasolation of the CAN DUS bee ete eye eee e e a bl eei 22 Fiber opileiinterfdce uu sente v eit de vent iier e eria BEREDTE e ee tee e etn 22 Configuration EEPROM e i ee aate venie tite mide es 23 Digital VO iss et st e e te aa e pe t e m ie t een e e 23 CHAPTER 4 BOARD OPERATION AND 2 02 0 44040 801866 060 0000800 0 0 0 0 0 00 000 024 24 DEFINING THE MEMORY MAP PEU e FOE Yee epe eres ore parre e eee ee a vete pa rhe Fine eee vk 24 Bit timing registers S 24 INTERRUPTS visi sev ER 24 Whatis an interrupt inui cuisse etate neske esin ee tege dee Meee 24 Interrupt request les ena E A aaa 24 6259 Programmable Interrupt Controller nena 25 Interrupt Mask Register IMRB J s eet E R t Eee PAS PR co 25 End of Interrupt EOI Command ii eiie e e E t Sunes Ee AERE RENE EHE SNR 25 What exactly happens when an interrupt 25 Using Interrupt in VOUP PTORTOMN t Rei eh A NA rer ere EE TA EM 26 Writing an Interrup
7. 27 The PC 104 system can easily be inserted into a 19 rack installation using the CPU as a form factor adapter Assemble your PC 104 data modules on a RTD single board computer and install the system in a 19 enclosure Multiple ECAN527HR boards can easily be connected to this system See figure 5 below Fig 5 19 Eurocard rack installation with an integrated PC 104 dataModule and EUROCARD cpuModule computer system ECANS27 User s Manual 16 BDM 610020019 rev C External I O connections General purpose digital I O Table 2 1 shows the connector layout of the ECAN527HR digital I O connector J28 This connector is located toward the left side of the board Refer to this diagram when making signal connections Pin Number Function 1 1 LEDI 2 I O 2 LED2 3 EEPROM clk 4 EPROM data 5 IO 3 6 I O 4 7 IO 5 8 I 6 9 45V 10 GND Table 3 Digital I O connector of the ECAN527HR Note I O signals 3 and 4 are reserved for the use of the non volatile EEPROM In this case these pins are not available for user I O ECANS27 User s Manual 17 BDM 610020019 rev C Galvanically isolated CAN bus connector Table 4 shows the CAN physical interface connector This connector is used to route the CAN bus through your 527 board It is located at the top of your board This connector conforms to the ISO11898 specification Pin Number Function 1 ISO GND 3 BUS L BUS H 5 ISO GND _ NC 7 NC ISO45V Table 4 Ph
8. CLAIMS ALL WARRANTIES NOT STATED HEREIN ALL IMPLIED WARRANTIES INCLUDING IMPLIED WARRANTIES FOR MECHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE LIMITED TO THE DURATION OF THIS WARRANTY IN THE EVENT THE PRODUCT IS NOT FREE FROM DEFECTS AS WARRANTED ABOVE THE PURCHASER S SOLE REMEDY SHALL BE REPAIR OR REPLACEMENT AS PROVIDED ABOVE UNDER NO CIRCUMSTANCES WILL RTD Embedded Technologies BE LIABLE TO THE PURCHASER OR ANY USER FOR ANY DAMAGES INCLUDING ANY INCIDENTAL OR CONSEQUENTIAL DAMAGES EXPENSES LOST PROFITS LOST SAVINGS OR OTHER DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PRODUCT SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR CONSUMER PRODUCTS AND SOME STATES DO NOT ALLOW LIMITATIONS ON HOW LONG AN IMPLIED WARRANTY LASTS SO THE ABOVE LIMITATIONS OR EXCLUSIONS MAY NOT APPLY TO YOU THIS WARRANTY GIVES YOU SPECIFIC LEGAL RIGHTS AND YOU MAY ALSO HAVE OTHER RIGHTS WHICH VARY FROM STATE TO STATE ECANS27 User s Manual 33 BDM 610020019 rev C
9. ECAN527HR Isolated 1 Mb s CAN interface board User s Manual RTD Embedded Technologies Inc Real Time Devices Accessing the Analog World amp ISO9001 and AS9100 Certified BDM 610020019 ECANS527HR ISOLATED 1 MB S CAN INTERFACE BOARD USER S MANUAL RTD Embedded Technologies Inc 103 Innovation Blvd State College PA 16803 0906 Phone 1 814 234 8087 FAX 1 814 234 5218 E mail sales rtd com techsupport rtd com Web site http www rtd com Revision History Rev A New Manual Naming Method Rev Added 8 16 MHz clock jumper Rev 05 04 2007 Clarified information about QNX support Removed some remaining references to RTDFinland Corrected some grammar and formatting issues Published by RTD Embedded Technologies Inc 103 Innovation Blvd State College PA 16803 0906 Copyright 1999 2007 by RTD Embedded Technologies Inc All rights reserved The RTD Logo is a registered trademark of RTD Embedded Technologies cpuModule and utilityModule are trademarks of RTD Embedded Technologies PC 104 is a registered trademark of PC 104 Consortium All other trademarks appearing in this document are the property of their respective owners TABLE OF CONTENTS CHAPTER INTRODUCTION 7 FEATURES OF 27 nente tret Spese tiir Res toni jal Red 7 CAN BUS CONTROLLER t eroe dys EO Da
10. Service Routine ISR The first step in adding interrupts to your software is to write an interrupt service routine ISR This is the routine that will be executed automatically each time an interrupt request occurs for the specified IRQ An ISR is different from other subroutines or procedures First the processor registers must be pushed onto the stack Second just before exiting the routine you must clear the interrupt on the ECAN527HR by writing to the 82527 CAN controller and write the EOI command to the interrupt controller Finally when exiting the interrupt routine the processor registers must be popped from the system stack and you must execute the IRET assembly instruction This instruction pops the CS IP and processor flags from the system stack These were pushed onto the stack when entering the ISR Most compilers allow you to identify a function as an interrupt type and will automatically add these instructions to your ISR with one exception most compilers do not automatically add the EOI command to the function you must do it yourself Other than this and a few exceptions discussed below you can write your ISR as any code routine It can call other functions and procedures in your program and it can access global data If you are writing your first ISR we recommend you stick to the basics just something that enables you to verify you have entered the ISR and executed it successfully For example set a flag in your ISR and in your
11. ccesecececececececeeececececececcceseseseseeeeeseseeesees 16 FIG 5 19 EUROCARD RACK INSTALLATION WITH AN INTEGRATED PC 104 DATAMODULE AND EUROCARD PUMODULE COMPUTER SYSTEM anne SDSS eek e re DASS e bean e xb dues sea supe bee 16 FIG GECAN52 7HR BLOCK DIAGRAM IE 20 FIG 7 CAN BUS PHYSICAL INTERFACE CIRCUITRY POWER SUPPLY OMITTED FOR CLARITY ene 22 TABLES TABLE 1 FACTORY CONFIGURED JUMPER SETTINGS SEE FIGURE 1 1 FOR DETAILED LOCATIONS 10 TABLE 2 BASE ADDRESS JUMPER 5 5 12 TABLE 3 DIGITAL I O CONNECTOR OF THE 527 17 TABLE 4 PHYSICAL INTERFACE CONNECTOR PIN OUTS OF THE ECAN527HR ccccccccecccecccecececececececeeesecececeseeeseeeeesess 18 TABLE 5 DIGITAL I O CONFIGURATION OF PORT P2 OF THE 82527 2 23 Chapter 1 INTRODUCTION This user s manual describes the operation of the ECAN527HR CAN bus interface board Features of the ECAN527HR include 1 Mb s maximum data rate fully programmable Full CAN functionality 2 0 B Intel 82527 CAN bus controller 8 MHz or 16 MHz operation 256 bytes of configuration EEPROM Galvanically isolated physical interface with CAN transceiver Optional fiber optic transmitter and receiver for noisy environments 6 user accessible bit programmable bidirectional digital I O 2 status LED s 5V only operation PC 104 compliant The following paragraphs briefly describe the major feat
12. ceived ECANS27 User s Manual 21 BDM 610020019 rev C Galvanic isolation of the CAN bus The galvanic isolation of the ECAN527HR is implemented using 1 Optocouplers for data transmission and 2 a DC DC converter to supply power to the CAN bus and the physical interface circuitry The high speed optocouplers are directly connected to the 82527 The optocouplers drive the CAN bus transceiver A special balanced CAN bus choke is used not only to improve immunity to bus noise but also to protect the bus transceiver This filter assists in conforming to the EN55022 Radiated Emission test requirements 1 Watt DC DC converter may be used to power other remote devices on the CAN bus The output power of this converter is isolated up to 1 5 kV peak Figure 7 illustrates the physical interface circuitry of the galvanically isolated CAN bus TAN_TED O Toa ELTIJE fra HEKULICHI Fig 7 CAN bus physical interface circuitry power supply omitted for clarity Fiber optic interface An optional fiber optic interface can be used to implement point to point communication using the CAN protocol Due to the physics of the fiber optic media bitwise arbitration featured by the CAN protocol can not be supported The fiber optic interface may be used in environments where either immunity to long distances or excessive noise is a design criterion It is possible to combine wire and fiber optic connections in the same network usin
13. d Warranty RTD Embedded Technologies Inc warrants the hardware and software products it manufactures and produces to be free from defects in materials and workmanship for one year following the date of shipment from RTD Embedded Technologies INC This warranty is limited to the original purchaser of product and is not transferable During the one year warranty period RTD Embedded Technologies will repair or replace at its option any defective products or parts at no additional charge provided that the product is returned shipping prepaid to RTD Embedded Technologies All replaced parts and products become the property of RTD Embedded Technologies Before returning any product for repair customers are required to contact the factory for an RMA number THIS LIMITED WARRANTY DOES NOT EXTEND TO ANY PRODUCTS WHICH HAVE BEEN DAMAGED AS A RESULT OF ACCIDENT MISUSE ABUSE such as use of incorrect input voltages improper or insufficient ventilation failure to follow the operating instructions that are provided by RTD Embedded Technologies acts of God or other contingencies beyond the control of RTD Embedded Technologies OR AS A RESULT OF SERVICE OR MODIFICATION BY ANYONE OTHER THAN RTD Embedded Technologies EXCEPT AS EXPRESSLY SET FORTH ABOVE NO OTHER WARRANTIES ARE EXPRESSED OR IMPLIED INCLUDING BUT NOT LIMITED TO ANY IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE AND RTD Embedded Technologies EXPRESSLY DIS
14. e CANSPIDER active hub available from RTD to build fiber optic CAN systems ECANS27 User s Manual 7 BDM 610020019 rev C Mechanical description The 527 is designed PC 104 form factor An easy mechanical interface to both PC 104 and EUROCARD systems can be achieved Stack your ECAN527HR directly on a PC 104 compatible computer using the onboard mounting holes Connector description There is a 10 pin interface connector on the ECAN527HR which directly interfaces to the galvanivally isolated CAN bus The fiber optic interface may directly connect to fiber optic cable using HP Versa Link PCB mounted connectors The general purpose digital outputs and inputs are connected to the ECAN527HR by 10 pin header connector What comes with your board You will receive the following items in your ECAN527HR package ECAN527HR CAN bus interface module CD with documentation drivers and example software Note Latest versions of documentation and software are available on our website at www rtd com If any item is missing or damaged please call RTD Embedded Technologies Inc customer service department at 1 814 234 8087 Board accessories In addition to the items included in your ECAN527HR delivery accessories are available Call your distributor for more information on these accessories and for help in choosing the best items to support your distributed control system e CANSPIDER active hub for fiber optic network
15. e pointers in the interrupt table to point to our funtions ie setup for ISRs x void init irq handlers void _disable old IRQ1 handler _dos_getvect IRQ1_VECTOR 8 _dos_setvect IRQ1_VECTOR 8 new IRQ1 handler Gi old mask inp 0x21 outp 0x21 Gi old mask amp 1 lt lt IRQ1_VECTOR enable Function restore do this before exiting program Inputs Nothing Returns Nothing Purpose Restore interrupt vector table x void restore void Restore the old vectors _disable _dos_setvect IRQ1_VECTOR 8 old IRQ1 handler outp 0x21 Gi old mask enable ECANS27 User s Manual 29 BDM 610020019 rev C APPENDIX A ECAN527HR Specifications Host Interface Memory mapped into low memory occupies 256 bytes Jumper selectable base address 11 jumpers 8 bit data bus 16 bit PC 104 bus connector Jumper selectable XT and AT interrupts Jumper selectable 8 MHz or 16 MHz CAN controller clock CAN Interface Galvanically isolated transceiver with 1 Mb s data rate Timing parameters and speed of bus programmable Balanced CAN bus choke for low EMI emissions Jumper selectable 120 Ohm onboard termination resistor 0 8W SV isolated output power for other field devices Fiber optic transmitter and receiver 1Mb s data rate Digital I O non isolated Number of lines 6 LED s 2 Series resistor 100 Ohms Pull up Pull down Bits 1 3 10K pull down Connectors Galvanically isolated CAN bus ISO 11898 co
16. g active repeater nodes such as the RTD CAN Spider active 4 port CAN hub with multiple ECAN527HR boards The fiber optic interface supports data rates up to 1 Mb s using Hewlett Packard Versa Link transmitter and receiver modules These modules enable direct connectivity to fiber optic cables from your ECAN527HR The CAN Spider active hub also features compatible transmitters and receivers ECANS27 User s Manual 22 BDM 610020019 rev C Configuration EEPROM configuration EEPROM may store up to 256 bytes of user data This memory may be used to store CAN bus parameters or other identifier codes required by the system The EEPROM used the I2C standard interfacing scheme The address of the EEPROM device is set to 000 To communicate to the EEPROM you must drive the clock and data lines of the device through the port P2 2 3 lines of the 82527 CAN controller The configuration EEPROM is interfaced through the digital I O lines of port P2 bits 2 and 3 LSB is 0 Data is read and written by clocking these lines to provide the serial interface required by the EEPROM device Digital I O Table 5 shows the functionality of the 82527 port P2 bits Bits 0 and 1 have two functions They may either drive the two onboard status LED s or operate as user TTL level I O The output impedance of this port is 100 Ohms This series resistor on every I O line provides protection against short circuits and transient voltages P2 1 P2 2 P2 3 P2 4 P2 5
17. ing e Rugged aluminum frames and enclosures for PC 104 systems o HiDAN o HiDANplus ECANS27 User s Manual 8 BDM 610020019 rev C Using this manual This manual is intended to help you install your new ECAN527HR card and get it running quickly while also providing enough detail about the board and its functions so that you can enjoy maximum use of its features even in the most demanding applications When you need help This manual and all the example programs will provide you with enough information to fully utilize all the features on this board If you have any problems installing or using this board contact our Technical Support Department 814 234 8087 or send email to techsupport rtd com When sending an E mail request please include your company s name and address your name your telephone number and a brief description of the problem Board Settings The ECAN527HR CAN bus interface board has jumper settings which can be changed to suit your application and host computer memory configuration The factory settings are listed and shown in the diagram below ECANS27 User s Manual 9 BDM 610020019 rev C Factory configured Jumper Settings Table 1 illustrates the factory jumper setting for the ECAN527HR Figure 1 shows the board layout of the ECAN527HR and the locations of the jumpers The following paragraphs explain how to change the factory jumper settings to suit your specific application Table 1 Factory config
18. ither transmit of to receive except for the last message object The last message object is a receive only buffer with a special mask design to allow selected groups of different message identifiers to be received Each message identifier contains control and status bits A message object with a direction set for receive will send remote frame by requesting message transmission message set as transmit will be configured to automatically send a data frame whenever a remote frame with a matching identifier is received over the CAN bus All message objects have separate transmit and receive interrupts and status bits allowing the CPU full flexibility in detecting when a remote frame has been sent or received The 82527 chip supports a global masking feature for acceptance filtering This feature allows the user to globally mask or don t care any identifier bits of the incoming message This mask is programmable to allow the user to design an application specific message identification strategy There are separate global mask for standard and extended frames The incoming message first passes through the global mask and is matched to the identifiers in the message objects 1 14 If there is no identifier match then the message passes through the local mask in message object 15 The local mask allows a large number of infrequent messages to be received by the 82527 Message object 15 is also buffered to allow the CPU time to service a message re
19. mpliant Fiber optic CAN bus HP Versa Link connectors Non Isolated I O Header connector 10 Pin ECANS27 User s Manual 30 BDM 610020019 rev C Electrical Operating temperature range 40 to 85C Supply voltage 5V only Power consumption 115mA CE Meets CE approval for Heavy Industrial Equipment in RTD IDAN frame ECANS27 User s Manual 31 BDM 610020019 rev C Chapter 5 RETURN POLICY AND WARRANTY Return Policy If you wish to return a product to the factory for service please follow this procedure Read the Limited Warranty to familiarize yourself with our warranty policy Contact the factory for a Return Merchandise Authorization RMA number Please have the following available Complete board name Board serial number A detailed description of the board s behavior List the name of a contact person familiar with technical details of the problem or situation along with their phone and fax numbers address and e mail address if available List your shipping address Indicate the shipping method you would like used to return the product to you We will not ship by next day service without your pre approval Carefully package the product using proper anti static packaging Write the RMA number in large 1 letters on the outside of the package Return the package to RTD Embedded Technologies Inc 103 Innovation Blvd State College PA 16803 0906 USA ECANS27 User s Manual 32 BDM 610020019 rev C Limite
20. ne control is returned to the original routine at the point where its execution was interrupted Interrupts are a very flexible way of dealing with asynchronous events Keyboard activity is a good example your computer cannot predict when you might press a key and it would be a waste of processor time to do nothing while waiting for a keystroke to occur Thus the interrupt scheme is used and the processor proceeds with other tasks When a keystroke occurs the keyboard jnterrupts the processor the processor then gets the keyboard data which is then placed into the memory It then returns to what it was doing before the interrupt occurred Other common devices that use interrupts are network boards A D boards serial ports etc Your ECANS27HR can interrupt the main processor when a message is received or transmitted if interrupts are enabled on the ECAN527HR board By using interrupts you can write powerful code to interface to your CAN network Interrupt request lines ECANS27 User s Manual 24 BDM 610020019 rev C To allow different peripheral devices to generate interrupts on the same computer the PC AT bus has interrupt request channels IRQs rising edge transition on one of these lines will be latched into the interrupt controller The interrupt controller checks to see if the interrupts are to be acknowledged from that IRQ and if another interrupt is being processed it decides if the new request should supersede the one in progress
21. nowledge the interrupt controller ECANS27 User s Manual 27 BDM 610020019 rev C Saving the Startup Interrupt Mask Register IMR and interrupt vector The next step after writing the ISR is to save the startup state of the interrupt mask register IMR and the original interrupt vector you are using The IMR is located in address 21h The interrupt vector you will be using is located in the interrupt vector table which is an array of 4 byte pointers addresses and it is locate din the first 1024 bytes of the memory Segment 0 offset 0 You can read this value directly but it is a better practice to use DOS function 35h get interrupt vector to do this Most C compilers have a special function available for doing this The vectors for the hardware interrupts on the XT bus are vectors 8 15 where IRQO uses vector 8 and IRQ7 uses vector 15 Thus if your ECAN527HR is using IRQ5 it corresponds to vector number 13 Before you install your ISR temporarily mask out the IRQ you will be using This prevents the IRQ from requesting an interrupt while you are installing and initializing your ISR To mask the IRQ read the current IMR at I O port 21h and set the bit that corresponds to tout IRQ The IMR is arranged so that bit 0 is for IRQO and bit 7 is for IRQ7 See the paragraph entitled Interrupt Mask Register IMR earlier in this discussion for help in determining your IRQ s bit After setting the bit write the new value to I O port 21h With
22. of addresses in your host computers memory map Should the factory installed setting of D0000h be unusable for your system configuration you may change this setting to another using the options illustrated in Table 2 The table shows the jumper settings and their corresponding values in hexadecimal values Make sure you verify the correct location of the base address jumpers When the jumper is removed it corresponds to a logical 0 connecting the jumper to a 1 When you set the base address of the module record the setting in the table inside the back cover of this manual after the Appendices Note If you are using a memory manager such as QEMM make sure you exclude the memory section you are occupying by the ECAN527 for example X D0000 D00FF ECANS27 User s Manual 11 BDM 610020019 rev C Address Jumper Settings ECAN527HR Jumper Settings Base Address Hex 18 17 16 15 80XXX 0 88XXX 0 90XXX 98XXX AOXXX A8XXX BOXXX B8XXX COXXX C8XXX DOXXX D8XXX EOXXX E8XXX FOXXX 1 F8XXX 1111 0 NO JUMPER 1 JUMPER installed Note 19 is always decoded as 1 Table 2 Base address jumper settings Note The above table illustrates only the settings for the high address bits A18 A15 If you for instance want to configure address DOEO0 DOEFF for your ECAN527HR you must set the jumpers as 101 0000 1110 Address line A19 is always decoded as 1 ECANS27 User s Manual 12 BDM 610020019 rev C 1 7 16 15 4 15 12 1
23. of your hardware Before installing the board in your computer check the jumper settings Chapter reviews the factory settings and how to change them If you need to change any settings refer to the appropriate instructions in Chapter 1 Note that incompatible jumper settings can result in unpredictable board operation and erratic response General installation guidelines 1 Turn OFF the power to your computer and all devices connected to ECAN527 2 Touch the grounded metal housing of your computer to discharge any antistatic buildup and then remove the board from its antistatic bag 3 Hold the board by the edges and install it in an enclosure or place it on the table on an antistatic surface 4 Connect the board to the CAN field bus using the two field bus interface header connectors Make sure the polarity of the cable is correct Both connectors are identical one of these headers may be used to bring the CAN bus to the board the other connector interfaces your ECAN527HR to the CAN bus Installation integrated with a PC 104 module stack e Secure the four PC 104 installation holes with standoffs e Connect the board to the CAN bus using the two field bus interface header connectors alternatively use the fiber optic connectors ECANS27 User s Manual 15 BDM 610020019 rev C RIP dataModule Fig 4 527 integrated in a PC 104 dataModule stack rack installation with a EUROCARD CPU containing ECAN5
24. or if it has to wait until the one in progress is done The priority level of the interrupt is determined by the number of the IRQ IRQO has the highest priority IRQ15 the lowest Many of the IRQs are used by the standard system resources IRQO is dedicated for the internal timer IRQ1 is dedicated to the keyboard input IRQ3 for serial port CON2 and IRQA for serial port COMI Often interrupts 3 5 and 7 are free for the user 8259 Programmable Interrupt Controller The chip responsible for handling interrupt requests in a PC is the 8259 Interrupt Controller To use interrupts you will need to know how to read and set the 8259 s internal interrupt mask register IMR and how to send the end of interrupt EOI command to acknowledge the 8259 interrupt controller Interrupt Mask Register IMR Each bit in the interrupt mask register IMR contains the mask status of the interrupt line If a bit is set equal to 1 then the corresponding IRQ is masked and it will not generate an interrupt If a bit is cleared equal to 0 then the corresponding IRQ is not masked and it can then generate an interrupt The interrupt mask register is programmed through port 21h End of Interrupt EOI Command After an interrupt service routine is complete the 8259 Interrupt Controller must be acknowledged by writing the value 20h to port 20h What exactly happens when an interrupt occurs Understanding the sequence of events when an interrupt is triggered is nece
25. ssary to correctly write interrupt handlers When an interrupt request line is driven high by a peripheral device such as the 527 the interrupt controller checks to see if interrupts are enabled for that IRQ and then checks to see if other interrupts are active or requested and determines which interrupt has priority The interrupt controller then interrupts the processor The current code segment CS instruction pointer IP and flags are pushed onto the system stack and a new set of CS and IP are loaded from the lowest 1024 bytes of memory This table is referred to as the interrupt vector table and each entry to this table is called an interrupt vector Once the new CS and IP are loaded from the interrupt vector table the processor starts to execute code from the new Code Segment CS and from the new Instruction Pointer IP When the interrupt routine is completed the old CS and IP are popped from the system stack and the program execution continues from the point it was interrupted ECANS27 User s Manual 25 BDM 610020019 rev C Using Interrupt in your Program Adding interrupt support to your program is not as difficult as it may seem especially when programming under DOS The following discussion will cover programming under DOS Note that even the smallest mistake in your interrupt program may cause the computer to hang up and will only restart after a reboot This can be frustrating and time consuming Writing an Interrupt
26. t Service Routine 15 26 Your ISR should have the following structure eese eene nennen nnne rennen nennen 27 Saving the Startup Interrupt Mask Register IMR and interrupt Vector 28 Common Int rrupi mistakes e eie 28 Example on Interrupt vector table setup in C code 29 APPENDIXA err LEA 30 ECANS27HR SPECIFICATIONS erret gra POSEEN SERO be vt Aj Peka 30 le ONU AAO 30 CAN InterfdC r sn ennn enteren e a eU SER E ev c te ee rebate nennen 30 Digital VO non isolated edet reae ree ee venas 30 BOLL EEEN 30 letve 31 CHAPTER 5 RETURN POLICY AND 2 1 41 0 03 00 008 20 0 001616600 0 040010000000 0 0 00000202 RETURN POLICY LIMITED WARRANTY LIST OF ILLUSTRATIONS AND TABLES FIGURES FIG 1 BOARD LAYOUT SHOWING JUMPER LOCATIONS ccccccccecececececececececececececccececececececececececececececececeseeececeeeceeereress 10 FIG 2 BASE ADDRESS JUMPERS ILLUSTRATING D8000H BASE ADDRESS 0 13 FIG 3 INTERRUPT JUMPERS SET TO IRQ 5 34 13 FIG 4 ECAN527HR INTEGRATED IN A PC 104 DATAMODULE STACK cccccccc
27. ured jumper settings See figure 1 1 for detailed locations ECANS27 User s Manual 10 JUMPER NUMBER OF Jumper Name DESCRIPTION JUMPERS FACTORY DEFAULT ADDR BASE ADDRESS 11 A18 A8 D0000 IRQ HOST INTERRUPT 10 5 CAN BUS des TERMINATION CLOSED JP3 Clock Selection 1 8 MHz J12 CAN Bus J34 CAN Termination ECAN527 1 ETT aca em 7 H RE J28 BR Digital O JP3 Clock 1 E 12 9 02 Selection teun uti 2 Em ADDRESS Address JE eevee yee Hi 377 i a EA ET e z 4 SELECTION ERY 3 2 NN eu a Interrupt Ji amp J2 PC 104 Bus Fig 1 Board layout showing jumper locations BDM 610020019 rev C Base Address Jumpers Factory setting D0000h The ECAN527HR is memory mapped into the low memory of your host XT AT The ECAN527HR board occupies a memory window of 256 bytes starting from the base address The most common cause of failure when you are first setting up your module is address contention Some of your computers memory space is already occupied by other devices and memory resident programs When the ECAN527HR attempts to use reserved memory addresses already used by another device erratic performance may occur and data read from the board may be corrupted To avoid this problem make sure you set up the base address first using the 11 jumpers marked ADDR which let you choose from number
28. ures of the ECAN527HR A more detailed discussion is included in Chapter 3 Hardware description and in Chapter 4 Board operation and programming The board set up is described in Chapter Board Settings A full description of the Intel 82527 CAN controller is included in Chapter 4 CAN bus controller The ECAN527HR CAN bus interface is implemented using the Intel 82527 chip This controller supports CAN Specification 2 0 This versatile chip supports standard and extended data and remote frames as follows a programmable global message identifier mask 15 message objects of 8 byte data length and a programmable bit rate This fully integrated chip supports all the functionality of the CAN bus protocol Physical Interface Industrial environments require galvanic isolation and bus filtering to provide reliable data communication and safety The 527 has two options for the physical interface 1 The galvanivally isolated physical interface is implemented using high speed optocouplers and a DC DC converter To protect the input from radiated bus noise a special balanced bus filter is used This filter is designed to meet EMI requirements 2 The fiber optic physical interface is implemented using HP Versa Link fiber optic transmitter and receiver The fiber optic interface may be used for point to point CAN networks Due to the fiber optic technology bitwise arbitration of the CAN bus protocol can not be supported You should use th
29. which involve checking if any DOS functions are currently active when your ISR is called but such solutions are beyond the scope of this manual ECANS27 User s Manual 26 BDM 610020019 rev C The second major concern when writing ISRs is to make them as short as possible in term of execution time Spending long times in interrupt service routines may mean that other important interrupts are not serviced Also if you spend too long in your ISR it may be called again before you have exited This will lead to your computer hanging up and will require a reboot Your ISR should have the following structure e Push any processor registers used in your ISR Most C compiler do this automatically e the body of your routine here e Read interrupt status register of the 82527 chip on your ECAN527HR board e Clear the interrupt bit by writing to the 82527 CAN controller e Issue the EOI command to the 8259 by writing 20h to address 20h e Pop all registers Most C compilers do this automatically The following C example shows what the shell of your ISR should be like JA Function new_IRQ_handler Inputs Nothing Returns Nothing Sets the interrupt flag for the EVENT void interrupt far new IRQ handler void IRQ flag 1 Indicate to main process interrupt has occurred Your program code should be here Read interrupt status registers Clear interrupt on ECAN527 outp 0x20 0x20 Ack
30. ysical interface connector pin outs of the ECAN527HR ECANS27 User s Manual 18 BDM 610020019 rev C ECANS27 User s Manual 19 BDM 610020019 rev C Chapter 3 HARDWARE DESCRIPTION Chapter 3 Hardware Description describes the major features of the ECAN527HR the Intel 82527 CAN bus controller Galvanic isolation of the CAN bus the Fiber optic interface the onboard configuration EEPROM and Digital I O Figure 6 shows the general block diagram of the ECAN527HR This chapter describes the major features of the ECAN527HR the Intel 82527 CAN bus controller Galvanic isolation of the CAN bus the Fiber optic interface the onboard configuration EEPROM and Digital I O BUS FESISTORS Fig 6 ECAN527HR Block diagram ECANS27 User s Manual 20 BDM 610020019 rev C 82527 CAN bus controller Reference note Intel publication CAN Architectural Overview Automotive Products Databook The 82527 CAN controller consists of six functional blocks The CPU interface logic manages the communication to the host computer The CAN controller interfaces to the CAN bus and implements the protocol rules of the CAN protocol for the transmission and reception of messages The RAM is the physical interface layer between the host CPU and the CAN bus One eight bit I O port provides low speed I O capabilities The 82527 RAM provides storage for 15 message objects of 8 byte length Each message object has a unique identifier and can be configured to e
Download Pdf Manuals
Related Search
Related Contents
S542 Owner`s Manual - Merits Health Products armoires electriques This exhibitor service manual contain Manual Sony TGA-1 S-Disk Flash Manual mode d`emploi du site pour les PH - DES de Médecine Générale Ile guia rabia 2 - Ministerio de Salud y Protección Social Copyright © All rights reserved.
Failed to retrieve file