Home
PCI-TMC12 - OMEGA Engineering
Contents
1. couro EXTGIO coUrio pex 00 2 586 not available ECLKn external clock source for counter n EXTGn external gate control signal for counter n COUTn output of timer counter n All signals are TTL compatible OME PCI TMC12 A User Manual Ver 2 0 Sep 2002 17 pin assignment of digital input connector Pin Pin 1 Digital input 0 2 Digital input 1 5 Digital inputa 6 Digital 17 Digital input 8 Digital 9 Digital input 8 10 Digital input 9 15 Digital input 14 Digital input 15 PCB ground PCB ground PCB PCB CONG pin assignment of the digital output connector Pin Name Pin Name 5 Digialouput4 6 Digital output 5 17 Digital outputs 8 Digital output 17 9 Digital output8 10 Digital output 9_ PCB PCB 12V OME PCI TMC12 A User Manual Ver 2 0 Sep 2002 3 Control Register 3 1 How to Find the I O Address The plug amp play BIOS will assign a proper I O address to every OME PCI TMC12 A card in the power on stage The IDs of OME PCI TMC12 A are given as following e Vendor ID 1085 e Device ID 9050 e Sub vendor ID 2129 e Sub device ID 9912 We provide all necessary functions as following 1 PTMC12_DriverInit amp wBoard This function can det
2. Joo Joo Note Refer to Sec 3 1 for more information about wBase outport wBase 0x14 wDoValue control the D O states 3 3 5 Interrupt control status register of OME PCI TMC12 READ WRITE wPLX 0x4C interrupt control status register Bit Description BO INTERRUPT enable 0 disable 1 enable Bl POLARITY 1 active HIGH 0 active LOW B2 INTERRUPT status 0 int not active 1 int is active B3 reserved B4 reserved 5 reserved B6 PCI interrupt enable 0 disable 1 enable B7 Software interrupt a value of will generate interrupt B8 to reserved B31 Refer to DEMO7 C DEMO11 C DEMO12 C amp DEMOI3 C for more information The interrupt of OME PCI TMC12 is level trigger The interrupt signal can be programmed active low or active high The procedures of programming are given as following OME PCI TMC12 A User Manual Ver 2 0 Sep 2002 24 make sure the initial level is High Low if the initial state is High gt set the interrupt signal is active_low initially if the initial state is Low gt set the interrupt signal is active_high initially pe GE If the interrupt signal is active gt program will transfer into the interrupt service routine gt toggle the active_state before return from the ISR Example 1 assume initial level High Initial High Initial sub now int state 1 _outpd wPLX 0x4c 0x41 INT si
3. 5 Demo Program The application programs of 8254 can be complicated There are about 10 demo programs given on the DOS floppy disk The library amp source code of demo program are all given in the disk These demo programs will help user solve real world problems DENTES TC LARGE TC LARGE LIB TC LARGE DEMO TC LARGE LIB PCITMC12 H TC LARGE LIB PCITMC12 C TC LARGE LIB A BAT TC LARGE LIB B BAT TC LARGE LIB PCITMC12 lib TC LARGE DEMO1 PCITMC12 H TC LARGE DEMO1 DEMO1 C TC LARGE DEMO1 DEMO1 PRJ gt for Turbo 2 xx or above gt for large model gt for library source code gt demo program source code gt library header file gt library source file gt compiler file gt link file gt library file gt library header file gt demol source file gt TC project file TC LARGE DEMO1 IOPORTL LIB gt port library file TC LARGE DEMO1 PCITMC12 LIB library file TC LARGE DEMO1 DEMO1 EXE OME PCI TMC12 A User Manual Ver 2 0 Sep 2002 gt demol execution file 34 5 1 1 Use D O demo 1 D O demo y step 1 connect a OME DB 16R to CON3 of OME PCI TMCI2 step 2 run DEMO1 EXE step 3 check the LEDs of OME DB 16R turn on sequentially ZS include 12 WORD pci 12 WORD WORD wBaseAddr wIrq wPLX int main IN js WORD wBoards wRetVal char c clrscr
4. pci tmc12 do 0 DOl int source gt initial low active High init interrupt old count 1 OME PCI TMC12 A User Manual Ver 2 0 Sep 2002 63 for 22 if old count int count printf nint_High count d int count old count int count if kbhit 0 c getch if c q c Q break pci tmcl2 do 1 generate a High pulse to pci tmcl2 do 0 DO1 ECLK11 J25 int source printf Generate a High interrupt pulse PTMC12 DriverClose _outpd wPLX 0x4c 0 disable all interrupt ZS WORD init interrupt DWORD dwVal int_count 0 pci tmcl12 do2 0 set IntXor OFF to non invert the int source inport wBaseAddr 0x18 pre set int signal to PC to High value to enable next interrupt operation xy disable _outpd wPLX 0x4c 0x41 channel 1 interrupt active Low if wIrq 8 irqmask inportb A1 8259 1 outportb Al 8259 1 1 amp 1 lt lt wIrq setvect wIrgt 8 irq service else irgmask inportb Al 8259 1 outportb Al 825941 irqmask amp Oxfb IRQ2 outportb Al 825941 irqmask Oxff 1 lt lt wIrq irqmask inportb A2 825941 outportb A2 8259 1 1 amp Oxff 1 lt lt wIrq 8 setvect 8 0 70 irq service enable void interrupt irq service now the int signal to is in Lo
5. Card d wBaseAddr x wIrq x wPLX x i wBaseAddr wIrq wPLX 12 GetConfigAddressSpace 0 amp wBaseAddr amp wIrg amp wPLX select _0 printf 3 Card 0 wBaseAddr x wBaseAddr printf Nn 4 start test interrupt pci tmcl2 1 DOl int source initial High active Low init interrupt old count 1 OME PCI TMC12 A User Manual Ver 2 0 Sep 2002 66 for 22 if old count int count printf nint_count d int count old count int count if kbhit 0 c getch if c q 0 break pci tmcl2 do 0 generate Low pulse to pci tmcl2 do 1 DOl ECLK11 2J25 int source printf Generate a Low interrupt pulse PTMC12 DriverClose _outpd wPLX 0x4c 0 disable all interrupt ZS WORD init interrupt DWORD dwVal int_count 0 pci 12 902 0 1000 set IntXor to invert the int source inport wBaseAddr 0x18 pre set int signal to PC to High value to enable next interrupt operation disable _outpd wPLX 0x4c 0x41 channel 1 interrupt active Low if wIrq 8 irqmask inportb Al 8259 1 outporth 1 825941 irqmask Oxff 1 lt lt wIrq setvect 8 irq service else irqmask inportb Al 8259 1 outportb Al 8259 1 irqmask amp Oxfb IRQ2 outportb Al 825941
6. printf n 3 Card 0 LED test wBaseAddr x wBaseAddr pci 12 do2 0xe000 printf nAll LED off press any key to continue getch pci 12 do2 0xc000 printf nLED1 on press any key to continue getch pci tmcl2 do2 0xa000 printf nLED2 on press any key to continue getch pci tmc12 do2 0x6000 printf NnLED3 on press any key to continue getch PTMC12 DriverClose WORD pci 12 WORD wDo outport wBaseAddr 0x14 wDo return NoError WORD pci 12 02 WORD wXor outport wBaseAddr 0x18 wXor return NoError OME PCI TMC12 A User Manual Ver 2 0 Sep 2002 56 5 15 Ndemo2 Generate 2 Clocks ndemo2 generate 2 starting clock demo step 1 all clock sources select external clock step 2 run NDEMO2 EXE step 3 read the counter value of counterl to counter12 dub include PCITMC12 H WORD wBaseAddr wIrq wPLX WORD pci 12 do WORD WORD pci tmcl2 102 WORD wXor WORD pci 12 select8254 char cChip WORD pci tmc12 cO char cConfig char cLow char cHigh WORD pci 12 cl char cConfig char cLow char cHigh WORD pci 12 c2 char cConfig char cLow char cHigh void read 0 B void read cl int B void read c2 int B int main me WORD wBoards wRetVal
7. wRetVal PTMC12 DriverInit amp wBoards printf n 1 Threr are OME PCI TMC12 Cards in this PC wBoards if wBoards 0 putch 0x07 putch 0x07 putch 0x07 printf 1 There are no OME PCI TMC12 card in this PC n exit 0 printf n 2 Show the Configuration Space of all OME PCI TMC12 for 1 0 i lt wBoards i 12 GetConfigAddressSpace i amp wBaseAddr amp wIrq amp wPLX printf nCard_ d wBaseAddr x wIrq x wPLX x i wBaseAddr wIrq wPLX 12 GetConfigAddressSpace 0 amp wBaseAddr amp wIrg amp wPLX 0 printf n 3 Card 0 D O test wBaseAddr x wBaseAddr 1 1 0 1 lt 16 i pci tmcl2 3 printf nTEST 524 gt DO x i j c getch Xf 6 07 return j j 1 if j 0 1 PTMC12 DriverClose WORD pci 12 WORD outport wBaseAddr 0x14 wDo return NoError OME PCI TMC12 A User Manual Ver 2 0 Sep 2002 35 5 2 Demo2 Use e Ifthere is only OME PCI TMC12 this program will test this only card If there are more than one OME PCI TMC12 cards installed in the PC system this program will test the second card How can you know which card is the second card Please refer to Sec 3 2 for more information demo 2 D I demo step 1 connect a CON2 am
8. 13 2 5 4 OME DB 16P Isolated Input Board The OME DB 16P is a 16 channel isolated digital input daughter board The optically isolated inputs of the OME DB 16P consist of a bi directional opto coupler with a resistor for current sensing You can use the OME DB 16P to sense DC signal from TTL levels up to 24V or use the OME DB 16P to sense a wide range of AC signals You can use this board to isolate the computer from large common mode voltage ground loops and transient voltage spike that often occur in industrial environments OME PCI TMCI2 Opto Isolated AC or DC Signal OV to 24V OME PCI TMC12 A User Manual Ver 2 0 Sep 2002 14 2 5 5 16 Relay Board The OME DB 16R 16 channel relay output board consists of 16 form relays for efficient switching of load by programmed control The relays are energized by applying 5 volt signal to the appropriated relay channel on the 20 pin flat connector There are 16 enunciator LEDs for each relay They light when their associated relays are activated To avoid overloading your PC s power supply this board provides a screw terminal for external power supply From C Relay Normal Open Normal Close Channel 16 From C Relay Relay Switching up to 0 5A at or 1A at 24DCV OME PCI TMC12 A User Manual Ver 2 0 Sep 2002 15 2 5 6 OME DB 24PR 24POR 24C OME DB 24PR 24 power relay 5A 250V OME DB 24POR 24
9. MOS relay 0 1A 350VAC OME DB 24C 24 open collector 100mA per channel 30V max The OME DB 24PR 24 channel power relay output board consists of 8 form C and 16 form electromechanical relays for efficient switching of load programmed control The contact of each relay can control a 5A load at 250ACV 30VDCV The relay is energized by applying a 5 volt signal to the appropriate relay channel on the 20 pin flat cable connector only uses 16 relays or 50 pin flat cable connector compatible to the OME DIO 24 series Twenty four enunciator LEDs one for each relay light when their associated relay 15 activated To avoid overloading your PC s power supply this board needs a 12VDC or 24VDC external power supply 20Pin cable Note To 20pin VADE Normal Open From A Relay Com OME DB 24PR 50 Pin connector compatible with OME DIO 24 48 144 20 Pin connector for 16 channel digital outputs Compatible with OME A 82X OME A 62X OME DIO 64 OME ISO DA16 DA8 Channel 16 Form A Relays 8 Form C Relays Relay switching up to 5 at 110 5A at 30DCV OME PCI TMC12 A User Manual Ver 2 0 Sep 2002 26 Pin Assignment The 1 is a 37 pin D type female connector o O p kw ae 20 02 s om pi Eee coum EXTG4 05 p pue ps Eus cours ku Ja oun
10. OME PCI TMC12 A User Manual Ver 2 0 Sep 2002 11 2 4 4 J25 Interrupt Source Selection There are five signals can be used as interrupt sources CH3 CH6 CH9 CH12 amp EXT as following CH3 comes from COUT3 output of counter 3 CH6 comes from COUT6 output of counter 6 CH9 comes from COUT output of counter 9 CH12 comes from COUT12 output of counter 12 EXT comes from ECLK11 external CLK for counter 11 from CNI SPARE no interrupt source SPARE SPARE e Interrupt source ECLK11 Interrupt source COUT6 SPARE SPARE OME PCI TMC12 A User Manual Ver 2 0 Sep 2002 2 5 Daughter Boards 2 5 1 OME DB37 The 37 is a general purpose daughter board for D sub 37 pins It is designed for easy wire connection E I xen 2 5 2 OME DN37 8 OME DN20 The OME DN 37 is a general purpose daughter board for D sub 37 pins The OME DN 20 is designed for the 20 pin flat cable They are designed for easy wire connection These boards are DIN Rail mountable OME DN 37 2 5 3 OME DB 8125 8 OME DB 8025 The OME DB 8125 is a general purpose screw terminal board It is designed for ease of wiring There is one D sub 37 pin connector amp two 20 pin flat cable headers in the OME DB 8125 The OME DB 8025 is designed for 20 pin flat cable header OME DB 8125 D sub 37 or 20 pin flat cable header OME PCI TMC12 A User Manual Ver 2 0 Sep 2002
11. delay 1 pci tmcl12 do2 0 pci tmcl12 2 0 0 pci tmcl2 do2 0 pci tmcl12 2 pci tmcl12 do2 0 for pci tmcl2 select8254 0 read 0 1 Counter 1 read_cl 2 Counter 2 read c2 3 Counter 3 pci tmcl2 select8254 1 read c0 4 Counter 4 read 1 5 Counter 5 read c2 6 Counter 6 pci tmcl2 select8254 2 read 0 7 Counter 7 read c1 8 Counter 8 read c2 9 Counter 9 pci tmcl2 select8254 3 read c0 10 Counter 10 read 1 11 Counter 11 read c2 12 Counter 12 generate one clock to all channels for testing only pci tmc12 do2 0xOfff pci tmc12 do2 0 printf Mn c getch rt fetutn PTMC12 DriverClose JE WORD pci 12 WORD outport wBaseAddr 0x14 wDo return NoError WORD pci tmcl12 02 WORD wXor outport wBaseAddr 0x18 wXor return NoError OME PCI TMC12 A User Manual Ver 2 0 Sep 2002 59 5 16 Ndemo3 New ndemo3 watchdog timer using CH 3 modified from only add 2 lines to pre set int signal to PC step 1 CLK 3 select clock2 80K step 2 925 select step 3 run ndemo3 exe ZS include PCITMC12 H define 1 8259 0x20 define 2 8259 0xA0 de
12. select 8254 chip 0 pci tmc12 c0 0x30 0x40 0x1f CH 1 mode 0 down count 8000 for outportb wBaseAddr 0x0C 0x00 latch counter 0 low inportb wBaseAddr high inportb wBaseAddr if high gt 0x20 return overflow gt time up OME PCI TMC12 A User Manual Ver 2 0 Sep 2002 39 5 5 Demod 16 bit Event Counter demo 5 16 bit event down counter step 1 CNT1 select ECLK1 JP22 step 2 run demo5 exe step 3 connect the external CNT signal to of 1 include PCITMC12 H WORD pci tmcl2 select8254 char cChip WORD pci tmcl2 cO char cConfig char cLow char cHigh WORD pci tmcl12 cl char cConfig char cLow char cHigh WORD pci tmcl2 c2 char cConfig char cLow char cHigh WORD wBaseAddr wIrq wPLX int main rnt WORD wBoards wRetVal char c unsigned int high low count clrscr wRetVal PTMC12 DriverInit amp wBoards printf Mn l Threr are 4 OME PCI TMC12 Cards in this PC wBoards if wBoards 0 putch 0x07 putch 0x07 putch 0x07 printf 1 There are no OME PCI TMC12 card in this PC n exit 0 12 GetConfigAddressSpace 0 amp wBaseAddr amp amp wPLX card 0 printf n 3 Card 0 wBaseAddr x wBaseAddr printf 4 16 bit event down counter n pci tmcl2 select8254 0 select 8254 chip 0
13. wConfigSpace i 2 wPL X save all resource of this card step3 control the OME PCI TMC12 A directly wBase wConfigSpace 0 0 get base address the card_0 outport wBase 0x14 wDoValue control the D O states of card_0 wDiValue inport wBase 0x14 read the D I states of card_0 wBase wConfigSpace 1 101 get base address of card_ 1 outport wBase 0x14 wDoValue control the D O states of card 1 wDiValue inport wBase 0x14 read the states of 1 wPLX wConfigSpace 2 2 get PCI interface base address of card 2 _outpd wPLX 0x4c 0x41 channel 1 interrupt active Low outpd wPLX 0x4c 0 disable all interrupt OME PCI TMC12 A User Manual Ver 2 0 Sep 2002 20 3 2 The Assignment of I O Address The plug amp play BIOS will assign the proper I O address to OME PCI TMC12 If there is only one OME PCI TMC12 the user can identify the board as card 0 If there are two OME PCI TMCI2 cards in the system the user will be very difficult to identify which board is card 0 The software driver can support 16 boards max Therefore the user can install 16 boards of OME PCI TMCI2 in one PC system How to find the card 0 amp card 1 The simplest way to find the card number is to use DEM10 EXE given in DOS demo program This demo program will send a value to D O and read back from If the user installs a 20 pin flat cable between CON2 amp the value rea
14. e f 1 t e The can be changed to CNT3 4 5 6 The COUT of 8 9 10 11 12 13 are directly connected to next counter without inverter So they can not be used to replace CNT1 e The 12 CNTs of TMC 12 are divided into two groups inverted group amp non inverted group The inverted group includes CNT 1 2 3 4 5 6 The non inverted group included CNT 7 8 9 10 11 12 The user has to select his proper group for different application OME PCI TMC12 A User Manual Ver 2 0 Sep 2002 47 5 10 10 Find Card Number demo 10 Find card number demo step 1 run DEMO10 EXE step 2 connect a 20 pin flat cable to CON2 amp CON3 of card_ step 3 The card number is shown in screen as TEST x7 L Si include PCITMC12 H WORD pci 12 do WORD void pci 12 di WORD wDi WORD pci 12 select8254 char cChip WORD pci 12 cO char cConfig char cLow char cHigh WORD pci 12 cl char cConfig char cLow char cHigh WORD pci tmcl2 c2 char cConfig char cLow char cHigh WORD wBaseAddr wIrq int main int WORD wBoards wRetVal char c clrscr wRetVal PTMC12 DriverInit amp wBoards printf n 1 Threr are OME PCI TMC12 Cards in this PC wBoards if wBoards 0 putch 0x07 putch 0x07 putch 0x07 printf 1 There are no OME PCI TMC12 card in this PC n exit 0 for
15. 1 Threr are OME PCI TMC12 cards in this PC wBoards if wBoards 0 putch 0x07 putch 0x07 putch 0x07 printf 1 There are no OME PCI TMC12 cards in this PC n exit 0 12 GetConfigAddressSpace 0 amp wBaseAddr amp wIrg amp wPLX card 0 printf n 3 Card 0 wBaseAddr x wBaseAddr COUNT3 0 pci tmcl2 select8254 0 select 8254 chip 0 printf n 4 show the count of low pulse n init for 77 printf nCOUNT3 d COUNT3 if kbhit 0 getch break PTMC12 DriverClose _outpd wPLX 0x4c 0 disable all interrupt JP OME PCI TMC12 A User Manual Ver 2 0 Sep 2002 49 Use to simulate the external signal The user can must set the J25 CH3 in this demo The user can set the J25 EXT in real world application WORD init DWORD dwVal disable pci tmcl2 c2 0xb6 0xff 0xff mode 3 CNT2 CH3 80K 65536 count 0 8192 sec gt high width 0 4096 sec T high width 0 4 sec low width 0 4 sec now int state l now COUT3 is High _outpd wPLX 0x4c 0x41 channel 1 interrupt active Low if wIrq lt 8 irqmask inportb Al 8259 1 outportb Al 8259 1 irgmask amp Oxff 1 lt lt wIrq setvect wIrgt 8 irq service else irqmask inportb Al 8259 1 outporthb Al 825941 irqmask
16. 27 printf press any key to stop BS for 1 0 i lt wBoards i test_card i for 4 0 1 lt 1000 i delay one ms delay 1 sec if kbhit 0 getch break PTMC12 DriverClose 73 test card int card int i j k ok PTMC12 GetConfigAddressSpace card amp wBaseAddr amp wIrq ok 1 for 1 0 1 lt 16 i pci tmcl2 do j pci tmcl2 di amp k if j k ok 0 1 1 lt lt 1 if j 0 j 1 printf nCard Number d wBaseAddr x card wBaseAddr if ok 1 printf Test OK else printf Test ERROR OME PCI TMC12 A User Manual Ver 2 0 Sep 2002 48 5 11 Demo11 Count Low Pulse demo 11 count low pulse Use CH 3 to Simulate external pulse step 1 CLK 3 select clock2 80K step 2 225 select step 3 run demoll exe ZS 1 include PCITMC12 H define 1 8259 0x20 define 2 8259 0 0 define EOI 0x20 WORD pci tmcl2 select8254 char cChip WORD pci tmcl2 cO char cConfig char cLow char cHigh WORD pci tmcl2 cl char cConfig char cLow char cHigh WORD pci tmcl2 c2 char cConfig char cLow char cHigh WORD init WORD wBaseAddr wIrqg wPLX static void interrupt irq service int COUNT3 irqmask now int state int main ine js WORD wBoards wRetVal char os DWORD dwVal clrscr wRetVal PTMC12 DriverInit amp wBoards printf n
17. char c clrscr wRetVal PTMC12 DriverInit amp wBoards printf NMn 1 Threr are OME PCI TMC12 Cards in this PC wBoards if wBoards 0 putch 0x07 putch 0x07 putch 0x07 printf 1 There are no OME PCI TMC12 card in this PC n exit 0 printf n 2 Show the Configuration Space of all OME PCI TMC12 for 1 0 i lt wBoards i PTMC12 GetConfigAddressSpace i amp wBaseAddr amp wIrq amp wPLX printf An wBaseAddr x wIrq x wPLX x i wBaseAddr wIrq wPLX 12 GetConfigAddressSpace 0 amp wBaseAddr amp wIrg amp wPLX select card 0 printf n 3 Card 0 LED test wBaseAddr x wBaseAddr initial count pci tmcl2 select8254 0 pci tmcl2 c0O 0x30 0xfe 0xff pci tmcl2 c1 0x70 0xfd 0xff pci tmcl2 c2 0xb0 0xfc 0xff pci tmcl2 select8254 1 pci 12 c0O 0x30 0xfb 0xff pci tmcl2 c1 0x70 0xfa 0xff pci tmcl2 c2 0xb0 0xf9 0xff OME PCI TMC12 A User Manual Ver 2 0 Sep 2002 57 OME PCI TMC12 A User Manual Ver 2 0 Sep 2002 56 pci 12 select8254 2 pci 12 30 pci tmcl2 1 0 70 0 pci tmcl2 c2 0xb0 0xf6 0xff pci tmcl2 select8254 3 pci 12 c0 0x30 0xf5 0xff pci tmcl2 c1 0x70 0xf4 0xff pci tmcl2 c2 0xb0 0xf3 0xff generate 2 starting clocks for all channels Counterl Counterl2
18. char cConfig char cLow char cHigh WORD pci 12 c2 char cConfig char cLow char cHigh WORD wBaseAddr wIrq wPLX int main Fn WORD wBoards wRetVal char c clrscr wRetVal PTMC12 DriverInit amp wBoards printf NMn 1 Threr are d OME PCI TMC12 Cards in this PC wBoards if wBoards 0 putch 0x07 putch 0x07 putch 0x07 printf 1 There are no OME PCI TMC12 card in this PC n exit 0 printf n 2 Show the Configuration Space of all OME PCI TMC12 for i 0 i wBoards i PTMC12 GetConfigAddressSpace i amp wBaseAddr amp wIrq amp wPLX printf NnCard wBaseAddr x wIrq x wPLX x i wBaseAddr wIrq wPLX 12 GetConfigAddressSpace 0 amp wBaseAddr amp wPLX card 0 printf n 3 0 wBaseAddr x wBaseAddr printf n 4 Square Wave Generator for CH1 to CH3 pci tmcl2 select8254 0 select 8254 chip 1 x pci tmcl2 c0 0x36 2 0 CH 1 mode 3 low 2 high 0 cout 4M pci 12 1 0 76 4 0 CH 2 mode 3 low 4 high 0 cout 2M pci 12 c2 0xb6 8 0 CH 3 mode 3 low 8 high 0 cout 1M printf n 5 Square Wave Generator for CH4 to CH6 pci tmcl2 select8254 1 select 8254 chip 2 pci 12 0 0 36 16 0 CH 4 mode 3 low 16 high 0 cout 500K pci 12 cl 0 76 32 0 CH 5 mode 3 low 32 high 0 cout 250K pci 12 c2 0
19. getch break printf nWait watchdog failure for 1 watchdog 0 printf nwatchdog is failure now break if kbhit 0 getch break PTMC12 DriverClose _outpd wPLX 0x4c 0 disable all interrupt WORD init watchdog DWORD dwVal inport wBaseAddr 0x18 pre set int signal to PC added line 1 disable refresh watchdog outpd wPLX 0x4c 0x41 channel 1 interrupt active Low if wIrq 8 irqmask inportb Al 8259 41 outportb Al 825941 irqmask Oxff 1 lt lt wIrq setvect wIrgt 8 irq service else irqmask inportb Al 8259 1 outporthb 825941 irqmask Oxfb IRQ2 outportb Al 8259 1 irqmask amp Oxff 1 lt lt wIrq irqmask inportb A2 825941 outportb A2 825941 irqmask Oxff 1 lt lt wIrq 8 setvect wIrg 8 0x70 irq service enable 80K 65536 count 0 8192 sec gt high width 0 4096 sec the user has to refresh the watchdog before 0 4 sec refresh watchdog pci 12 2 0 6 Oxff mode 3 CNT2 gt return void interrupt irq service inport wBaseAddr 0x18 pre set int signal to PC added line 2 if wIrq 8 outportb A2 8259 0x20 outportb Al 8259 0x20 OME PCI TMC12 A User Manual Ver 2 0 Sep 2002 61 OME PCI TMC12 A U
20. if wIrq 8 irqmask inportb Al 8259 41 outportb Al 825941 irqmask Oxff 1 lt lt wIrq setvect wIrg 8 irq service printf lt x gt wIrq 7 else irqmask inportb Al 8259 1 outporthb Al 8259 1 irgmask Oxfb IRQ2 outportb Al 825941 irqmask Oxff 1 lt lt wIrq irqmask inportb A2 825941 outportb A2 825941 irqmask Oxff 1 lt lt wIrq 8 setvect wIrq 8 40x70 irq service printf x wIrq enable 80K 65536 count 0 8192 sec gt high width 0 4096 sec the user has to refresh the watchdog before 0 4 sec refresh watchdog pci 12 2 0 6 Oxff mode 3 CNT2 gt return void interrupt irq service watchdog if wIrq 8 outportb A2 8259 0x20 outportb Al 8259 0x20 Refer to Sec 3 3 5 for more information OME PCI TMC12 A User Manual Ver 2 0 Sep 2002 43 5 8 8 Pulse Width Measure demo 8 Pulse Width Measure 1 119 select EXTG1 J22 select CLOCL1 8M hz step 2 connect pin20 of CON1 to pinl of CON2 step 3 connect external signal to pin20 pin19 SEH step 4 run demo8 exe the width of active high pulse will fe be shown in the screen 8 ms max 5 Jp 7 include 12 void pci tmcl2 di WORD wDi WORD pci 12 select8254 char cChip WORD pci 12 cO
21. pci tmcl2 c0 0x30 0xff 0xff CH 1 mode 0 down count ffff for outportb wBaseAddr 0x0C 0x00 latch counter 0 low inportb wBaseAddr high inportb wBaseAddr count 0xff high 256 Oxff low 42 printf nhigh x low x count u high low count if kbhit 0 getch break PTMC12 DriverClose Note1 The starting two will be used to initialize 8254 So gt Total_Count Oxffff Current_Counnt 2 Note2 If the count gt 65536 gt this 16 bit counter will be overflow So gt refer to DEMO6 for infinite bit counter OME PCI TMC12 A User Manual Ver 2 0 Sep 2002 40 5 6 Demo6 Software Counter T4 demo 6 software event down counter step 1 CNT1 select ECLK1 JP22 step 2 run demo6 exe step 3 connect the external CNT signal to pinl of CON1 include PCITMC12 H WORD pci 12 select8254 char cChip WORD pci 12 cO char cConfig char cLow char cHigh WORD pci 12 cl char cConfig char cLow char cHigh WORD pci 12 c2 char cConfig char cLow char cHigh WORD wBaseAddr wIrq wPLX float c65536 software count int main lint Xy WORD wBoards wRetVal char c s0 unsigned int high low c65536 0 50 0 clrscr wRetVal PTMC12 DriverInit amp wBoards printf n 1 Threr are d OME PCI TMC12 Cards in this PC wBoards PTMC12 GetConfigAddressSpace 0 amp
22. wBaseAddr amp wIrq amp wPLX card 0 printf n 3 0 wBaseAddr x wBaseAddr printf Nn 4 16 bit event down counter n pci 12 select8254 0 select 8254 chip 0 pci tmcl2 cO 0x30 0xff 0xff CH 1 mode 0 down count ffff for 77 outportb wBaseAddr 0x0C 0x00 latch counter 0 low inportb wBaseAddr high inportb wBaseAddr if high lt 0x80 50 1 if high gt 0x80 50 1 c65536 1 0 0 0 software count c65536 65536 0 0xff high 256 Oxff low 2 printf nhigh x low x c65536 f software count f high low c65536 software count if kbhit 0 getch break PTMC12 DriverClose Note 1 The starting two ECLK will be used to initialize 8254 Note 2 c65536 will be increment by 1 every 65536 counts Note 3 So gt Total_Count c65536 65536 Oxffff Current Counnt 2 Note 4 This software counter can be nearly infinite bits OME PCI TMC12 A User Manual Ver 2 0 Sep 2002 41 5 7 Watchdog Timer demo 7 watchdog timer using CH 3 step 1 CLK 3 select clock2 80K 924 step 2 INT select CH3 J2 step 3 run demo7 exe x7 L Si include PCITMC12 H define 1 8259 0x20 define 2 8259 0 0 define EOI 0x20 WORD pci 12 select8254 char cChip WORD pci 12 cO char cConfig char cLow char cHigh WORD pci 12 cl c
23. 0 1 61 37 29 00 FAX 33 0 1 30 57 5427 Toll Free in France 0800 466 342 e mail sales omega fr Daimlerstrasse 26 D 75392 Deckenpfronn Germany TEL 49 0 7056 9398 0 FAX 49 0 7056 9398 29 Toll Free in Germany 0800 639 7678 e mail info omega de One Omega Drive River Bend Technology Centre Northbank Irlam Manchester M44 5BD United Kingdom TEL 44 0 161 777 6611 FAX 44 0 161 777 6622 Toll Free in United Kingdom 0800 488 488 e mail sales omega co uk It is the policy of OMEGA to comply with all worldwide safety and EMC EMI regulations that apply OMEGA is constantly pursuing certification of its products to the European New Approach Directives OMEGA will add the CE mark to every appropriate device upon certification The information contained in this document is believed to be correct but OMEGA Engineering Inc accepts no liability for any errors it contains and reserves the right to alter specifications without notice WARNING These products are not designed for use in and should not be used for patient connected applications OME PCI TMC12 A User Manual OME PCI TMC12 A User Manual Ver 2 0 Sep 2002 Tables of Contents 1 1 INTRODUG TION NEE 4 1 1 2 Baht BARA GRRE d t 5 1 2 PRODUCT CHECK LIST ccccccccccecsessssececececeessaececccecsensasseeececseneaaeeeeeescsesesaseeececeesenseaeeeeecs 5 2 HARDWARE CONFIGURATION eee ee ee ee
24. 2 5 8 DEMOS PULSE WIDTH MEASURE 44 5 9 DEMO9 FREQUENCY M AsuUnp eset ente tn anas s 00 46 5 10 DEMO10 FIND CARD 2 0002600000101000000000000100000 0 48 5 11 DEMO 11 COUNT LOW PULSE dE tete 49 5 12 DEMO 2 LOW PULSE WIDTH Ote E EE 51 OME PCI TMC12 A User Manual Ver 2 0 Sep 2002 2 5 13 DEMO13 HIGH PULSE WIDTH 5 14 NDEMOL USING 5 15 NDEMO2 GENERATE 2 5 16 NDEMO3 NEW DEMO nennen rennen 5 17 NDEMO4 ACTIVE HIGH 5 18 NDEMOS5 ACTIVE LOW OME PCI TMC12 A User Manual Ver 2 0 Sep 2002 HES 1 Introduction e The OME PCI TMCI2 A is general purpose counter timer and digital I O card PC AT compatible PCI bus On board four 8254 chips e 5 different interrupt sources 4 internal 1 external jumper selectable e Flexible clock sources and gate control signals selectable e 2 stable internal clock sources CLOCK1 8M 1 6M CLOCK2 0 8M 80K jumper selectable e 12 external clock sources e 12 external gate control signals 16 bits general purpose TTL compatible D O or relay with daughter board OME DB 16R or OME DB 24PR 16 bits general propose TTL compatible or isolated input with daughter board OME DB 16P e 12 independent 16 bits timer counter All signals are TTL compatible e
25. 6 count 0 8192 sec gt high width 0 4096 sec high width 0 4 sec low width 0 4 sec pci 12 c0 0x36 0 32 CH 1 mode 3 low 0 high 32 cout 1K _outpd wPLX 0x4c 0x41 channel 1 interrupt active Low now int state 1 now int signal is High Wi if wIrq 8 irqmask inportb Al 825941 outportb Al 8259 1 irqmask amp Oxff 1 lt lt wIrq setvect wIrq 8 irq service else irqmask inportb Al 8259 1 outporthb Al 825941 irqmask Oxfb IRQ2 outportb 1 8259 1 irgmask amp Oxff 1 lt lt wIrq irqmask inportb A2 8259 1 outportb A2 8259 1 irgmask amp Oxff 1 lt lt wIrq 8 setvect wIrg 8 0x70 irq service enable void interrupt irq service if now int state 0 COUNT3 find a high pulse if COUNT3 2 start to down count pci tmcl2 c1 0x70 0xff 0xff CH 2 mode 0 down count ffff _outpd wPLX 0x4c 0x41 channel 1 interrupt active Low now int state 1 now int signal is High OME PCI TMC12 A User Manual Ver 2 0 Sep 2002 54 else COUNT3 find a low pulse if COUNT3 3 stop the down count amp read count outportb wBaseAddr 0x0C 0x40 latch counterl CNT L inportb wBaseAddr 0x04 H inportb wBaseAddr 0x04 _outpd wPLX 0x4c 0 disable all interrupt else outpd wPLX 0x4c 0x43 channel 1 interrupt active High now int stat
26. 8254 chip 0 pci tmcl2 c0 0x30 0xff 0xff CH 1 mode 0 down count ffff while inport wBaseAddr 0x14 amp 1 7 0 wait while inport wBaseAddr 0x14 amp 1 0 wait EXGl Low outportb wBaseAddr 0x0C 0x00 latch counter 0 low inportb wBaseAddr high inportb wBaseAddr count 0xff high 256 Oxff low 2 ms 0 000125 float count printf nhigh x low x count d Sf ms high low count ms PTMC12 DriverClose 8M Pulse Width External signal e N number of down count in CNT1 8M clock e Pulse width 8M width N AY NUS s OME PCI TMC12 A User Manual Ver 2 0 Sep 2002 45 59 Demo9 Frequency Measure demo 9 Signal Frequency Measur step 1 J19 select EXTG1 J22 select CLOCL1 8M hz step 2 920 select NCOUT1 J23 select ECLK2 step 3 connect external signal to pin21 pinl9 step 4 run demo9 exe the frequency of input signal will fe be shown in the screen 125 Hz min Jp t include PCITMC12 H void pci tmcl2 di WORD wDi WORD pci 12 select8254 char cChip WORD pci 12 cO char cConfig char cLow char cHigh WORD pci 12 cl char cConfig char cLow char cHigh WORD pci 12 c2 char cConfig char cLow char cHigh WORD wBaseAddr wIrq wPLX int main int 2 7 5 WORD wBoards wRetVal char c cc 80 unsigned int hig
27. OME PCI TMC12 A User Manual Ver 2 0 Sep 2002 9 2 4 2 CLK1 to CLK12 select CLOCK1 select CLOCK2 select COUTn 1 select external CLKn from CN1 Select 2 Select CLOCK bd CLOCK2 5 6 QV Select CLK1 12 jumper Select sources CLKI JP22 CLOCK1 CLOCK2 COUT6 ECLK1 CLK2 JP23 CLOCK1 CLOCK2 COUTI ECLK2 CLK3 JP24 CLOCK1 CLOCK2 COUT2 ECLK3 CLK4 JP13 CLOCK1 CLOCK2 COUT3 ECLK4 CLK5 JP14 CLOCK1 CLOCK2 COUT4 ECLK5 CLK6 JP15 CLOCKI CLOCK2 COUTS ECLK6 CLK7 JP10 CLOCK1 CLOCK2 COUT12 ECLK7 CLK8 CLOCK1 CLOCK2 COUT7 ECLK8 CLK9 JP12 CLOCK1 CLOCK2 COUT8 ECLK9 CLK10 CLOCK1 CLOCK2 COUT9 ECLK10 CLK11 JP2 CLOCK1 CLOCK2 COUT10 ECLK11 CLK12 JP3 CLOCK1 CLOCK2 COUT11 ECLK12 OME PCI TMC12 A User Manual Ver 2 0 Sep 2002 10 2 4 3 GATE1 GATE12 3 3 1 1 GATEn EXTGn GATEn Inverted COUTn 1 GATE Jumper Select source GATEI 19 Inverted COUT6 EXTGI GATE2 J20 Inverted COUTI EXTG2 GATE3 J21 Inverted COUT2 EXTG3 GATE4 J16 Inverted COUT3 EXTG4 GATES J17 Inverted COUTA 5 GETE6 J18 Inverted COUT5 EXTG6 3 3 1 1 GATEn EXTGn GATEn COUTn 1 GATE Jumper Select source GATE7 J7 COUT12 EXTG7 GATES J8 COUT7 EXTG8 GATE9 J9 COUTS EXTG9 GATEIO 79 EXTG10 5 COUT10 EXTGI 1 GETEI2 6 COUTII EXTG12
28. Operating Temperature 0 C to 60 C e Storage Temperature 20 C to 80 C e Humidity 0 to 90 RH non condensing e Dimension 150mm X 105mm Power Consumption 5 500mA Note PCI TMC12 A OME PCI TMCI2 or OME PCI TMCI2A OME PCI TMC12 A User Manual Ver 2 0 Sep 2002 4 1 1 OME PCI TMC12 A All old programs designed OME PCI TMC 12 can be executed on OME PCI TMC12A without any modification OME PCI TMCI2A provides additional features to 12 refer to Sec 3 4 for more information 1 2 Product Check List In addition to this manual the package includes the following items OME PCI TMCI2 A card Onecompanion CD for software driver amp related documents Attention If any of these items are missing or damaged contact Omega Engineering immediately Save the shipping materials and the box in case you want to ship or store the product OME PCI TMC12 A User Manual Ver 2 0 Sep 2002 5 Hardware configuration 2 Board Layout 2 1 OMEPCI TMC12 OME PCI TMC12A LEDI LED2 LED3 N o2 lt lt lt lt N 2 LA lt lt lt lt 2 ON oo 2 N N 2 p N N N 92 oy N gt 2 PCI BUS Note J28 LED1 LED2 amp LED3 are de
29. Oxfb IRQ2 outportb Al 825941 irqmask Oxff 1 lt lt wIrq irqmask inportb A2 825941 outportb A2 8259 1 irgmask amp Oxff 1 lt lt wIrq 8 setvect wIrg 8 0x70 irq service enable void interrupt irq service if now int state 0 old state low gt change to high now now int state 1 outpd wPLX 0x4c 0x41 find a high_pulse here now int signal is High channel 1 interrupt active Low else old state high gt change to low now find low pulse now int state 0 now int signal is low COUNT3 only count low pulse _outpd wPLX 0x4c 0x43 channel 1 interrupt active High if wIrq 8 outportb A2 8259 0x20 outportb 1 8259 0x20 Refer to Sec 3 3 5 for more information OME PCI TMC12 A User Manual Ver 2 0 Sep 2002 50 5 12 Demo12 Low Pulse Width demo 12 detect the pulse width of low pulse Use 3 to Simulate external pulse step 1 CLK 3 select clock2 80K simulate ext signal step 2 CLK 1 select clock1 8M gt generate BASE clock step 3 CLK 2 select COUT1 1K measure pulse width step 4 J25 select CH3 step 5 run 12 S include PCITMC12 H define 1 8259 0x20 define 2 8259 0 0 define EOI 0x20 WORD pci tmcl2 1 8254 char cChip WORD pci tmcl2 cO
30. Refer to Sec 3 1 for more information about wBase D0 0 D1 0 8254 chip 1 is active D0 1 D1 0 8254 chip 2 is active D0 0 D1 1 8254 chip 3 is active 00 1 D1 1 8254 chip 4 is active outportb wBase 0x10 0 select the 8254 chip 1 CNT1 CNT3 outportb wBase 0x10 2 select the 8254 chip 3 CNT10 CNT12 OME PCI TMC12 A User Manual Ver 2 0 Sep 2002 22 3 3 2 8254 Timer Counter Control There are four 8254 chips in OME PCI TMC12 A card Only one 8254 is active at any instant Before using the active 8254 use wBase 0x10 to select the active The 8254 has 4 registers from wBase 0 through wBase 0x0C For detailed programming information about 8254 please refer to Chapter 4 amp Intel s Microsystem Components Handbook Actie 8254 Counter 0 Active 8254 Counter 0 lwBaset4 _ Active 8254 Counter 1 Active 8254 Counter 1 lwBaset8 Active 8254 Counter 2 Active 8254 Counter 2 wBase 0x0C Active 8254 Control word Active 8254 Control word Note Refer to Sec 3 1 for more information about wBase 3 3 3 Digital Input READ wBase 0x14 read the digital input channel 0 to 15 Note Refer to Sec 3 1 for more information about wBase wDiValue inport wBase 0x 14 read the states OME PCI TMC12 A User Manual Ver 2 0 Sep 2002 23 3 3 4 Digital Output WRITE wBase 0x14 set the digital output channel 0 to 15 DO7 205 DO4 DO3 DO2 DOI pois
31. Systems A Totalizers amp Batch Controllers pH CONDUCTIVITY Ir pH Electrodes Testers amp Accessories A Benchtop Laboratory Meters Controllers Calibrators Simulators amp Pumps 4 Industrial amp Conductivity Equipment DATA ACQUISITION Data Acquisition Engineering Software 4 Communications Based Acquisition Systems 4 Plug in Cards for Apple IBM amp Compatibles Datalogging Systems A Recorders Printers amp Plotters HEATERS Heating Cable UA Cartridge amp Strip Heaters A Immersion amp Band Heaters Flexible Heaters A Laboratory Heaters ENVIRONMENTAL MONITORING AND CONTROL Metering amp Control Instrumentation 4 Refractometers Pumps amp Tubing A Air amp Water Monitors Industrial Water amp Wastewater Treatment pH Conductivity Dissolved Oxygen Instruments M4041 0104
32. Users Guide omega Shop online at www omega com e mail info omega com OME TMC12 A PCI Bus Digital I O Board Hardware Manual omega com CEOMEGA OMEGAnet Online Service Internet e mail www omega com info omega com USA ISO 9001 Certified Canada Servicing North America One Omega Drive P O Box 4047 Stamford CT 06907 0047 TEL 203 359 1660 FAX 203 359 7700 e mail info omega com 976 Bergar Laval Quebec H7L 5A1 Canada TEL 514 856 6928 FAX 514 856 6886 e mail info omega ca For immediate technical or application assistance USA and Canada Mexico Benelux Czech Republic France Germany Austria United Kingdom ISO 9002 Certified Sales Service 1 800 826 6342 1 800 TC OMEGA Customer Service 1 800 622 2378 1 800 622 BEST Engineering Service 1 800 872 9436 1 800 USA WHEN TELEX 996404 EASYLINK 62968934 CABLE OMEGA En Espa ol 001 203 359 7803 e mail espanol omega com FAX 001 203 359 7807 info omega com mx Servicing Europe Postbus 8034 1180 LA Amstelveen The Netherlands TEL 31 0 20 3472121 FAX 31 0 20 6434643 Toll Free in Benelux 0800 0993344 e mail sales amp omegaeng nl Frystatska 184 733 01 Karvin Czech Republic TEL 420 0 59 6311899 FAX 420 0 59 6311114 Toll Free 0800 1 66342 e mail info omegashop cz 11 rue Jacques Cartier 78280 Guyancourt France TEL 33
33. as PURCHASED of the repair 2 Model and serial number of the product under 2 Model and serial number of the product and warranty and 3 Repair instructions and or specific problems 3 Repair instructions and or specific problems relative to the product relative to the product OMEGA s policy is to make running changes not model changes whenever an improvement is possible This affords our customers the latest in technology and engineering OMEGA is a registered trademark of OMEGA ENGINEERING INC Copyright 2002 OMEGA ENGINEERING INC rights reserved This document may not be copied photocopied reproduced translated or reduced to any electronic medium or machine readable form in whole or in part without the prior written consent of OMEGA ENGINEERING INC Where Do Find Everything 1 Need for Process Measurement and Control OMEGA Of Course Shop online at www omega com TEMPERATURE Thermocouple RTD amp Thermistor Probes Connectors Panels amp Assemblies Wire Thermocouple RTD amp Thermistor A Calibrators amp Ice Point References 4 Recorders Controllers amp Process Monitors A Infrared Pyrometers PRESSURE STRAIN AND FORCE Transducers amp Strain Gages Ip Load Cells amp Pressure Gages Displacement Transducers A Instrumentation amp Accessories FLOW LEVEL 4 Rotameters Gas Mass Flowmeters amp Flow Computers A Air Velocity Indicators A Turbine Paddlewheel
34. char cConfig char cLow char cHigh WORD pci 12 cl char cConfig char cLow char cHigh WORD pci 12 c2 char cConfig char cLow char cHigh WORD wBaseAddr wIrq wPLX int main int 2 7 5 WORD wBoards wRetVal char c cc 80 unsigned int high low count float ms clrscr wRetVal PTMC12 DriverInit amp wBoards printf NMn 1 Threr are OME PCI TMC12 Cards in this PC wBoards if wBoards 0 putch 0x07 putch 0x07 putch 0x07 printf 1 There are no OME PCI TMC12 card in this PC n exit 0 printf n 2 Show the Configuration Space of all OME PCI TMC12 1 0 i wBoards i 12 GetConfigAddressSpace i amp wBaseAddr amp wIrq amp wPLX printf Mn Card 54 wBaseAddr x wIrq x wPLX x i wBaseAddr wIrq wPLX 12 GetConfigAddressSpace 0 amp wBaseAddr amp wPLX card 0 printf 3 Card 0 wBaseAddr x wBaseAddr printf Nn 4 read amp show 80 read n wBaseAddr for i20 i 80 i pci tmcl2 di amp k cc i k for 0 1 lt 80 i j cc i amp 0 01 if j 0 printf 0 else printf 1 OME PCI TMC12 A User Manual Ver 2 0 Sep 2002 44 while inport wBaseAddr 0x14 amp 1 7 0 wait EXG1 High while inport wBaseAddr 0x14 51 1 0 wait EXGl Low pci tmcl2 select8254 0 select
35. char cConfig char cLow char cHigh WORD pci tmcl2 cl char cConfig char cLow char cHigh WORD pci tmcl2 c2 char cConfig char cLow char cHigh WORD init WORD wBaseAddr wIrq wPLX static void interrupt irq service int COUNT3 WIDTH3 CNT H CNT L irqmask now int state int main int 1 3 WORD wBoards wRetVal count char c DWORD dwVal float low pulse width clrscr wRetVal PTMC12 DriverInit amp wBoards printf n 1 Threr are OME PCI TMC12 Cards in this PC wBoards if wBoards 0 putch 0x07 putch 0x07 putch 0x07 printf 1 There are no OME PCI TMC12 card in this PC n 1 0 12 GetConfigAddressSpace 0 amp wBaseAddr amp wIrg amp wPLX 0 printf n 3 Card 0 wBaseAddr x wBaseAddr printf n 4 detect the pulse width of low pulse pci tmcl2 select8254 0 select 8254 0 for printf npress any key to continue Q to stop c getch if 4 c Q goto ret label COUNT3 0 indt while COUNT3 lt 4 if kbhit 0 getch break OME PCI TMC12 A User Manual Ver 2 0 Sep 2002 51 count Oxff CNT_H 256 1 2 COUTO 1 ms low pulse width float count 1 0 printf NnCNT H x L x Low pulse f CNT H CNT L low pulse width ret_label PTMC12 DriverCl
36. d from D I will be the same as D O The operation steps are given as following 1 Remove all 20 pin flat cable between CON2 and CON3 2 Install all OME PCI TMC12 cards into this PC system 3 Power on and run DEMIO EXE 4 Now all D I values will be different from the D O values 5 Install a 20 pin flat cable into CON2 amp of any OME PCI TMCI2 card 6 There will be one card s D I value D O value the card number is also show in screen Therefore the user can find the card number if he install a 20 pin flat cable into OME PCI TMC12 sequentially OME PCI TMC12 A User Manual Ver 2 0 Sep 2002 21 3 3 The Address The I O address of OME PCI TMC12 A is automatically assigned by the main board ROM BIOS The I O address can also be re assigned by user It is strongly recommended to the user to not change the I O address The plug amp play BIOS will assign proper I O address to each OME PCI TMC12 A The hardware I O ports are described as following wBase 0 wBaser8 wBase 0x18 control of OME PCI Interrupt clear of OME PCI TMCI2A 2 Note Refer to Sec 3 1 for more information about wBase 3 3 1 Select the active 8254 chip 1 2 3 4 There are four 8254 chips in OME PCI TMC12 A card Only one 8254 is active at the same time Before using the active 8254 use wBase 0x10 to select the active 8254 WRITE wBase 0x10 select the active 8254 chip x k k k k Note
37. e 0 now int signal is Low if wlIrq 8 outportb A2 8259 0x20 outportb 1 8259 0x20 a Initial Low START CNT2 N down count of CNT2 Clock 1 ms Width of high pulse N 1 ms 8M High BASE Refer to Sec 3 3 5 for more information OME PCI TMC12 A User Manual Ver 2 0 Sep 2002 55 5 14 1 Using LEDs ndemol LED1 LED2 LED3 demo step 1 default shipping of OME PCI TMC12A step 2 run NDEMO1 EXE step 3 the LED1 2 3 of TMC12A will turn on sequentially finclude PCITMC12 H WORD pci 12 do WORD WORD pci 12 do2 WORD wXor WORD wBaseAddr wIrq wPLX int main Int E WORD wBoards wRetVal char cs clrscr wRetVal PTMC12 DriverInit amp wBoards printf n 1 Threr are OME PCI TMC12 cards in this PC wBoards if wBoards 0 putch 0x07 putch 0x07 putch 0x07 printf 1 There are no OME PCI TMC12 cards in this PC n exit 0 printf n 2 Show the Configuration Space of all OME PCI TMC12 for i 0 i lt wBoards i 12 GetConfigAddressSpace i amp wBaseAddr amp wIrq amp wPLX printf n 54 wBaseAddr x wIrq x wPLX x i wBaseAddr wlrq wPLX 12 GetConfigAddressSpace 0 amp wBaseAddr amp wIrg amp wPLX select card 0
38. ect how many OME PCI TMC12 A cards in the system It is implemented based on the PCI plug amp play mechanism It will find all OME PCI TMC12 A cards installed in this system amp save all their resource in the library wBoard 1 gt only OME PCI TMC12 A in this PC system wBoard 2 2 there are two OME PCI TMC12 A in this PC system 2 PTMCI2 GetConfigAddressSpace wBoardNo wBase wIrq wPLX The user can use this function to save resource of all OME PCI TMCI2 A installed in this system Then the application program can control all functions of OME PCI TMC12 A directly wBoardNo 0 to gt totally N 1 cards of OME PCI TMCI2 A wBase gt base address of the board control word gt allocated IRQ channel number of this board wPLX gt base address of PCI interface IC OME PCI TMC12 A User Manual Ver 2 0 Sep 2002 19 The sample program source is given as following stepl detect all OME PCI TMC12 A card first wRetVal PTMC12_DriverInit amp wBoards printf Threr are d OME PCI TMC12 Cards in this PC n wBoards step2 save resource of all OME PCI TMC12 A cards installed in this PC for i 0 i lt wBoards i 12 GetConfigAddressSpace 1 amp wBase amp wlrq amp wPL X printf nCard 94 wBase x wIrq ox wPLX x i wBase wlrq wPLX wConfigSpace 1 0 7wBaseA ddress save all resource of this card wConfigSpace i 1 wlrq save all resource of this card
39. ed Then they are used to generate single clock for testing In general these Xor bits are designed for generation of 2 starting clocks only OME PCI TMC12 A User Manual Ver 2 0 Sep 2002 29 3 4 4 Block Diagram of Interrupt System The block diagram of interrupt system in OME PCI TMC12 is given as follows CH3 CH6 CH9 CH12 EXT SPARE J25 default select no int CH3 CH6 CH9 CH12 PCI Interface Controller TMC 12A J28 default select TMC 12 EXT SPARE XorInt Control bit Sec 3 4 3 Inport from wBase 0x18 to pre set Q to Pre Set High Note in software demo program Q int signal to PC refer to Sec 5 16 Sec 5 17 amp Sec 5 18 for demo program OME PCI TMC12 A User Manual Ver 2 0 Sep 2002 30 The interrupt mechanism of OME PCI TMC12 can be active Low or active High And the interrupt system of PCI bus is level trigger So the Windows driver of OME PCI TMC12 must create a thread to handle all interrupt active conditions There are so many possible conditions and hence could affect the interrupt performance The new interrupt mechanism of OME PCI TMC12A is designed to improve the performance of Windows driver as follows initial subroutine amp ISR will inport from wBase 0x18 to pre set int signal to PC in Sec 3 4 4 to High state to enable the next interrupt operation if the initial value of interrupt source is Low set XorInt to 0 risin
40. fine EOI 0x20 WORD pci 12 select8254 char cChip WORD pci 12 0 cConfig char cLow char cHigh WORD pci 12 cl char cConfig char cLow char cHigh WORD pci 12 c2 char cConfig char cLow char cHigh WORD init watchdog WORD wBaseAddr wIrq wPLX static void interrupt irq service int watchdog irqmask int main WORD wBoards wRetVal char c DWORD dwVal clrscr wRetVal PTMC12 DriverInit amp wBoards printf n 1 Threr 24 OME PCI TMC12 Cards in this PC wBoards if wBoards 0 putch 0x07 putch 0x07 putch 0x07 printf 1 There are no OME PCI TMC12 card in this PC n exit 0 printf n 2 Show the Configuration Space of all OME PCI TMC12 for 1 0 i lt wBoards i 12 GetConfigAddressSpace i amp wBaseAddr amp wIrq amp wPLX printf Card 54 wBaseAddr x wIrq x wPLX x i wBaseAddr wIrq wPLX 12 GetConfigAddressSpace 0 amp wBaseAddr amp wIrg amp wPLX select card 0 printf Nin 3 0 wBaseAddr x wBaseAddr watchdog 0 pci 12 select8254 0 select 8254 chip 0 printf n 4 start refresh watchdog n init watchdog OME PCI TMC12 A User Manual Ver 2 0 Sep 2002 60 for refresh watchdog printf npress any key to simulate PC fail watchdog d watchdog if kbhit 0
41. g edge interrupt if the initial value of interrupt source is High set XorInt to 1 gt falling edge interrupt the software driver is designed for rising edge or falling edge interrupt When the interrupt ISR is executed the int signal to PC Q in Sec 3 4 4 is in Low state so the interrupt ISR must inport from 0 18 to pre set int signal to PC to High state to enable next interrupt operation Refer to Sec 5 16 Sec 5 17 amp Sec 5 18 for demo program 3 4 5 New Demo Program New demo program 1 How to Use Status Indicators LEDs Refer to Sec 5 14 Ndemol Using LEDs New demo program 2 How to Generate the Starting 2 Clocks for 8254 Refer to Sec 5 15 Ndemo2 Generate 2 Clocks New demo program 3 gt Modify demo designed for 12 to fit the new interrupt mechanism of OME PCI TMC12A Refer to Sec 5 16 Ndemo3 New Demo7 New demo program 4 2 interrupt source initial low active High Refer to Sec 5 17 Ndemo4 Active Low Int New demo program 5 interrupt source initial High active low Refer to Sec 5 18 Ndemo5 Active High Int OME PCI TMC12 A User Manual Ver 2 0 Sep 2002 31 4 4 1 8254 Programming Control Word Format D7 D6 05 04 D3 D2 DI DO SCO RWI RWO M2 1 MO BCD SCO Description 0 0 Selec
42. gnal is active Low 15 sub If now_int_state 0 old state low gt change to high now now_int_state 1 now int_signal is High application codes are given here _outpd wPLX 0x4c 0x41 active Low else old state high gt change to low now now_int_state 0 now int_signal is Low codes given here _outpd wPLX 0x4c 0x43 active High if wIrq 8 outportb A2 8259 0x20 outportb Al 8259 0x20 OME PCI TMC12 A User Manual Ver 2 0 Sep 2002 25 Example 2 assume initial level Low Initial Low Initial sub now int state 0 _outpd wPLX 0x4c 0x43 INT signal is ISR_sub If now_int_state 0 old state low gt change to high now now_int_state 1 now int_signal is High E application codes are given here _outpd wPLX 0x4c 0x41 active Low zy else old state high gt change to low now now_int_state 0 now int_signal is Low application codes are given here _outpd wPLX 0x4c 0x43 active High if wIrq 8 outportb A2 8259 0x20 ee outportb 1 8259 0x20 So ISR sub will be active on rising edge amp falling edge of the interrupt signal Refer to demo7 c demol1 c 12 4 13 for more information OME PCI TMC12 A User Manual Ver 2 0 Sep 2002 26 3 4 New feat
43. h low count cout0 float f t clrscr wRetVal PTMC12 DriverInit amp wBoards printf NMn 1 Threr are OME PCI TMC12 Cards in this PC wBoards if wBoards 0 putch 0x07 putch 0x07 putch 0x07 printf 1 There are no OME PCI TMC12 card in this PC n exit 0 12 GetConfigAddressSpace 0 amp wBaseAddr amp wPLX card 0 printf 3 0 wBaseAddr x wBaseAddr printf n 4 frequency must be gt 125 Hz n wBaseAddr pci 12 select8254 0 select 8254 chip 0 xy pci tmcl12 c0 0x30 0xff 0xff CH 1 mode 0 down count ffff pci tmc12 c1 0x70 0xff 0xff CH 2 mode 0 down count ffff for 27 outportb wBaseAddr 0x0C 0 2 latch status of counterO0 low inportb wBaseAddr high inportb wBaseAddr cout0 low amp 0x80 if cout0 20 break if kbhit 0 getch break outportb wBaseAddr 0x0C 0x40 latch counter 1 low inportb wBaseAddr 0x04 high inportb wBaseAddr 0x04 count 0xff high 256 Oxff low 2 OME PCI TMC12 A User Manual Ver 2 0 Sep 2002 46 COUTO 65536 0 000125 8 192 t 8 192 float count ms f 1 0 t 1000 0 f 1 T printf nhigh x low x count d frequency f Hz high low count f PTMC12 DriverClose External signal e Down_count2 number of down count in CNT2 e t T Down count2
44. har cConfig char cLow char cHigh WORD pci 12 c2 char cConfig char cLow char cHigh WORD init watchdog WORD wBaseAddr wIrq wPLX static void interrupt irq service int watchdog irqmask int main int 447 WORD wBoards wRetVal char DWORD dwVal clrscr wRetVal PTMC12 DriverInit amp wBoards printf n 1 Threr are d OME PCI TMC12 cards in this PC wBoards if wBoards 0 putch 0x07 putch 0x07 putch 0x07 printf 1 There are no OME PCI TMC12 cards in this PC n exit 0 12 GetConfigAddressSpace 0 amp wBaseAddr amp wPLX card 0 printf 3 0 wlIrq x wPLX x wIrq wPLX watchdog 0 pci 12 select8254 0 select 8254 chip 0 Wi printf n 4 start refresh watchdog n init watchdog for refresh watchdog printf npress any key to simulate PC fail watch d watchdog if kbhit 0 getch break printf nWait watchdog failure OME PCI TMC12 A User Manual Ver 2 0 Sep 2002 42 LANA for if watchdog 0 printf nwatchdog is failure now break if kbhit 0 getch break PTMC12 DriverClose _outpd wPLX 0x4c 0 disable all interrupt Ki WORD init watchdog DWORD dwVal disable refresh watchdog _outpd wPLX 0x4c 0x41 channel 1 interrupt active Low
45. his WARRANTY is VOID if the unit shows evidence of having been tampered with or shows evidence of having been damaged as a result of excessive corrosion or current heat moisture or vibration improper specification misapplication misuse or other operating conditions outside of OMEGA s control Components which wear are not warranted including but not limited to contact points fuses and triacs OMEGA is pleased to offer suggestions on the use of its various products However OMEGA neither assumes responsibility for any omissions or errors nor assumes liability for any damages that result from the use of its products in accordance with information provided by OMEGA either verbal or written OMEGA warrants only that the parts manufactured by it will be as specified and free of defects OMEGA MAKES NO OTHER WARRANTIES OR REPRESENTATIONS OF ANY KIND WHATSOEVER EXPRESS OR IIVIPLIED EXCEPT THAT OF TITLE AND ALL IMPLIED WARRANTIES INCLUDING ANY WARRANTY OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE HEREBY DISCLAIMED LIMITATION OF LIABILITY The remedies of purchaser set forth herein are exclusive and the total liability of OMEGA with respect to this order whether based on contract warranty negligence indemnification strict liability or otherwise shall not exceed the purchase price of the component upon which liability is based In no event shall OMEGA be liable for consequential incidental or special damages CONDITIONS Equip
46. irqmask Oxff 1 lt lt wIrq irqmask inportb A2 8259 41 outportb A2 825941 irqmask Oxff 1 lt lt wIrq 8 setvect wIrq 8 0x70 irq service enable void interrupt irq service now the int signal to is in Low state inport wBaseAddr 0x18 pre set int signal to pc to High value to enable next interrupt operation x int_count if wIrq 8 outportb A2 8259 0x20 outportb A1 8259 0x20 OME PCI TMC12 A User Manual Ver 2 0 Sep 2002 67 WARRANTY DISCLAIMER OMEGA ENGINEERING INC warrants this unit to be free of defects in materials and workmanship for a period of 13 months from date of purchase OMEGA s WARRANTY adds additional 1 month grace period to the normal one 1 year product warranty to cover handling and shipping time This ensures that OMEGA s customers receive maximum coverage on each product If the unit malfunctions it must be returned to the factory for evaluation OMEGA s Customer Service Department will issue an Authorized Return AR number immediately upon phone or written request Upon examination by OMEGA if the unit is found to be defective it will be repaired or replaced at no charge OMEGA s WARRANTY does not apply to defects resulting from any action of the purchaser including but not limited to mishandling improper interfacing operation outside of design limits improper repair or unauthorized modification T
47. mation Referto new demo programs given in Sec 3 4 5 for using these new features Referto Sec 2 1 for PCB layout of OME PCI TMCI2A OME PCI TMC12 A User Manual Ver 2 0 Sep 2002 27 3 4 2 Clock input of 8254 Select Clock source Sec 2 4 3 default select clock1 The clock input of 8254 chips in OME PCI TMC12A is given as follows Xor control Register Sec 3 4 3 Select Clock source Xor logic Clock input default select clock1 The new features of OME PCI TMC12A are given as follows A schmidt trigger buffer is added to remove noises in the selected clock source Xor control register is added to invert non inverted the selected clock source This mechanism can be used to generate 2 extra starting clocks to 8254 Note The Xor control register is clear to 0 when the OME PCI TMCI2A is first power up So the initial state of OME PCI TMCI2A is exactly compatible to OME PCI TMC12 Refer to Sec 5 15 Ndemo2 Generate 2 Clocks the twelve Xor bits are used to generate the 2 starting clocks So the initial value of 8254 can be verified after these 2 starting clocks are generated Then they are used to generate one single clock for testing In general these Xor bits are designed for generation of 2 starting clocks only OME PCI TMC12 A User Manual Ver 2 0 Sep 2002 28 3 4 3 Xor control Register of OME PCI TMC12A WRITE wBase 0x18 set the Xor control register N
48. ment sold by OMEGA is not intended to be used nor shall it be used 1 as a Basic Component under 10 CFR 21 NRC used in or with any nuclear installation or activity or 2 in medical applications or used on humans Should any Product s be used in or with any nuclear installation or activity medical application used on humans or misused in any way OMEGA assumes no responsibility as set forth in our basic WARRANTY DISCLAIMER language and additionally purchaser will indemnify OMEGA and hold OMEGA harmless from any liability or damage whatsoever arising out of the use of the Product s in such a manner RETURN REQUESTS INQUIRIES Direct all warranty and repair requests inquiries to the OMEGA Customer Service Department BEFORE RETURNING ANY PRODUCT S TO OMEGA PURCHASER MUST OBTAIN AN AUTHORIZED RETURN AR NUMBER FROM OMEGA S CUSTOMER SERVICE DEPARTMENT IN ORDER TO AVOID PROCESSING DELAYS The assigned AR number should then be marked on the outside of the return package and on any correspondence The purchaser is responsible for shipping charges freight insurance and proper packaging to prevent breakage in transit FOR WARRANTY RETURNS please have the FOR NON WARRANTY REPAIRS consult OMEGA following information available BEFORE for current repair charges Have the following contacting OMEGA information available BEFORE contacting OMEGA 1 Purchase Order number under which the product 1 Purchase Order number to cover the COST w
49. ne 6 2 1 EEN E WEE 6 2 2 COUNTER ARCHITECTURE EE 7 2 3 DA O DIAGRAM dacd 8 2 4 LEINER LEE 9 2 5 DAUGHTER Boapng 13 2 6 EI 17 3 UO CONTROEZREGISTER 26500505 19 3 1 HOW FIND THE Ampprsgs entere ener nnns 19 3 2 THE ASSIGNMENT OF 21 3 3 THE ADDRESS 22 3 4 NEW FEATURES OF 27 4 8254 PROGRAMMING Yo 32 4 1 CONTROL WORD FORMAT 32 4 2 COUNTER LATCH COMMAND 33 4 3 READ BACK COMMAND 252 33 4 4 STATUS BYTE FORMAT iiti stie epe ire Ege 33 5 DEMO PROGRAM L 34 5 1 IDEMOT USED Qs a te ettet tti 35 5 2 USE RA 36 5 3 DEMO3 WAVE GENERATOR 37 5 4 DEMOA DELAY ONE ger e Eege 39 5 5 DEMOS 16 BIT EVENT COUNTER seen entere nasse eret nenas 40 5 6 DEMO6 SOFTWARE COUNTER 41 5 7 WATCHDOG TIMER er reete ete Pet tee E RO E ee Rea 4
50. ose _outpd wPLX 0x4c 0 disable all interrupt px Use CH3 to simulate the external signal The user can must set the J25 CH3 in this demo The user can set the J25 EXT in real world application WORD init CH3 DWORD dwVal disable pci 12 c2 0xb6 0xff 0xff mode 3 CNT2 CH3 80K 65536 count 0 8192 sec gt high width 0 4096 sec 7 high width 0 4 sec low width 0 4 sec pci 12 c0 0x36 0 32 CH 1 mode 3 low 0 high 32 cout 1K _outpd wPLX 0x4c 0x41 channel 1 interrupt active Low now int state 1 now int signal is High Xy if wIrq 8 irqmask inportb Al 825941 outportb Al 825941 irqmask Oxff 1 lt lt wIrq setvect wIrgt 8 irq service else irqmask inportb Al 8259 1 outporthb Al 825941 irqmask Oxfb LE TROD outporthb 8259 1 irgmask Oxff 1 lt lt wIrq irqmask inportb A2 8259 1 outportb A2 8259 1 irgmask 1 lt lt wIrq 8 setvect 8 0 70 irq service enable void interrupt irq service if now int state 0 old state low gt change to high now COUNT3 find a HIGH pulse if COUNT3 4 stop down count amp read counter outportb wBaseAddr 0x0C 0x40 latch counterl L inportb wBaseAddr 0x04 H inportb wBaseAddr 0x04 _outpd wPLX 0x4c 0 disable all interrupt _outpd wPLX 0
51. ote 1 Refer to Sec 3 1 for more information about wBase Note 2 bits of this register will be clear to zero in power up stage gt invert non invert the selected clock source of CLK1 Xor2 gt invert non invert the selected clock source of CLK2 gt invert non invert the selected clock source of CLK11 2 gt invert non invert the selected clock source of CLK12 Xor 0 gt non invert it is power up value Xor 1 gt invert XorInt gt inverted non inverted the selected interrupt source Ledl gt Led1 0 gt Turn LED1 ON Led1 1 gt turn LED Off Led2 gt Led2 0 gt Turn LED2 ON Led2 1 gt turn LED2 Off Led3 gt Led3 0 gt Turn LED3 ON Led3 1 gt turn LED3 Off The Xor is designed to generate the starting 2 clocks for 8254 The XorInt is used to invert non invert the interrupt source to Low state that is to say if the initial value of interrupt source is High set this bit to High to invert it to Low state Refer to Sec 5 18 Ndemo5 Active Low Int for demo program When the TMCI2A is first powered up the initial values are all zero So Led1 2 3 are all turned ON The Led1 2 3 are designed as status indicators User can use them based on their need Refer to Sec 5 15 Ndemo2 Generate 2 Clocks the twelve Xor bits are used to generate the 2 starting clocks So the initial value of 8254 can be verified after these 2 starting clocks are generat
52. p CON3 of 12 with 20 pin 1 to 1 flat cable step 2 run DEMO2 EXE include PCITMC12 H WORD pci 12 do WORD void pci tmcl2 di WORD wDi WORD wBase wIrq wPLX int main niit WORD wBoards wRetVal char c clrscr wRetVal PTMC12 DriverInit amp wBoards printf n 1 Threr are OME PCI TMC12 Cards in this PC wBoards if wBoards gt 1 PTMC12 GetConfigAddressSpace 1 amp wBase amp wIrq amp WPLX card 1 else 12 GetConfigAddressSpace 0 amp wBase amp wIrq amp wPLX card 0 printf n 3 D I O test wBase x wBase 1 1 150 1 lt 16 i pci tmcl2 do j pci tmcl2 di amp k printf NnTEST 2d DO x DI x i j k if j k printf TEST ERROR else printf TEST OK j j 1 if j 0 1 PTMC12 DriverClose ir x void pci_tmc12_di WORD wDi WORD wRetVal wDi inport wBase 0x14 amp 0xffff OME PCI TMC12 A User Manual Ver 2 0 Sep 2002 36 5 3 Demo3 Wave Generator demo 3 Square Wave Generator step 1 all CLK select clock1 8M step 2 run DEMO3 EXE step 3 check all Cout of four 8254 by scope fs include PCITMC12 H WORD pci 12 select8254 char cChip WORD pci 12 cO char cConfig char cLow char cHigh WORD pci 12 cl
53. rn NoError OME PCI TMC12 A User Manual Ver 2 0 Sep 2002 Wi 88 54 4 Delay This demo use to implement a machine independent timer So you can run this demo on any speed PC amp find the shown in screen every mSec The machine independent timer is useful in industry applications demo 4 delay 1 ms Using 1 step 1 CLK 1 select clock1 8M step 2 run demo4 exe JUR Xy include PCITMC12 H WORD pci tmcl2 select8254 char cChip WORD pci tmcl12 cO char cConfig char cLow char cHigh WORD pci tmcl12 cl char cConfig char cLow char cHigh WORD pci tmcl2 c2 char cConfig char cLow char cHigh WORD wBaseAddr wIrq wPLX int main Int WORD wBoards wRetVal char c elrscr 3 wRetVal PTMC12 DriverInit amp wBoards printf n 1 Threr are OME PCI TMC12 Cards in this PC wBoards 12 GetConfigAddressSpace 0 amp wBaseAddr amp wPLX card 0 printf 3 Card 0 wBaseAddr x wBaseAddr printf Nn 4 Delay 1 ms n for for 1 0 i 1000 1 delay ms if kbhit 0 getch return PTMC12 DriverClose CLK 1 8M gt count 0 1 40 count 8000 1 ms down count from 8000 7999 gt 1 0 Oxfff delay one ms 1 int low high pei_tmcl2_select8254 0
54. ser Manual Ver 2 0 Sep 2002 62 5 17 4 Active High Int ndemo4 interrupt demo int source initial low active High step 1 connect 001 pinl of CON3 to ECLK11 16 of CON1 step 2 J25 select EXT step 3 run ndemo4 exe step 4 press any key to test press to stop Wi include PCITMC12 H define 1 8259 0x20 define 2 8259 0 0 define EOI 0x20 WORD pci tmcl12 do WORD WORD pci tmcl2 102 WORD WORD init interrupt WORD wBaseAddr wIrq wPLX int count static void interrupt irq service int irqmask int main int WORD wBoards wRetVal old count char c DWORD dwVal clrscr wRetVal PTMC12 DriverInit amp wBoards printf NMn 1 Threr are d OME PCI TMC12 Cards in this PC wBoards if wBoards 0 putch 0x07 putch 0x07 putch 0x07 printf 1 There are no OME PCI TMC12 card in this PC n exit 0 printf n 2 Show the Configuration Space of all OME PCI TMC12 for 1 0 i lt wBoards i PTMC12 GetConfigAddressSpace amp wBaseAddr amp amp wPLX printf Card d wBaseAddr x wIrq x wPLX x i wBaseAddr wIrq wPLX 12 GetConfigAddressSpace 0 amp wBaseAddr amp wIrg amp wPLX select _0 printf 3 0 wBaseAddr x wBaseAddr printf Nn 4 start test interrupt
55. signed for OME PCI TMC12A only OME PCI TMC12 A User Manual Ver 2 0 Sep 2002 2 2 Counter Architecture There are four 8254 chips on the OME PCI TMC12 A card The block diagram is given as following 8254 CHIP 1 U12 8254 CHIP 2 U8 Counter 1 Counter 4 COUT10 COUTII Counter 12 CLK GATE12 GATE OME PCI TMC12 A User Manual Ver 2 0 Sep 2002 7 23 Block Diagram The OME PCI TMC12 A provides 16 digital input channels and 16 digital output channels All levels are TTL compatible The connections diagram and block diagram are given as following T O read signal Local Data Bus write signal The port can be connected to the OME DB 16P The OME DB 16P is a 16 channel isolated digital input daughter board The D O port can be connected to the OME DB 16R or OME DB 24PR The OME DB 16R is a 16 channel relay output board The OME DB 24R is a 24 channel power relay output board OME PCI TMC12 A User Manual Ver 2 0 Sep 2002 8 2 4 Jumper Setting 2 4 1 CLOCK1 amp CLOCK2 There are two stable internal clock sources in OME PCI TMC12 A which named as amp CLOCK2 The CLOCK may be 8M or 1 6M selectable by 127 The CLOCK2 may be 0 8M or 80K selected by J26 The block diagram of internal clock sources is given as following 8M 8M CLOCKI CLOCKI 1 6M 1 6M CLOCKI 8M CLOCKI 1 6M 800K 800K CLOCK2 CLOCK2 80K 80K CLOCK2 800K CLOCK2 80K
56. t counter_0 0 1 Select counter 1 1 0 Select counter 2 1 1 Read back command RWI RWO Description 0 0 Counter latch command 0 1 Read write LSB ONLY 1 0 Read write MSB ONLY 1 1 Read write LSB first then read write MSB M2 1 MO Working mode 0 0 0 Mode 0 0 0 1 Mode 1 Don t care 1 0 2 Don t care 1 1 3 1 0 0 4 1 0 1 5 BCD Description 0 Binary counter 16 bits 1 Binary coded decimal BCD counter 4 decades OME PCI TMC12 A User Manual Ver 2 0 Sep 2002 32 4 2 Counter latch command D7 D6 05 04 D3 D2 DI DO SCI SCO 0 0 X X X X SCO Description 0 0 Latch counter 0 0 1 Latch counter 1 1 0 Latch counter 2 1 1 Read back command 4 3 Read back command 7 106 DS D4 D3 D2 DI 1 1 COUNT 5 5 CNT2 CNTO 0 D5 0 gt latch counter value of selected counters D4 0 2 latch status of selected counters D3 gt select counter 2 D2 1 gt select counter 1 Dl 1 gt select counter 0 4 4 Status byte format 7 106 DS D3 D2 DI Null RWI RW2 M2 1 MO BCD count D7 0 gt Cout Low D7 1 gt Cout High D6 0 gt count available for reading D6 1 gt null count 05 to 00 gt setting value read back OME PCI TMC12 A User Manual Ver 2 0 Sep 2002 33
57. ures of OME PCI TMC12A 3 4 1 Default Settings of OME PCI TMC12A The default settings of J28 when board is shipped on OME PCI TMC12A Sec 3 4 4 makes it is equivalent to 12 So the interrupt system of OME PCI TMCI2A in the default setting is compatible to OME PCI TMC12 Refer to Sec 3 4 4 for interrupt block diagram of OME PCI TMCI2 amp OME PCI TMC12A Xor of OME PCI TMCI2A are clear to their Low states in the first power up stage so all clock sources of OME PCI TMC12A are compatible to those of OME PCI TMC12 Refer to Sec 3 4 2 for block diagram As shipped the OME PCI TMC12A is used as an OME PCI TMC12 old application programs designed for OME PCI TMC12 can be executed in OME PCI TMC12A without any modification Key point Default factory settings of OME PCI TMCI2A makes it equivalent to an OME PCI TMC12 The new features of OME PCI TMC12A are given as follows The new interrupt mechanism Sec 3 4 4 The Xor bits for 2 clocks generation Sec 3 4 2 There are 3 LEDs for status indicators Sec 3 4 3 amp Sec 2 1 It equips one smith trigger buffer for the selected clock source Sec 3 4 2 One new D O port wBase 0x18 for Xor bits XorInt amp LED on off control Refer to Sec 3 4 3 for more information One new D I port wBase 0x18 for interrupt enable The initial routine amp ISR must inport from wBase 0x18 to enable next interrupt operation Refer to Sec 3 4 4 for more infor
58. w state inport wBaseAddr 0x18 pre set int signal to PC to High value to enable next interrupt operation int countt if wIrq 8 outportb A2 8259 0x20 outportb Al 8259 0x20 OME PCI TMC12 A User Manual Ver 2 0 Sep 2002 64 OME PCI TMC12 A User Manual Ver 2 0 Sep 2002 65 5 18 Ndemod Active Low Int ndemo5 interrupt demo int source initial High active Low step 1 connect 001 pinl of CON3 to ECLK11 16 of 1 step 2 J25 select EXT step 3 run ndemo5 exe step 4 press any key to test press Q to stop Wi include PCITMC12 H define 1 8259 0x20 define 2 8259 0 0 define EOI 0x20 WORD pci tmcl12 do WORD WORD pci tmcl2 102 WORD WORD init interrupt WORD wBaseAddr wIrq wPLX int count static void interrupt irq service int irqmask int main int WORD wBoards wRetVal old count char c DWORD dwVal clrscr wRetVal PTMC12 DriverInit amp wBoards printf NMn 1 Threr are d OME PCI TMC12 Cards in this PC wBoards if wBoards 0 putch 0x07 putch 0x07 putch 0x07 printf 1 There are no OME PCI TMC12 card in this PC n exit 0 printf n 2 Show the Configuration Space of all OME PCI TMC12 1 0 i wBoards i PTMC12 GetConfigAddressSpace amp wBaseAddr amp wIrq amp wPLX printf
59. x4c 0x41 channel 1 interrupt active Low now int state 1 now int signal is High OME PCI TMC12 A User Manual Ver 2 0 Sep 2002 52 else old state low gt change to high now COUNT3 find low pulse if COUNT 3 start counter pci tmcl2 c1 0x70 0xff 0xff CH 2 mode 0 down count ffff else outpd wPLX 0x4c 0x43 channel 1 interrupt active High now int state 0 now int signal is Low if wIrq 8 outportb A2 8259 0x20 outportb Al 8259 0x20 Initial High 8M N down count of CNT2 High Clock 1 ms 1 BASE CLK 1K Width of low pulse N 1 ms Refer to Sec 3 3 5 for more information OME PCI TMC12 A User Manual Ver 2 0 Sep 2002 53 5 13 Demo13 High Pulse Width demo 13 detect the pulse width of high pulse Use CH 3 to simulate external pulse step 1 CLK 3 select clock2 80K gt simulate ext signal step 2 CLK 1 select clock1 8M gt generate BASE clock step 3 CLK 2 select COUT1 1K gt measure pulse width step 4 J25 select CH3 step 5 run demol3 exe Use CH3 to simulate the external signal user can must set the J25 CH3 this demo The user can set the J25 EXT in real world application WORD init DWORD dwVal disable pci 12 c2 0xb6 0xff 0xff mode 3 CNT2 CH3 80K 6553
60. xb6 64 0 CH 6 mode 3 low 64 high 0 cout 125K printf n 6 Square Wave Generator for CH7 to CH9 pci tmcl2 select8254 2 select 8254 chip 3 pci 12 c0 0x36 128 0 CH 7 mode 3 low 128 high 0 cout 64K pci 12 1 0 76 0 1 CH 8 mode 3 10owz0 high 1 cout 32K pci 12 c2 0xb6 0 2 CH 9 mode 3 10owz0 high 2 cout 16K printf n 7 Square Wave Generator for CH10 to CH12 OME PCI TMC12 A User Manual Ver 2 0 Sep 2002 37 pci tmcl2 select8254 3 select 8254 chip 4 pci 12 0 0 36 0 4 CH 10 mode 3 low 0 high 4 cout 8K 6 pci 12 1 0 76 0 8 CH 11 mode 3 low 0 high 8 cout 4K pci 12 c2 0xb6 0 16 CH 12 mode 3 10w 0 high 16 cout 2K PTMC12 DriverClose WORD pci tmcl2 select8254 char cChip outportb wBaseAddr 0x10 cChip return NoError WORD pci tmcl2 cO char cConfig char cLow char cHigh outportb wBaseAddr 0x0C cConfig outportb wBaseAddr CLow outportb wBaseAddr CHigh return NoError WORD pci tmcl2 cl char cConfig char cLow char cHigh outportb wBaseAddr 0x0C cConfig outportb wBaseAddr 4 cLow outportb wBaseAddr 4 CHigh return NoError WORD pci tmcl2 c2 char cConfig char cLow char cHigh outportb wBaseAddr 0x0C cConfig outportb wBaseAddr 8 CLow outportb wBaseAddr 8 CHigh retu
Download Pdf Manuals
Related Search
Related Contents
User Manual MagniLink PRO - Mac Operating Instructions Type 8619 8619 multiCELL WM AC BEDIENUNGSANLEITUNG/ MANUAL DE Télécharger - FERIJULE.org Craftsman 917.28903 Lawn Mower User Manual Condiciones Generales de Alquiler Lexmark 320 Printer User Manual Todo lo que tienes que saber para empezar AG Neovo ES-02 flat panel desk mount 2000004407 - Shelter Setup Instructions Copyright © All rights reserved.
Failed to retrieve file