rtd ECAN1000HR User Manual Download Page 21

ECAN1000 User’s Manual  

 

 

21  

 

 

BDM-610020026 rev B 

 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 Control-
ler 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 
necessary to correctly 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 deter-
mines 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 if 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 is popped from 
the  system  stack  and  the  program  execution  continues  from  the  point 
where the interruption occurred. 

 

Summary of Contents for ECAN1000HR

Page 1: ...ECAN1000HR Isolated CAN interface board User s Manual BDM 610020026 Rev B...

Page 2: ...ECAN1000HR 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...

Page 3: ...hed by RTD Embedded Technologies Inc 103 Innovation Blvd State College PA 16803 0906 Copyright 1999 2002 2003 2007 by RTD Embedded Technologies Inc All rights reserved The RTD Logo is a registered tra...

Page 4: ...ALVANICALLY ISOLATED CAN BUS CONNECTOR 15 J34 GALVANICALLY ISOLATED CAN BUS TERMINATION JUMPER 15 CHAPTER 4 HARDWARE DESCRIPTION 16 THE CAN BUS CONTROLLER 17 GALVANIC ISOLATION OF THE CAN BUS 18 CHAPT...

Page 5: ...N1000HR INTEGRATED IN A PC 104 RTD CPUMODULE STACK 14 FIGURE 5 19 EUROCARD RACK INSTALLATION WITH AN INTEGRATED PC 104 DATAMODULE AND 14 FIGURE 6 ECAN1000HR BLOCK DIAGRAM 16 TABLES TABLE 1 FACTORY CON...

Page 6: ...the major features of the ECAN1000HR A more detailed discussion in included in Chapter 4 Hardware description and in Chapter 5 Board operation and program ming The board setup is described in Chapter...

Page 7: ...N1000HR is designed on a PC 104 form factor An easy me chanical interface to both PC 104 and EUROCARD systems can be achieved Stack your ECAN1000HR directly on a PC 104 compatible computer using the o...

Page 8: ...its functions so that you can obtain maximum use of its fea tures even in the most demanding applications This manual does not cover CAN bus network programming and system design When you need help T...

Page 9: ...1 below illustrates the factory jumper setting for the ECAN1000HR Fig ure 1 shows the board layout of the ECAN1000HR and the locations of the jumpers The following paragraphs explain how to change the...

Page 10: ...st 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 at tempts to use its own reserved...

Page 11: ...jumper is removed it corresponds to a logical 0 connecting the jumper to a 1 When you set the base address of the board record the setting inside the back cover of this manual BASE ADDRESS JUMPER SET...

Page 12: ...utputs 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 Figure 3 Interrupt set to IRQ 5 Note The ECAN1000HR doe...

Page 13: ...hardware Before installing the board in your computer check the jumper settings Chapter 2 reviews the factory settings and how to alter them If any alterations are needed please refer to the appropri...

Page 14: ...n be easily inserted into a 19 rack installation us ing the CPU as a form factor adaptor Assemble your PC 104 data mod ules on an RTD single board EUROCARD computer and install the sys tem in a 19 enc...

Page 15: ...9 GND isolated 10 N C Table 3 J12 CAN Bud Connector 9 7 5 3 1 I_GND N C I_GND BUS_L N C N C I_ 5V N C BUS_H I_GND 10 8 6 4 2 Table 4 Physical interface connector J12 pinout of the ECAN1000HR J34 Galva...

Page 16: ...DM 610020026 rev B Chapter 4 HARDWARE DESCRIPTION This chapter describes in detail the major features of the ECAN1000HR The Philips SJA1000 CAN bus controller Galvanic isolation of the CAN bus Figure...

Page 17: ...d can be configured to ei ther transmit or to receive Each message identifier contains control and status bits A message ob ject with a direction set for receive will send a remote frame by requesting...

Page 18: ...ly to improve immunity to bus noise but also to protect the bus trans ceiver This choke also reduces the radiated emissions in the range of 30 200MHz A 1W DC DC converter may be used to power other re...

Page 19: ...ribed 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 Table 5 ECAN Memory M...

Page 20: ...rds 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 powe...

Page 21: ...0h What exactly happens when an interrupt occurs Understanding the sequence of events when an interrupt is triggered is necessary to correctly write interrupt handlers When an interrupt request line i...

Page 22: ...I command to the interrupt controller Finally when exiting the inter rupt routine the processor registers must be popped from the system stack and you must execute the IRET assembly instruction This i...

Page 23: ...ting 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 lan guage DOS and man...

Page 24: ...rray of pointers ad dresses 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 better practice to use DOS function 35h get interrupt...

Page 25: ...routine for set ting up interrupt vectors Remember that interrupt vector 8 corresponds to IRQ0 vector 9 for IRQ1 etc If you need to program the source of your interrupts do that next For ex ample if y...

Page 26: ...rq_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_getvec...

Page 27: ...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 Co...

Page 28: ...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...

Page 29: ...d 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 EXPRESSE...

Reviews: