Home
ECAN1000HR Isolated CAN interface board User's Manual
Contents
1. 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 ECAN1000HR outp 0x20 0x20 Acknowledge the interrupt controller Saving the Startup Interrupt Mask Register IMR and interrupt vector The next step after writing the ISR is to save the start up state of the interrupt mask reg ister 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 ar ray of pointers addresses and it is locate din the first 1024 bytes of the memory Seg ment 0 offset 0 You can read this value directly but it is better practice to use DOS func tion 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 ECAN1000HR 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
2. User s Manual INTERRUPTS ECAN1000HR 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 routine 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 whilst waiting for a keystroke to occur Thus the interrupt scheme is used and the processor proceeds with other tasks When a key stroke finally occurs the keyboard then interrupts the processor so that it can get the keyboard data It then places it into the memory and then returns to what it was doing before the interrupt occurred Other common devices that use interrupts are A D boards network boards serial ports etc Your ECAN1000HR can interrupt the main processor when a message is received or transmitted if interrupts are enabled on the ECAN1000HR board By using interrupts you can write powerful code to interface to your CAN network Interrupt request lines To allow different peripheral devices to generate interrupts on the same computer the PC AT bus has interrupt request channels IRQ s A rising edge transition on one of these lines will be latched into the interrupt controller T
3. of the ECAN1000HR is described in the attached datasheet reprint from Philips on the SJA1000 CAN controller chip Defining the Memory Map ECAN1000HR The memory map of the ECAN1000HR occupies 2 bytes of host PC I O memory space This 3 byte window is freely selectable by the user as described in Chapter 2 Table 2 2 After setting the base address you have access to the internal resources of the SJA1000 CAN controller chip These resources are described in the next sections reprinted from the SJA1000 chip specific user s manual ADDRESS Description BASE 00h ADDRESS BASE 01h DATA of ADDRESS BASE 02h HARDWARE RESET OF SJA1000 The SJA1000 chip access is multiplexed in such a way that the host must first write to BASE 0 the internal address of the CAN chip and after that perform a write to address BASE 1 with the actual data to be written into the desired memory location An example is listed below using C syntax We assume base address is 300H Write 78H to the CAN controller Control byte located in the on chip address O outp 0x300 0x00 outp 0x301 0x78 Address BASE 02h is a hardware reset function of the SJA1000 Performing a read or write to this address will cause a hardware reset to the CAN controller You may need to reset the chip in case of an unrecoverable error in the CAN controller chip On the following pages is attached the chip specific user s manual for the SJA1000 CAN controller chip 20 RTD Finland Oy
4. returned by a faster service at your expense e Non warranty repairs will be returned by UPS Ground or the method you select and will be billed to you 6 Clearly specify the address to which we should return the product when repaired 7 Enclose the paper with the product being returned 8 Carefully package the product to be returned using anti static packaging We will not be responsible for products damaged in transit for repair 7 Write the RMA number on the outside of the package 8 Ship the package to Real Time Devices Finland Oy Lepolantie 14 FIN 00660 Helsinki FINLAND ECAN1000HR 27 RTD Finland Oy User s Manual Limited warranty Real Time Devices 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 REAL TIME DEVICES This warranty is limited to the original purchaser of product and is not transferable During the one year warranty period REAL TIME DEVICES will repair or replace at its option any de fective products or parts at no additional charge provided that the product is returned shipping prepaid to REAL TIME DEVICES All replaced parts and products become the property of REAL TIME DEVICES 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
5. the bit that corresponds to the IRQ The IMR is arranged so that bit O is for IRQO and bit 7 is for IRQ7 See the paragraph entitled nterrupt 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 the startup IMR saved and the interrupts temporarily disabled you can assign the in terrupt 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 IRQ1 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 interrupt sources program it to do that Finally clear the mask bit for your IRQ in the IMR This will enable your IRQ 24 RTD Finland Oy ECAN1000HR User s Manual Common Interrupt mistakes Remember that hardware interrupts are from 8 15 XT IRQ s are numbered 0 7 Forgetting to clear the IRQ mask bit in the IMR Forgetting to send the EOI command after ISR code disables further interrupts Example on Interrupt vector table setup in C code void far interrupt new IRQ1 handler void ISR function prototype define IRQ1 VECTOR 3 Name for IRQ v
6. 1000HR A more detailed discussion in included in Chapter 4 Hardware description and in Chapter 5 Board operation and programming The board setup is described in Chapter 2 Board Settings A full description of the Philos SJA1000 CAN controller is included in Chapter 5 Board operation and programming CAN bus controller The ECAN1000HR CAN bus interface is implemented using the Philips SJA1000 control ler This controller supports CAN Specification 2 0 This versatile chip supports standard and extended Data and Remote frames a Programmable Global Message Identifier Mask 15 message objects of 8 byte Data Length and a Programmable Bit Rate This fully inte grated chip supports all the functionality of the CAN bus protocol The internal 64 byte re ceive FIFO is ideal for block mode data transfer from the CAN controller chip Physical Interface ECAN1000HR Industrial environments require galvanic isolation and bus filtering to provide reliable data communication and safety The galvanivally isolated physical interface is uses high speed optocouplers and a DC DC converter To protect the input from radiated bus noise a spe cially balanced bus filter is used The bus connectors conform to the I8O11898 2 specifi cation For more information on CAN bus please visit the CAN in Automation Website at http www can cia de 7 RTD Finland Oy User s Manual Mechanical description The ECAN1000HR is designed on a PC 104 form factor A
7. CAN bus 90 degree 10 pin header Host bus XT AT PC 104 bus Operating temperature range 40 to 85 C Supply voltage 5V 8 Power consumption 1 0W typical The ECAN1000HR is CE certified in the IDAN Enclosure System Please consult the factory for more information on the system 26 RTD Finland Oy User s Manual Chapter 7 RETURN POLICY AND WARRANTY Return Policy If the module requires repair you may return it to us by following the procedure listed below Caution Failure to follow this return procedure will almost always delay repair Please help us expe dite your repair by following this procedure 1 Read the limited warranty which follows 2 Contact the factory and request a Returned Merchandise Authorization RMA number 3 On a sheet of paper write the name phone number and fax number of a technically competent per son who can answer questions about the problem 4 On the paper write a detailed description of the problem with the product Answer the following ques tions Did the product ever work in your application What other devices were connected to the product How was power supplied to the product What features did and did not work What was being done when the product failed What were environmental conditions when the product failed 5 Indicate the method we should use to ship the product back to you e We will return warranty repairs by UPS Ground at our expense e Warranty repairs may be
8. ECAN1000HR Isolated CAN interface board User s Manual Hardware releases 1 0 1 1 Ul Real Time Devices Inc Accessing the Analog World User s Manual ECAN1000HR ISOLATED 1 MB S CAN INTERFACE BOARD USER S MANUAL Declaration of Conformity of the ECAN1000HR to the following Directives EU EMC directive 89 336 EEC EU Low Voltage directive 73 23 EEC using the relevant section of the following EU standards and other normative documents EN50081 2 1995 EN55022 EN50082 2 1995 EN61000 4 3 EN61000 4 6 EN61000 4 2 EN61000 4 4 Emissions generic requirements Measurement of radio interference characteristics of information technology equipment Immunity generic requirements Radio frequency electromagnetic field AM modulated Radio frequency common mode AM modulated Electrostatic discharge Fast transients Relevant documents are available upon request from RTD Tomi Hanninen Managing Director RTD Finland Oy ECAN1000HR REAL TIME DEVICES FINLAND OY LEPOLANTIE 14 FIN 00660 HELSINKI FINLAND Phone 4358 9 346 4538 FAX 358 9 346 4539 E Mail sales rtdfinland fi Website www rtdfinland fi 2 RTD Finland Oy User s Manual Revision History 28 11 1991 Release 1 0 15 07 2001 Name of company changed reformatted Notice We have attempted to verify all information in this manual as of the publication date Informa tion in this manual may change without prior notice from RTD Fi
9. FIC LEGAL RIGHTS AND YOU MAY ALSO HAVE OTHER RIGHTS WHICH VARY FROM STATE TO STATE SERIAL NUMBER BASE ADDRESS INTERRUPT ECAN1000HR 28 RTD Finland Oy
10. 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 REAL TIME DEVICES acts of God or other contingencies beyond the control of REAL TIME DEVICES OR AS A RESULT OF SERVICE OR MODIFICATION BY ANYONE OTHER THAN REAL TIME DEVICES 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 REAL TIME DEVICES EXPRESSLY DISCLAIMS 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 REAL TIME DEVICES 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 SPECI
11. User s Manual End of Interrupt EOI Command After an interrupt service routine is complete the 8259 Interrupt Controller must be ac knowledged 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 necessary to cor rectly write interrupt handlers When an interrupt request line is driven high by a peripheral device such as the ECAN1000HR the interrupt controller checks to see if interrupts are enabled for that IRQ It then checks to see if other interrupts are active or requested and determines which interrupt has priority The interrupt controller then interrupts the proces sor The current code segment CS instruction pointer IP and flags are pushed onto the system stack and a new set if CS and IP are loaded from the lowest 1024 bytes of mem ory 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 In struction Pointer IP When the interrupt routine is completed the old CS and IP is popped from the system stack and the program execution continues from the point where the inter ruption occurred Using Interrupts in your program Adding interrupt support to your program is not as difficult as it may seem especia
12. ce logic the Transmit Buffer the Receive Buffer the Acceptance Filter the Bit Stream Processor the Bit Timing Logic and the Error management logic A detailed description of these blocks is listed in the detailed component specific datasheet reprinted from Philips Semi conductors The SJA1000 internal message FIFO RAM provides storage for 64 message bytes Each message can vary from one to up to 8 bytes in length Each message object has a unique identifier and can be configured to either transmit or to receive Each message identifier contains control and status bits A message object with a direction set for receive will send a remote frame by requesting a message transmission A mes sage set as transmit will be configured to automatically send a data frame whenever a re mote 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 flexibil ity in detecting when a remote frame has been sent or received The SJA1000 also features masking 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 specifical message identification strategy There are separate global masks for standard and extended frames The incom ing message first passes through the global mask and is then matched to the id
13. ding enough detail about the board and it s functions so that you can obtain maximum use of it s features even in the most demanding applications This manual does not cover CAN bus network programming and system design When you need help ECAN1000HR 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 with installation or use of the board contact our Technical Support Department 358 9 346 4538 during Euro pean business hours Alternatively send a FAX to 358 9 346 4539 or Email to sales rtdfinland fi When sending a FAX or Email request please include the following information Your company s name and address your name your telephone number and a brief description of the problem 9 RTD Finland Oy User s Manual Chapter 2 BOARD SETTINGS The ECAN1000HR CAN bus interface board has jumper settings which can be changed to suit your ap plication and host computer memory configuration The factory settings are listed and shown in the dia gram at the beginning of this chapter ECAN1000HR 10 RTD Finland Oy User s Manual Factory Configured Jumper Settings Table 2 1 below illustrates the factory jumper setting for the ECAN1000HR Figure 2 1 shows the board layout of the ECAN1000HR and the locations of the jumpers The following para graphs explain how to change the factory jumper settings to suit your specific applicatio
14. en nnns 24 CHAPTER 6 ECAN1000HR SPECIFICATIONS 25 CHAPTER 7 RETURN POLICY amp WARRANTY 26 ECAN1000HR 5 RTD Finland Oy SU er Manual LIST OF ILLUSTRATIONS AND TABLES ILLUSTRATIONS Fig 2 1 Board layout showing jumper locations Fig 2 2 Base address jumpers Fig 2 3 Interrupt jumpers Fig 3 1 ECAN1000HR integrated with a PC 104 cpuModule stack Fig 3 2 19 Eurocard rack installation with an integrated PC 104 data Module and EUROCARD cpuModule computer system Fig 4 1 ECAN1000HR Block diagram TABLES Table 2 1 Factory configured jumper settings Table 2 2 Base Address jumper settings Table 3 2 Physical interface connector pinouts of ECAN1000HR ECAN1000HR 6 RTD Finland Oy User s Manual Chapter 1 INTRODUCTION This user s manual describes the operation of the ECAN1000HR CAN bus Interface board Features Some of the key features of the ECAN1000HR include SJA1000 CAN network controller Electrically compatible with the PCA82C200 stand alone CAN controller chip 1 Mb s maximum datarate fully programmable Full CAN functionality 2 0 B Extended receive buffer 64 byte FIFO 16 MHz clock frequency Galvanically isolated physical interfaces UO mapped host interface using three addresses 40 to 85C operational temperature 5V only operation PC 104 compliant The following paragraphs briefly describe the major features of the ECAN
15. entifiers in the message objects Galvanic isolation of the CAN bus ECAN1000HR The galvanic isolation of the ECAN1000HR is implemented using the following e Optocouplers for reliable data transmission e DC DC converter to supply power to the CAN bus and the physical interface circuitry The high speed optocouplers are directly connected to the SJA1000 The optocouplers drive the CAN bus transceiver A special balanced CAN bus choke is used not only to im prove immunity to bus noise but also to protect the bus transceiver This choke also re duces the radiated emissions in the range of 30 200MHz A 1W 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 A 125mA fuse green are used to protect the DC DC converter The jumper marked as J34 is the CAN bus termination jumper Only two termination jump ers should be closed at the endpoints of the CAN bus Failure to do so may degrade the performance of the bus or even cause permanent damage to the driver chips The maxi mum drive of the transceiver is 32 nodes 19 RTD Finland Oy User s Manual Chapter 5 BOARD OPERATION AND PROGRAMMING This chapter shows you how to program and use your ECAN1000HR It provides a com plete description of the internal memory map of the chip and a detailed discussion of the internal registers to aid you in programming your CAN controller chip The full functionality
16. entrancy also exists for many floating point emulators This effec tively means that you should also 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 re entrant Of course there are ways to avoid this problem such as those which activate when your ISR is called Such solutions are however beyond the scope of this manual The second major concern when writing ISR s 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 auto matically Put the body of your routine here Read interrupt status register of the SJA1000 chip on your ECAN1000HR board Clear the interrupt bit by writing to the SJA1000 CAN controller Issue the EOI command to the 8259 by writing 20h to address 20h Pop all registers Most C compilers do this automatically 23 RTD Finland Oy SU er Marna The following C example shows what the shell of your ISR should be like ECAN1000HR
17. he interrupt controller checks to see if the interrupts are to be acknowledged from that IRQ and if another interrupt is being proc essed it decides if the new request should supersede the one in progress or if it has to wait until the one in progress has been completed The priority level of the interrupt is de termined by the number of the IRQ as follows IRQO has the highest priority whilst IRQ15 has the lowest Many of the IRQ s are used by the standard system resources IRQO is dedicated to the internal timer IRQ1 is dedicated to the keyboard input IRQ3 for the serial port COM2 and IRQA for the serial port COM1 Often interrupts 2 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 Control ler To use interrupts you will need to know how to read and set the 8259 s internal inter rupt mask register IMR and how to send the end of interrupt EOI command to acknowl edge 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 21 RTD Finland Oy ECAN1000HR
18. is connector is to the right hand side of your board marked J12 The pinout conforms to the ISO 11898 2 standard specification N C GND isolated BUS L BUS H GND isolated N C N C 5V isolated GND isolated 9 7 5 3 1 10 8 6 4 2 Table 3 2 Physical interface connector J12 pinout of the ECAN1000HR Galvanically isolated CAN bus termination jumper The jumper marked as J34 is the CAN bus termination jumper Only two termination jump ers should be closed at the endpoints of the CAN bus Failure to do so may degrade the performance of the bus and it will affect the bus timing characteristics of the CAN bus The maximum guaranteed drive capability of the CAN bus transceiver is 32 nodes ECAN1000HR 17 RTD Finland Oy Chapter 4 HARDWARE DESCRIPTION This chapter describes in detail the major features of the ECAN1000HR e The Philips SJA1000 CAN bus controller e Galvanic isolation of the CAN bus SJAIOOO CAN BUS CONTROLLER PC 104 BUS ADDRESS DECODER Fig 4 1 ECAN1000HR Block diagram ECAN1000HR 18 User s Manual TERMINATION 120 OHMS RTD Finland Oy CAN BUS User s Manual The CAN bus controller The SJA1000 CAN bus controller uses a 16 MHz base oscillator This must be taken into account when performing settings in the CAN bus timing registers that set the baud rate and sampling times of the CAN network The SJA1000 CAN controller consists of seven functional blocks The host interfa
19. lly 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 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 sub routines or procedures First on entrance the processor registers must be pushed onto the stack_before anything else Second just before exiting the routine you must clear the interrupt on the ECAN1000HR by writing to the SJA1000 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 instruc tion This instruction pops the CS IP and processor flags from the system stack These were pushed onto the stack when entering the ISR 22 RTD Finland Oy ECAN1000HR User s Manual 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 a
20. n Table 2 1 Factory configured jumper settings Please see figure 2 1 for detailed locations BASE Base Addresses ddresses um _ LES a Ot HE IRQ SELECT Host interrupts L1 L D Ka E Eh is a m Le KI e EL FT rs as ES Of i LV JC ann di in D E 7 i wcundevin Ly Real Teme Devices Scandenavig Dy Figure 2 1 ECAN1000HR Board layout showing jumper locations ECAN1000HR 11 RTD Finland Oy User s Manual Base Address Jumpers Factory setting 300h ECAN1000HR The ECAN1000HR is I O mapped into the memory space of your host XT AT This board occupies two I O addresses 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 I O space is already occupied by other devices and memory resident programs When the ECAN1000HR attempts to use it s own reserved memory addresses which are being already used by another peripheral device erratic performance may occur and the data read from the board may be corrupted To avoid this problem make sure you set up the base address by using the ten jumpers marked BASE This allows you to choose from a number of different addresses in your host computer I O map Should the factory installed setting of 300h be incompatible to your system configuration you may change this setting to another using the options il lustrated in Table 2 2 overleaf The table
21. n easy mechanical interface to both PC 104 and EUROCARD systems can be achieved Stack your ECAN1000HR di rectly on a PC 104 compatible computer using the onboard mounting holes Connector description There is a 10 pin interface connector on the ECAN1000HR to directly interface to the galvanivally isolated CAN networks This header is compliant with the ISO11892 2 speci fied pinout What comes with your board Your ECAN1000HR package contains the following items e ECAN1000HR CAN bus interface module H User s manual Note Software and drivers can be downloaded from our website If any item is missing or damaged please call Real Time Devices Finland customer serv ice department at the following number 358 9 346 4538 Board accessories In addition to the items included in your ECAN1000HR delivery several software and hardware accessories are available Contact your local distributor for more information and for advice on selecting the most appropriate accessories to support your system e Application software drivers QNX e Hardware accessories including IDAN solid aluminium frames for PC 104 based computers For more information on IDAN please visit our websites at the following website ad dressses www rtdfinland fi or www rtdusa com ECAN1000HR 8 RTD Finland Oy User s Manual Using this manual This manual is intended to help you install your new ECAN1000HR card and get it work ing quickly whilst also provi
22. nd 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 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 in stead of the RET instruction There are a few precautions you must consider when writing ISR s The most important is do not use any DOS functions or functions that call DOS functions from an interrupt routine DOS is not re entrant that is a DOS function cannot call itself In typical pro gramming this will not happen because of the way DOS is written But what about using interrupts Consider then the following situation in your program If DOS function X is be ing executed when an interrupt occurs and the interrupt routine makes a call to the same 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 operations The general rule is that do not call any functions that use the screen read keyboard input or any file I O rou tines These should not be used in ISR s The same problem of re
23. nland Oy Published by Real Time Devices Finland Oy Palovartijantie 13 17 FIN 00750 Helsinki Finland Copyright 1999 2001 Real Time Devices Finland Oy All rights reserved Printed in Finland PC XT PC AT are registered trademarks of IBM Corporation PC 104 is a registered trademark of PC 104 Consortium The Real Time Devices Logo is a registered trademark of Real Time Devices utilityModule is a trademark of Real Time Devices All other trademarks appearing in this document are the property of their respective owners ECAN1000HR 3 RTD Finland Oy User s Manual TABLE OF CONTENTS LIST OF ILLUSTRATIONS AND TABLES 6 CHAPTER 1 INTRODUCTION eeeeeeerrnnnmm P gripe MI MC MM n 7 CAN bus controllet 3 seule elec caen rag shed o v vut vag bu E v verb e RE E ena ee 7 Physical Interface o b Lakes dt ar epee repu SES v ERR vH E REY ERR ear ee 7 Mechanical description ssesssssssssssssssseeesee nennen n nennen nnne nnn 7 Connector description 8 What comes with your board nennen nennen nnne nnne ens 8 BOard ACCESSOMES OM REC 8 Application software and drivers Hardware accessories Using this miariual osi ER ekex esee tete EES HERR REGERE LEER VE RETE RE REPE LE HR ERR RE RE sentra 8 When you nesd help E 8 CHAPTER 2 BOARD SETTINGS eesseeeees D Facto
24. oid interrupt far old_IRQ1_ dispatcher es ds di si bp sp bx dx cx axiip cs flags Variable to store old IRQ Vector void far interrupt new IRQ1 handler void Function init irg handlers Inputs Nothing Returns Nothing Purpose Set the pointers in the interrupt table to point to our funtions ie setup for ISR s 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 A 1 lt lt IRQ1 VECTOR enable Function restore do this before exiting program Inputs Nothing Returns Nothing Purpose Restore interrupt vector table void restore void Restore the old vectors disable dos setvect IRQ1 VECTOR 8 old IRQ1 handler outp 0x21 Gi old mask enable 25 RTD Finland Oy User s Manual Chapter 6 ECAN1000HR SPECIFICATIONS Host Interface CAN Interfaces Connectors Electrical CE ECAN1000HR I O mapped device occupies 3 bytes Jumper selectable base address 8 bit data bus 16 bit AT bus connector Jumper selectable XT and AT interrupts Galvanically isolated transceiver 1 Mb s datarate Timing parameters and speed of bus programmable Balanced CAN bus Choke Jumper selectable 120 Ohm termination resistors Transceiver type Philips 82C251 0 8W 5V isolated output power for other field devices Galvanically isolated
25. ry configured jumper settings nennen 10 Base Address Iumpers eene neen sse n nri nntr isset 11 Interrupt charinel 5 LL boxes gt geg EEERR riu vue naar Rot ru v uo Paar Rugs 13 CHAPTER 3 BOARD INSTALLATION 14 Board installatlonicxs i Evene veter recs ches epo CER eegend uaa us 14 External UO connechons enne enne nnns nnnaa innen rris ssa a ains 16 Galvanically isolated CAN bus connector Galvanically isolated CAN bus termination jumper CHAPTER 4 HARDWARE DESCRIPTION 17 SJA1000 CAN bus controller ccc cece ccccceecceeeeseecseaeueseeeeueusueeesaueesaaeeeeeeesaeeeaaeeeaees 18 Galvanic Isolation of the CAN bus 18 ECAN1000HR 4 RTD Finland Oy User s Manual CHAPTER 5 BOARD OPERATION AND PROGRAMMING 19 Defining the Memory map iiti ettet reta t i bet ote ete ftd 19 SJA1000 Datasheet reprint from Philips IRterr pts ir tite ttti irte EE ett er hd Ete tpe Poeti to te Piet bote iter ttd 20 Whats aA Bleu 20 Interr pt request ines oot ett tree eerie Da aaa a braun i 20 8259 Programmable interrupt controller 20 Interrupt mask register MP 20 End Of Interrupt EOI Commande 21 What exactly happens when an interrupt occurs sssssssssse 21 Using interrupts in your Drogram nnne nnne 21 Writing an interrupt service routine ESP 21 Saving the startup IMR and interrupt vector nnn 23 Common Interrupt mist kes enne nnne nnne nnne nenn
26. shows the jumper settings and their corre sponding values in hexadecimal form Ensure that you verify the correct location of the base address jumpers When the jumper is removed it corresponds to a logical 0 con necting the jumper to a 1 When you set the base address of the board record the set ting inside the back cover of this manual 12 RTD Finland Oy User s Manual Table 2 2 Base Address Jumper Settings BASE ADDRESS JUMPER SETTINGS ECAN1000HR Base address Hex Jumper Setings A8 A7 A6 A5 0 JUMPER OFF 1 JUM PER CLOSED 200 220 240 260 280 2A0 2C0 2E0 320 340 360 380 3A0 3C0 3E0 Note The above table illustrates the settings for the high address bits A8 A5 AQ is always decoded 1 BASE A1 Miolojo olololo AB Fig 2 2 Base address jumpers illutrating address 300 h ECAN1000HR 13 RTD Finland Oy User s Manual Interrupt channel Factory setting IRQ5 The header connector shown in Figure 2 3 below lets you connect the onboard SJA1000 CAN controllers interrupt outputs to one of the interrupt channels available on the host XT AT bus If your board has no AT extension interrupts IRQ 10 15 are not available IRQ SELECTION alalalalalala 151211107 8 5 4 3 2 Fig 2 3 Interrupt set to IRQ 5 Note The ECAN1000HR does not support interrupt sharing This feature is sometimes re garded as a part of the PC 104 special features After extensive software and hard ware tests we ha
27. tatic build up and then remove the board from its antistatic bag Hold the board by the edges and install it in an enclosure or place it on the table on an antistatic surface Connect the board to the CAN fieldbus using the fieldbus interface header connector J12 Make sure that the orientation of the cable is correct Installation integrated with a PC 104 module stack ECAN1000HR Secure the four PC 104 installation holes with standoffs Connect the board to the CAN bus using the CAN header connector J12 15 RTD Finland Oy User s Manual ECANIOOO KTD dataModule CMM6866X233 Fig 3 1 ECAN1000HR integrated in a PC 104 RTD cpuModule stack 3U rack or enclosure installation with a EUROCARD CPU containing an ECAN1000HR The PC 104 system can be easily inserted into a 19 rack installation using the CPU as a form factor adaptor Assemble your PC 104 data modules on an RTD single board EUROCARD computer and install the system in a 19 enclosure Multiple ECAN1000HR boards can be easily connected to this system See figure 3 2 below ECANIOO0 5O PIN EXPANSION CONNECTOR RTD dataModule EUROCARD AT 96 CPU WITH PC AIO4 EXPANSION BUS Fig 3 2 19 Eurocard rack installation with an integrated PC 104 dataModule and EUROCARD cpuModule computer system ECAN1000HR 16 RTD Finland Oy User s Manual Galvanically isolated CAN bus connector Table 3 2 below shows the CAN physical interface connector pinout Th
28. ve found that errorfree interrupt performance can not be guaran teed when sharing interrupts ECAN1000HR 14 RTD Finland Oy User s Manual Chapter 3 BOARD INSTALLATION The ECAN1000HR CAN bus interface board is very easy to connect to your industrial dis ributed control system Direct interface to PC 104 systems as well as EUROCARD boards is possible This chapter gives step by step instructions on how to install the ECAN1000HR into your system After completing the installation it is recommended that you use the diagnostic and test software to fully verify that your board is working Board Installation Keep your board in the 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 of your hardware Before installing the board in your computer check the jumper settings Chapter 2 reviews the factory settings and how to alter them H any alterations are needed please refer to the appropriate instructions in this chapter Do however note that incompatible settings can result in unpredictable board op eration and erratic response General installation guidelines Turn OFF the power to your computer and all devices connected to the ECAN1000HR Touch the grounded metal housing of your computer to discharge any antis
Download Pdf Manuals
Related Search
Related Contents
Instruction manual - FridgeFilters.com Invacare® Atlas Lite Hampton Bay HD11750FRABZC Instructions / Assembly HP LaserJet 1022, 1022n, 1022nw User Guide – ITWW relatório de identificação e delimitação da TI DVR-Manager Transcend 256MB SDRAM 144Pin SO-DIMM PC133 Unbuffer Non-ECC Memory Air CompressorTM - Air Compressors Direct ID - Repositorio Digital Universidad de Guayaquil Copyright © All rights reserved.
Failed to retrieve file