Home
AD1110/ADA1110 User`s Manual
Contents
1. 8 Bit Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 4 6 BA 9 Start 8 Bit Conversion Read LSB Data Read Write Writing to this address starts an 8 bit A D conversion the data written is irrelevant A read provides the LSB 4 least significant bits of the A D conversion as defined below The converted data is left justified tss D7 D6 D5 DA D3 D2 D1 DO Bit 3 Bit 2 Bit 1 Bit 0 X X X X BA 10 Read Status Update DAC Outputs Read Write A read provides the status bit defined below The end of convert bit goes high when a conversion is complete A write simultaneously starts a D A conversion in both DACS data written is irrelevant If the data written to either channel has not been updated since the last conversion the output of the corresponding DAC will not change D7 D6 D5 D4 D3 D2 D1 DO End of Convert 0 converting 1 not converting BA 11 Reserved BA 12 D A Converter 1 LSB ADA1110 Write Only Programs the DAC1 LSB eight bits BA 13 D A Converter 1 MSB ADA1110 Write Only Programs the DAC1 MSB four bits into DO through D3 D4 through D7 are irrelevant BA 14 D A Converter 2 LSB ADA1110 Write Only Programs the DAC2 LSB eight bits BA 15 D A Converter 2 MSB ADA1110 Write Only Programs the DAC2 MSB four bits into DO through D3 D4 through D7 are irrelevant pacis s D7 D6 D5 DA D3 D2 D1 DO Bit 7
2. Mode 0 Event Counter Interrupt on Terminal Count Mode 1 Hardware Retriggerable One Shot Mode 2 Rate Generator Mode 3 Square Wave Mode Mode 4 Software Triggered Strobe Mode 5 Hardware Triggered Strobe Retriggerable These modes are detailed in the 8254 Data Sheet reprinted from Intel in Appendix C 1110 1 0 CONNECTOR P2 8 MHz I COUNTER CLK O PIN 39 EXT CLK 0 GATE ENS PIN 41 EXT GATE 0 OUT PIN 40 T C OUT 0 I OUNTE PIN sa exr CLK 1 COUNTER CLK 1 EXT GATE 1 2 GATE PIN 460 G PIN 421 T C OUT 1 OUT ie i TIMER COUNTER CLK O O GATE OUT O Fig 3 2 8254 Timer Counter Circuit Block Diagram 3 4 Digital VO Programmable Peripheral Interface The programmable peripheral interface PPI is used for digital I O functions This high performance TTL CMOS compatible chip has 24 digital I O lines divided into two groups of 12 lines each Group A Port A 8 lines and Port C Upper 4 lines Group B Port B 8 lines and Port C Lower 4 lines Port A and Port C are available at the external I O connector P2 Port B is dedicated to on board functions and is not available for your use You can use the 16 lines of Ports A and C in one of these three PPI operating modes Mode 0 Basic input output Lets you use simple input and output operation for a port Data is written to or read from the specified port Mode 1 Strobed input output Lets you transfer I O data from Port A in c
3. 0 to 5 5 and 0 to 9 2 volts Relatives accuracy uiii eee EHE pan Pert A ERR Rana 1 LSB max Eull scale accutacy 1 2 da iaa 5 LSB max lease ligada pri 1 LSB max Settling time et ite etaim to en neues 10 usec max TIME COUNT KN RN Pac a a NN ha MO CMOS 82C54 Three 16 bit down counters 2 cascaded 1 independent 6 programmable operating modes Counter input source unznnsnensnennnennnnnnnnnnnnnn nenn ran nnn External clock 8 MHz max or on board 8 MHz clock Counter outputs uunsneennnnsnennnnnnsnnnnnnnn nen Available externally used as PC interrupts Counter gate source nunenennnensnnnnnnensnnennnnnnnnnnnnnnnnnnnn External gate or always enabled Miscellaneous Inputs Outputs PC bus sourced 5 volts 12 volts ground Current Requirements 140 mA 5 volts 32 mA 12 volts 30 mA 9 12 volts A 3 Connector 50 pin right angle shrouded header Size Short slot 3 875 H x 5 25 W 99mm x 134mm A 4 APPENDIX B P2 CONNECTOR PIN ASSIGNMENTS B 1 B 2 P2 Connector AIN1 AIN2 AIN3 AIN4 AIN5 AIN6 AIN7 AIN8 AOUT 1 AOUT 2 ANALOG GND PA7 PAG PA5 PA4 PA3 PA2 PA1 PAO EXT CLK 0 EXT GATE 0 EXT CLK 1 EXT CLK 2 12 VOLTS 12 VOLTS AIN9 AIN10 AIN11 AIN12 AIN13 AIN14 AIN15 AIN16 ANALOG GND ANALOG GND ANALOG GND PC7 PC6 PC5 PC4 PC3 PC2 PC1 PCO T C OUT O T C OUT 1 T C OUT 2 EXT GATE 1 2 5 VOLTS DIGITAL GND AD1110 ADA1110
4. Port A 0 output 1 input Port C Upper 0 output 1 input 4 4 A es SE ra nasi x x xr PAPA AT 1 Port C Lower 0 output 1 input Port B 0 output 1 input Mode Select 0 mode 0 1 mode 1 Group B wc P The table below shows the control words for the 16 possible Mode 0 Port I O combinations a Port I O Flow Direction and Control Words Mode 0 Group B Control Word en Port C When bit 7 of the PPI control word is set to O a write can be used to individually program the Port C lines D7 D6 D5 D4 D3 D2 D1 DO Set Reset Bit Set Reset Function Bit 0 set bit to 0 0 active Bit Select 1 set bit to 1 000 PCO 001 PC1 010 PC2 011 PC3 100 PC4 101 PC5 110 PC6 1112 PC7 4 5 For example if you want to set Port C bit 0 to 1 you would set up the control word so that bit 7 is 0 bits 1 2 and 3 are 0 this selects PCO and bit 0 is 1 this sets PCO to 1 The control word is set up like this 0 X X X 0 0 0 1 Sets PCO to 1 D7 D6 D5 DA D3 D2 D DO written to BA 3 X don t care Set Reset Set PCO Function Bit Bit Select 000 PCO BA 4 8254 Timer Counter 0 Read Write A read shows the count in the counter and a write loads the counter with a new value Counting begins as soon as the count is loaded BA 5 8254 Timer Counter 1 Rea
5. Connecting the Timer Counters and Digital I O eese ener en neennneneennennee 2 5 Running the 11 10DIAG Diagnostics Program esent nre en entren nennen nennen trennen 2 5 CHAPTER 3 HARDWARE DESCRIPTION sssronesosonessenesnsnesnsnsenennssnssnennsonenennsnnennsnnsnnenesnsones 3 1 A D Conversion Circuitry is 5 e cos eer aba ine dd 3 3 Analoge NPUts iP 3 3 AID Converter a as a as Nee eet 3 3 D A Converters ADATITO Only een ettet eere LK 3 4 Timet COUnDters 2 1 etre Du GA NINE deett ah eek oa Me a NG NANA NAGA 3 4 Digital I O Programmable Peripheral Interface oooononnninnninnnonnnononnnnoncnnccnncnnconnconocnnonnnnnnnnn ran nnn crac cnn nennen trennen 3 5 Interrupts NANG Re ta eb GANERN ALA o eto D eh e s To ALANGAN 3 5 CHAPTER 4 BOARD OPERATION AND PROGRAMMING scsssssssssssssssssscssssessssessessees 4 1 Defining the VO Maps riada cet i hh meet A E E ir re BANANA 4 3 BA 0 PPI Port A Digital I O Read Write ueeeseennesnesnnennesnnennennonnnnnnnensonsnonsonsnennesnnnnnennn nano 4 3 BA 1 PPI Port B Channel Select Read Write eese eene enne 4 4 BA 2 PPI Port C Digital YO Read Write eese eee rn non corn conocen neon nenas 4 4 BA 3 8255 PPI Control Word Write Only sees eene enne tnnt cone ron cacon nc enne nnnen e 4 4 BA 4 8254 Timer Counter O Re
6. The output then goes high again the timer counter reloads the initial count and the process is repeated This sequence continues indefinitely Mode 3 Square Wave Mode Similar to Mode 2 except for the duty cycle output this mode is typically used for baud rate generation The output is initially high and when the count decrements to one half its initial count the output goes low for the remainder of the count The timer counter reloads and the output goes high again This process repeats indefinitely Mode 4 Software Triggered Strobe The output is initially high When the initial count expires the output goes low for one clock pulse and then goes high again Counting is triggered by writing the initial count Mode 5 Hardware Triggered Strobe Retriggerable The output is initially high Counting is triggered by the rising edge of the gate input When the initial count has expired the output goes low for one clock pulse and then goes high again Digital O The 16 8255 PPI based digital I O lines can be used to transfer data between the computer and external devices The digital input lines of Ports A and C can have pull up or pull down resistors installed as described in Chapter 1 4 18 Example Programs and Flow Diagrams Included with the 1110 is a set of example programs that demonstrate the use of many of the board s features These examples are in written in C Pascal and BASIC Also included is an easy to use menu dr
7. 5 1 2 digits e Small Screwdriver for trimpot adjustment While not required the 11 10DIAG diagnostics program included with example software is helpful when performing calibrations Figure 5 1 shows the board layout with the trimpots located along the top edge of the board BASE ADDRESS BEES di alles AE R ed ng E 3 R6 Made in USA 0838 o8 FEE coa qi we a a 000000 000000000000 AD7237 C15 noo noo 000000000000 EDDIE a eesi geent mnc Him 9NH DAC1 us P8 Us EERE Ho 00000000 long 000000 om x 3 AD1110 ADA111 oo x oo jo A Accessing the Analog World 0000000 EG UP BEA ER o JT HMM 0 0000000 2C55 za q 0000000000 j Hara o 0000000000 00000000000000000000 PAO o0 v 00000 un 828555822888 0000001009000 PCH PCL 0000000000 00000000 pagooawooon AERE 0000000000 E u 0809999909 00000000 n 8 74HCT688 Bpreorer 7AHCT37 74HCT245 olo papasaya 0000000 00060 0006000000003 99999927 E OO 5v z O Of ext o o o o o o o o o o o o 00000000 Copyright C 1393 Real Time Devices Inc cn State College PA 16804 USA Ra no 2 ao GO AT P1 A31 Fig 5 1 Board Layout 5 3 A D Calibration Two procedures are used to calibrate the A D converter for all input voltage ranges The first procedure cali brates the converter for the unipolar range 0 to 10 volts and the second procedure calibrates the bipolar ranges 5 10 volts Table 5 1 shows the idea
8. Calibrating Unipolar Range 0 to 10 volts Offset TR3 Converter Gain TR2 Input Voltage 1 22070 mV Input Voltage 9 49829 V 0000 0000 0000 1111 0011 0010 A D Converted Data 0000 0000 0001 1111 0011 0011 Bipolar Calibration Two adjustments are made to calibrate the A D converter for the bipolar ranges of 5 and 10 volts One is the offset adjustment and the other is the full scale or gain adjustment Trimpot TR2 is used to make the offset adjustment and trimpot TR1 is used for gain adjustment These adjustments are made with the board set for a range of 5 to 5 volts Before making these adjustments make sure that the jumpers on P7 are set for this range Use analog input channel 1 and set it for a gain of 1 while calibrating the board Connect your precision voltage source to channel 1 Set the voltage source to 4 99878 volts start a conversion and read the resulting data Adjust trimpot TR2 until it flickers between the values listed in the table below Next set the voltage to 4 99634 volts and repeat the procedure this time adjusting TR1 until the data flickers between the values in the table Data Values for Calibrating Bipolar Ranges Using 5 to 5 volts Offset TR2 Converter Gain TR1 Input Voltage 4 99878V Input Voltage 4 99634V 0000 0000 0000 1111 1111 1110 A D Converted Data 0000 0000 0001 1111 1111 1111 D A Calibration ADA1110 The D A converter requires no calibration for the X1 ranges 0
9. OTO CLK2 OT1 1 4 P4 DAC 1 Output Voltage Range Factory Setting 5 to 5 volts sssssseeeeenee 1 5 P5 DAC 2 Output Voltage Range Factory Setting 5 to 5 volts sse 1 5 P7 Analog Input Voltage Range and Polarity Factory Setting 5 to 5 Volts sess 1 6 P8 8254 Timer Counter TC1 amp TC2 Gate Sources Factory Setting GT1 5V GT2 5V 1 6 P9 Interrupt Source and Channel Factory Setting Jumper on OUT2 Interrupt Channels Disabled 1 7 P10 EOC Interrupt Channel Select Factory Setting Disabled eene 1 7 S1 Base Address Factory Setting 300 hex 768 decimal coconccnnnncnocicncccoonnnonccononononcnnccnnnnnonconn ccoo nannnnns 1 8 Pull up Pull down Resistors on Digital VO Lines esee nee nen trennen trennen 1 9 Gx Resistor Configurable Gain Circuitry uuueenesssesnesnnennesnnennnsnonnnnnnnnnnensnnnnonsennensnennnnsnesnnenennnennnonsansnennn nenne 1 11 CHAPTER 2 BOARD INSTALLATION 2ursuesesorenesnssorsnsnnsonenennsnnennsnnsnssnesnsnnenenassnsnnesnssnenenanenes 2 1 Board Installation AU ee 2 3 External O ConnectIODS 33 55 25 dene pef t ee e epi etuer et Eee eee 2 3 Connecting the Analog Input Pins usns na esae ieor nennen nennen tenerent etre entere saa erret ersten nen 2 4 Connecting the Analog Outputs ADA 1110 Only sese ener rennen nnne nenne 2 5
10. a Channel discendo p HE e BEING ANN ah eee 4 10 Starting an A D Conversion 25i epe a RU DU NINANG droves 4 11 Monitoring Conversion St atus 2 rero ttp e t bei ie pe ene sin Hs EE EEST 4 11 Reading the Converted Data 4 c Te e et heo eR ere qi Aces pieni eae 4 11 Interrupts 5 o roe PEDE re emt e ente eee RR RE 4 13 What Isan Interruptor Hering 4 13 Interrupt Request Lines ito ertet asp DAANG msn qu ei egets t 4 13 8259 Programmable Interrupt Controller eese ener ene en eren 4 13 Interrupt Mask Register IMR 5 nette tee ree tr er E e eI Pe OR o beers 4 13 End of Interrupt EOI Command eeir en ear EE EE EE E SEEE AE EAE E cren nest aT 4 13 What Exactly Happens When an Interrupt Occurs ueseseessersnennersnesnnesnennnennesnnennennnnnnensonnnonsnenson nn non nene 4 13 Using Interrupts in Your Programs sosse eee ce sese rennen nennen nente eei Es nenne tente treten trennen 4 14 Writing an Interrupt Service Routine ISR essent nennen nennen nennen trennen 4 14 Saving the Startup Interrupt Mask Register IMR and Interrupt Vector 4 15 Restoring the Startup IMR and Interrupt Vector essent nee nemen nennen 4 16 Common Interrupt Mistakes eere tete tette ee oe e ede gen 4 16 D A Conversions ADATITO Only estie t is NG rere XR RERUM Baan 4 16 Timer Counters I 4 17 Digital I O 2 tee Ks te etai o de
11. and it will not generate an interrupt If a bit is clear equal to 0 then the corresponding IRQ is unmasked and can generate interrupts The IMR is programmed through port 21H For all bits 0 IRQ unmasked enabled 1 IRQ masked disabled End of Interrupt EOI Command After an interrupt service routine is complete the 8259 interrupt controller must be notified This is done by writing the value 20H to I O port 20H What Exactly Happens When an Interrupt Occurs Understanding the sequence of events when an interrupt is triggered is necessary to properly write software interrupt handlers When an interrupt request line is driven high by a peripheral device such as the 1110 the 4 13 interrupt controller checks to see if interrupts are enabled for that IRQ and then checks to see if other interrupts are active or requested and determines which interrupt has priority The interrupt controller then interrupts the proces sor The current code segment CS instruction pointer IP and flags are pushed on the stack for storage and a new CS and IP are loaded from a table that exists in the lowest 1024 bytes of memory This table is referred to as the interrupt vector table and each entry is called an interrupt vector Once the new CS and IP are loaded from the interrupt vector table the processor begins executing the code located at CS IP When the interrupt routine is completed the CS IP and flags that were pushed on the stack
12. for Port C Lower and PCH is for Port C Upper Figure 1 12 shows these pads To operate as pull ups solder a jumper wire between the common pin middle pin of the three and the V pin For pull downs solder a jumper wire between the common pin middle pin and the G pin Figure 1 11 shows Port A lines with pull ups Port C Lower with pull downs and Port C Upper with no resistors PULL UP Fig 1 11 Adding Pull ups and Pull downs to Digital I O Lines BASE ADDRESS E oooon SWITCH o on A m 00000000000000 0000000 RN9 RN8 ooooonm iooooo PCH PCL HOd 10d Vd 82C55 meos o Gm Loa 00000 Dn nooooo 000000 gos oon e a fo AD574 do o Flo o H 0000 ol lo o n o l oo u 00000000000000 29 6 DO n o o loo 00 000000000000 ol 3 lofo o 2 EH AD7237 FA Caro 2 po o oU 500000000000 4 DAD PE op 9 2 ka Pig us 00000000 d o o os po 7 0000000 0000000 po o o Sole 5 notes P 99999 la x ER o Os 3199 AD1110 ADA1110 QOJ OO 00 5 lo Of exr 0000000 77 77 9 n o o A the Analog World 00 TER cess me Anloo Wo 9 o o 22000000 q o ol o og e 5 rasis A 00000000000000000000 oo o o 00 n 00 paa g 2200000000 99 Q B 74LS244 8 gt PAL 00 217000000000 9 nooooooooo 0 00 v 09000 74HCT688 un 74HCT367 0000000000 Copyright C 1393
13. i epe EE E t re sie bis 4 18 Example Programs and Flow Diagrams eese nennen enin rene on nee ene nenne nenne 4 19 C and Pascal Programms inen es dp eee HR IR REPE ERE RR ERE eie UE 4 19 BASIC Pro eras 4 io EI RR ER IRE E Re Po ER ERE ERREUR NAN 4 19 Flow Diagrams ON 4 20 Single Convert Flow Diagram Figure 4 3 uuersersnessersnesnnesnnsnnennesnnennennnennnnnnnnnnnnnennonsnensonsnonsnn enne nenne 4 20 D A Conversion Flow Diagram Figure 4 4 sess ener ennen trementem nennen 4 21 CHAPTER 5 CALIBRATION nase a vae ANNA 5 1 Required Equipment tert rt e AP IER EE IR AE e D rm Mees tos s 5 3 AID Eal bration dahi a tem ect OC RO aaa RO ERE EF HER RR ER RO eh Pere plis nanan 5 4 Unipolar Calibration en id ere Ete LE EINE een kann 5 4 Bipolar Calibration aiii siii 5 5 D A Calibration ADATT IO siririna e itte re qe e eie on eue d Baumes 5 5 APPENDIX A 1110 SPECIFICATIONS cesses seen eene esso seen sesto sto seta setts sosoo saasa ioes sv A 1 APPENDIX B P2 CONNECTOR PIN ASSIGNMENTS 200200s002000000200200200n000200200n00n00n00000000 B 1 APPENDIX C COMPONENT DATA SHEETS 2 20000000000020000000000002000000200n00n000000200n00n00 000000000 C 1 APPENDIX D WARRANTY z0uss0ssonsonsonssnssnssnnsnnssnssnnsnnssnnsnnsnnsnnsnnsnnsnnsnnssnnsnnsnnssnssnnssnssnnsnnsnnssnne D 1 iii iv 1 1 1 2 1 3 1 5 1 6 Bi 1 8 1 9 1 10 1 11 1 12 1 1
14. nene enr en teen en nennen 3 3 8254 Timer Counter Circuit Block Diagram oononocnnnnnonnonnnnnconoconcnnnnnnonncnn non crnn non ccnn crono nn eene nenne onen 3 4 A D Conversion Timing Diagram siese ieas ie eE ese rE EEE EEEE none ran nena tenen etre nete on non eren entente 4 11 8254 Programmable Interval Timer Circuit Block Diagram eene 4 18 Single Conversion Flow Diagram niii ein RR ee E qe ea 4 20 D A Conversion Flow Diagram ce te et ei tee it re i eR e rent 4 21 Board Layout niter dedit eT et E E ERG REOR EORR te ree can 5 3 vi INTRODUCTION The AD1110 and ADA1110 Low Cost Industrial Control boards turn your IBM PC XT AT or compatible into a high performance data acquisition and control system Installed within a single short or full size expansion slot in the computer each 1110 series board features 16 single ended analog input channels 12 bit 20 microsecond analog to digital converter with 40 kHz throughput 5 10 or 0 to 10 volt input range Resistor configurable gain 16 TTL CMOS 8255 based digital I O lines which can be configured with pull up or pull down resistors Three 16 bit timer counters Two 12 bit digital to analog output channels ADA1110 only 5 10 0 to 5 or 0 to 10 volt analog output range ADA1110 only Turbo Pascal Turbo C and BASIC source code diagnostics program The following paragraphs briefly describe the major functions of the board A more detailed dis
15. to 5 and 5 volts The following paragraph describes the calibration procedure for the X2 multiplier ranges To calibrate for X2 0 to 10 or 10 volts set the DAC output voltage range to 0 to 10 volts jumpers on X2 and 5 on P4 AOUTI or P5 AOUT2 Then program the corresponding D A converter DAC1 or DAC2 with the digital value 2048 The ideal DAC output for 2048 at X2 0 to 10 volt range is 5 0000 volts Adjust TR5 for AOUTI and TR6 for AOUT until 5 0000 volts is read at the output Table 5 2 lists the ideal output voltages per bit weight for unipolar ranges and Table 5 3 lists the ideal output voltages for bipolar ranges 5 5 D A Bit Weight a ee tes 1 2207 2 4414 A FR 0 0000 0 0000 4997 8 a 5 6 APPENDIX A 1110 SPECIFICATIONS A 2 AD1110 ADA1110 Characteristics Typical 25 C Interface IBM PC XT AT compatible Switch selectable base address I O mapped Jumper selectable interrupts Analog Input 16 single ended inputs Input impedance each channel nnuunsnnnnnnsnnnen nenne nennen n nennen nennen ennnnn gt 10 megohms Inp branges a kana en nenn 5 10 or O to 10 volts Guaranteed linearity across input ranges 5 49 5 and 0 to 9 5 volts Overvoltage protection uummaaaamaaawanaawaaawanaanaaaanaaananasanaasasassasananaanasanasasnssasasana 35 Vdc Settling time gain 1 eeeeccecesseceeeneeeesneeeceeeeeeeeeeeeseaeeesseeeeeseseeesseeeeeseaes 5 usec ma
16. your own resistor configurable gain The gain circuitry is described at the end of this chapter Factory Configured Switch and Jumper Settings Table 1 1 lists the factory settings of the user configurable jumpers and switch on the AD1110 and ADA1110 boards Figure 1 1 shows the board layout and the locations of the factory set jumpers The following paragraphs explain how to change the factory settings Pay special attention to the setting of SI the base address switch to avoid address contention when you first use your board in your system Table 1 1 Factory Settings Switch Factory Settings Jumper Function Controlled Jumpers Installed Jumpers installed on CLKO OSC CLK1 OTO CLK2 OT1 timers cascaded Jumpers installed on 5 X1 5 to 5 volts Jumpers installed on Sets the D A output voltage range for DAC 2 5 X1 5 to 5 volts Jumpers installed on Sets the analog input voltage range and polarity 10V 5 to 5 volts Selects the gate source for TC1 and TC2 GT1 5V GT2 5V Jumper installed on OUT2 Connects one of five interrupt sources to an interrupt channel Jinterrupt channel disabled Connects the EOC signal to an interrupt channel Disabled Sets the base address 300 hex 768 decimal Sets the clock sources for the 8254 timer counters TCO TC2 Sets the D A output voltage range for DAC 1 S1 BASE ADDRESS T Lp pU TAS un oooon lt lt BEER EE o llo o lo o lo o ZB BEE ER 00000 000
17. 0000000000n O S 8 o E o Geo Ors e 0000 1 4 nn oon on U17 0000 nooo RI 000000 Oo D 5 EST o ou U5 Q E S o AD712 AD574 Hooo V80S IH 00000000 00000000 V80G IH 000000000000000 000000000000 AD7237 P8 a O sv Jo EXT ges asv J 74HCTO4 O 0lx 000000 0000000 00000000 00000000 C16 u9 C15 0000 e 195 n o Br 0 B soni da nooooooo Bo E n nooooooo 5 loro 000000 x ORO x2100 P4 P5 O ADITIO ADA1110 o TUD USA Accessing the Analog World li DAC2 EE 00000000000 o 000000000000 0000000000 7415244 0000000000 0000000000 74HCT688 0000000000 opyright om 7 C D 056 9 3 Real Time Devices Inc eon d Are 9 m000000 Y q 0000000000 8 o U2 00000000 PAL GB0000000 s OB 00000000 U11 o E g Ol 040 o o OO no o oo o8 310 O O O rou o ojj n 40g S o v S State College PA 16804 USA A31 X o 000 9 o gt 10 EO P10 IRQ 00000000000000000000 000000000000000 ra RNS ANS RN7 ooooonmn nunooooo PCH PCL 3 0000000000 D D B 000000000000000000000000 0000000000000000000000009 HOd 10d Vd E E 0000000000 4 C34 C 8 o o o O lt Fig 1 1 Board Layout Showing Factory Configured Settings 1 3 P3 8254 Timer Counter Clock Sources Factory Settings CLK0 OSC CLK1 OT0 CLK2 OT1
18. 2 IC Figure 1 14 shows the location of the solder short Remove solder short see Figure 1 14 R3 To calculate Gain Gain TR4 R4 R3 1 To calculate frequency f 1 2bC14 R4 TR4 Fig 1 13 Gain Circuitry and Formulas for Calculating Gain and f BASE ADDRESS oooon EEN TR S Ro Ri 0000000000 ay 0000000 74LS125 E 9 m000000 Y 0000000000 7415244 11000000000 v 000000 ovg PAL 0000000000 88 un y 74LS688 Om 0000000000 ae no oums C SERE pale o9 ea D on s Eee egez SS e3 o0000 o o no 3 p cras o v sav wxg f3 9 nooo o oU us 00000000000000 B g 97 000000000000 o o8 ZEeLAY Li o Qu 290092090090 o o i o s Ero 0000000 S llo of exr o g o o sv 74LS04 o eo 0000000 7777770 o USA ooooooo gm no 5 00000000 o 000909 00000 lool x ooj X2 Ba AD2110 ADA2110 cessing the Analog World 00000000000000000000 00000000 00000000 Remove Solder Short Between These 2 Pads on Bottom Side of Board Made in USA ang 00000000 0000000000 o 2 82055 o 233 2 u2 G8 33388 BHR 220000000 992 0000000 0000000000 8 D 7415367 0000000000 D 7416245 0000000000 i 0000000000 A31 is X Copyright 96 Real Timo Devices Inc 00000000 State College PA 16804 USA 000000
19. 3 1 14 2 1 2 2 3 1 3 2 4 1 4 2 4 3 4 4 5 1 List of Illustrations Board Layout Showing Factory Configured Settings sese 1 3 8254 Timer Counter Clock Source Jumpers P3 esses enne 1 4 8254 Timer Counter Circuit Block Diagram eese eren nennen nene ene 1 4 DAC 1 Output Voltage Range Jumper P4 enne nennen rennen nennen trennen 1 5 DAC 2 Output Voltage Range Jumper P5 sese non conocen AE enne entren 1 5 Analog Input Voltage Range and Polarity Jumpers P7 essere 1 6 8254 Timer Counter TC1 amp TC2 Gate Source Jumpers P8 sse 1 6 Interrupt Source and Channel Select Jumper PO sess 1 7 EOC Interrupt Channel Jumper P10 essere Gas bans enhen nennen nennen entree 1 7 B se Address Switch ST auae atate pam d o 1 8 Adding Pull ups and Pull downs to Digital I O Lines eeeeeeeeeeeeeene eene 1 9 Pull up Pull down Resistor Circuitry esses enne en non rene cn neon rca nennen rennen 1 10 Gain Circuitry and Formulas for Calculating Gain and f eee 1 11 Diagram for Removal of Solder Short nn non nono nena conc conc nre rennen 1 12 P2 O Connector Pin Assignments GINA reine ete pt e diet NY o eee tei Petites 2 3 Single Ended Input Connections eii eei aee eei uet kanina 2 4 AD1110 ADA1110 Block Diagram esee nennen ener
20. AD1110 ADA1110 User s Manual TUT Real Time Devices USA Inc LTL Accessing the Analog World AD1110 ADA1110 User s Manual UI REAL TIME DEVICES USA INC Post Office Box 906 State College Pennsylvania 16804 USA Phone 814 234 8087 FAX 814 234 5218 Published by Real Time Devices USA Inc P O Box 906 State College PA 16804 USA Copyright 1993 by Real Time Devices Inc All rights reserved Printed in U S A 9351 Table of Contents INTRODUCTION Rn i 1 Analog to Digital Conversion ee ls T e e tette ae bcs BIN GING DARAAN coe Rc i 3 Digital to Analog Conversion ADA1110 Only essere enne nennen tre tenenene trennen ene i 3 8254 Lmmer CoUnter eter GAN ENG DID dt DU Pg ete URS i 3 A OE po er ERE RERO CON i 3 What Comes With Your Boatd 5 enit t Apte EHRE RR oie Age Res ee i 4 A A i 4 Application Software and Drivers 0 0 0 cece ssecsecesecseceseeseceseessceeeeeeceseecaecaaecaecaaesaecsacsaecsscsesessesaecaeeseseteeseeeees i 4 Hardware Accessories sperrer te ote ape te Ri bte des REG En EHER i 4 Using This Manual 5 ak GAGANA ehe i ines aei ee aie era E dad i 4 When You Need Help eno e ere MUNA EH Pe van ma nadaa i 4 CHAPTER 1 BOARD SETTINGS ee nenne 1 1 Factory Configured Switch and Jumper Settings sse nennen rennen en nennen 1 3 P3 8254 Timer Counter Clock Sources Factory Settings CLK0 OSC CLK1
21. Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 pecus D7 D6 D5 DA D3 D2 D1 DO X X X X Bit11 Bit10 Bit9 Bit 8 4 7 Programming the AD1110 ADA1110 This section gives you some general information about programming and the 1110 board and then walks you through the major 1110 programming functions These descriptions will help you as you use the example programs included with the board and the programming flow diagrams at the end of this chapter All of the program descrip tions in this section use decimal values unless otherwise specified The 1110 is programmed by writing to and reading from the correct I O port locations on the board These I O ports were defined in the previous section Most high level languages such as BASIC Pascal C and C and of course assembly language make it very easy to read write these ports The table below shows you how to read from and write to O ports using some popular programming languages BASIC Data INP Address OUT Address Data Data inportb Address outportb Address Data Turbo Pascal Data Port Address Port Address Data mov dx Address mov dx Address Assembly in al dx ee out dx a In addition to being able to read write the I O ports on the 1110 you must be able to perform a variety of operations that you might not normally use in your programming The table below shows you some of the operators discussed in this section w
22. Chapter 1 Board Settings This switch can be accessed without removing the board from the connector S1 is factory set at 300 hex 768 decimal The following sections describe the register contents of each address used in the I O map Register Description Read Function Decimal boss riPona ATAY fret aro 8255 PPI Port A Read Port A digital input lines lines BA 0 Shame Sees eaiPorbbis Pogamactveciams asi Channel Select Read Port B bits Program active channel BA 1 boss epiPono waa Pon cadgtalnputines es pase 8255 PPI Port C Read Port C digital input lines lines BA 2 8255 PPI Control Word Reserved programPPIconfiguration 8254 Timer Counter Control Word Reserved Program counter mode BA 7 Start 12 bit Conversion Read A D converted data Read MSB MSB Start 12 bit A D conversion BA 8 Start 8 bit Conversion Read LSB Read A D converted data LSB Start 8 bit A D conversion BA 9 Simultaneously update DAC1 Read Status Update DACs Read status word 8 DAC2 ADA1110 only BA 10 BA 11 D A Converter 1 LSB ADA1110 only Reserved Program DAC1 LSB BA 12 D A Converter 1 MSB ADA1110 only Reserved Program DAC1 MSB BA 13 D A Converter 2 LSB ADA1110 only Reserved Program DAC2 LSB BA 14 D A Converter 2 MSB ADA1110 only Reserved Program DAC2 MSB BA 15 BA Base Address BA 0 PPI Port A Digital VO Read Write Transfers the 8 bit Port A digital input and digital output data between the boa
23. HER THAN REAL TIME DEVICES EXCEPT AS EX PRESSLY 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 DAM AGES 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 CONSE QUENTIAL DAMAGES FOR CONSUMER PRODUCTS AND SOME STATES DO NOT ALLOW LIMITA TIONS ON HOW LONG AN IMPLIED WARRANTY LASTS SO THE ABOVE LIMITATIONS OR EXCLU SIONS MAY NOT APPLY TO YOU THIS WARRANTY GIVES YOU SPECIFIC LEGAL RIGHTS AND YOU MAY ALSO HAVE OTHER RIGHTS WHICH VARY FROM STATE TO STATE D 3 AD1110 ADA1110 User Settings P9 IRQ Source P9 IRQ Channel P10 EOC P10 IRQ Channel
24. K 1 T C OUT 2 EXT CLK 2 EXT GATE 1 2 412 VOLTS 5 VOLTS Fig 2 1 P2 I O Connector Pin Assignments Connecting the Analog Input Pins NOTE It is good practice to connect all unused channels to ground as shown in the following diagram Failure to do so may affect the accuracy of your results Connect the high side of the analog input to one of the analog input channels AIN through AIN16 and connect the low side to an ANALOG GND pins 18 and 20 22 on P2 Figure 2 2 shows how these connections are made 1 0 CONNECTOR P2 Fig 2 2 Single Ended Input Connections Connecting the Analog Outputs ADA 1110 Only For each of the two D A outputs connect the high side of the device receiving the output to the AOUT channel P2 17 or P2 19 and connect the low side of the device to an ANALOG GND P2 18 or P2 20 Connecting the Timer Counters and Digital I O For all of these connections the high side of an external signal source or destination device is connected to the appropriate signal pin on the P2 1 O connector and the low side is connected to any DIGITAL GND Running the 1110DIAG Diagnostics Program Now that your board is ready to use you will want to try it out An easy to use menu driven diagnostics program 1110DIAG is included with your example software to help you verify your board s operation You can also use this program to make sure that your current base address setting does not contend with another devi
25. Real Ti essere u2 Greene 00000000 ime Devices Inc State College PA 16804 USA A31 er E adanakan PA 9 o 500008 PES 00000000008 1006000005 c3 v G P1 Fig 1 12 Pull up Pull down Resistor Circuitry 1 10 00000000 PALO RN7 Gx Resistor Configurable Gain Circuitry A resistor configurable gain circuit Gx is provided so that you can easily configure special gain settings for a specific application Note that when you use this feature and set up the board for a gain of other than 1 all of the input chamnels will operate only at your custom gain setting Gx is derived by adding resistors R3 and R4 trimpot TR4 and capacitor C14 all located in the upper center and right areas of the board The resistors and trimpot combine to set the gain as shown in the formula in Fig ure 1 13 Capacitor C14 is provided so that you can add low pass filtering in the gain circuit If your input signal is a slowly changing one and you do not need to measure it at a higher rate you may want to add a capacitor at C14 in order to reduce the input frequency range and in turn reduce the noise on your input signal The formula for setting the frequency is given in the diagram Figure 1 13 shows how the Gx circuitry is configured As shown in Figure 1 13 a solder short must be removed from the board to activate the Gx circuitry This short is located on the bottom side of the board under U12 AD71
26. This header connector shown in Figure 1 2 lets you select the clock sources for the 8254 timer counters TCO TC1 and TC2 The factory setting cascades all three timer counters with the clock source for TCO being the on board 8 MHz oscillator the output of TCO providing the clock for TC1 and the output of TC1 providing the clock for TC2 You can connect any or all of the sources to an external clock input through the P2 I O connector or you can set TC1 and TC2 to be clocked by the 8 MHz oscillator Figure 1 3 shows a block diagram of the timer counter circuitry to help you with these connections NOTE When installing jumpers on this header make sure that only one jumper is installed in each group of two or three CLK pins P3 OSC ECO OTO OSC EC1 OT1 OSC EC2 019 TO cx 19 Fig 1 2 8254 Timer Counter Clock Source Jumpers P3 1110 1 0 CONNECTOR P2 l l l COUNTER CLK Q 8 MHz OUNTE O PIN 39 EXT CLK 0 m PIN 41 EXT GATE 0 PIN 40 T C OUT 0 I COUNTER CLK o PIN 43 EXT CLK 1 PIN 46 EXT GATE 1 2 PIN 42 1 T C OUT 1 E TIMER COUNTER CLK EXT CLK 2 2 PIN 44 T C OUT 2 Fig 1 3 8254 Timer Counter Circuit Block Diagram P4 DAC 1 Output Voltage Range Factory Setting 5 to 5 volts This header connector shown in Figure 1 4 sets the output voltage range for DAC 1 at 0 to 5 5 O to 10 or 10 volts Two jumpers must be installed one to select the range and one to sele
27. User Settings PIN 1 PIN 2 P9 IRQ Source P9 IRQ Channel P10 EOC P10 IRQ Channel B 3 B 4 C 1 APPENDIX C COMPONENT DATA SHEETS Intel 82C54 Programmable Interval Timer Data Sheet Reprint Intel 82C55A Programmable Peripheral Interface Data Sheet Reprint APPENDIX D WARRANTY D 2 LIMITED WARRANTY Real Time Devices Inc warrants the hardware and software products it manufactures and produces to be free from defects in materials and workmanship for one year following the date of shipment from REAL TIME DE VICES 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 defective 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 DAM AGED AS A RESULT OF ACCIDENT MISUSE ABUSE such as use of incorrect input voltages improper or insufficient ventilation failure to follow the operating instructions that are provided by 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 OT
28. ace of the method shown above Now that you know how to clear and set bits we are ready to look at the programming steps for the 1110 board functions 4 9 A D Conversions The following paragraphs walk you through the programming steps for performing A D conversions Detailed information about the conversion modes is presented in this section You can follow these steps on the flow diagram at the end of this chapter and in our example programs included with the board In this discussion BA refers to the base address Initializing the 8255 PPI The eight Port B lines of the 8255 PPI control the channel selection Port B is programmed at I O address location BA 1 D7 D6 D5 D4 D3 D2 D1 DO Analog Input Channel Select 0000 chamnel 1 0001 channel 2 0010 channel 3 0011 channel 4 0100 channel 5 0101 channel 6 0110 channel 7 0111 channel 8 1000 channel 9 1001 channel 10 1010 channel 11 1011 channel 12 1100 channel 13 1101 channel 14 1110 channel 15 1111 channel 16 To use Port B for these control functions the 8255 must be initialized so that Port B is set up as a Mode 0 output port This is done by writing this data to the PPI control word at I O address BA 3 X don t care 1 X X X X 0 0 X D7 D6 D5 D4 D3 D2 D1 DO Selecting a Channel To select a conversi
29. ad Write sssssessssessseeesseeeeee ener enne eene en nennen nnne nnne 4 6 BA 5 8254 Timer Counter 1 Read Write esses ener enne en nennen nnne entes 4 6 BA 6 8254 Timer Counter 2 Read Write raan enne entere ennt nennen nennen enne 4 6 BA 7 8254 Control Word Write Only coooocnnccnoncconcnononcnnncnonnnonncconoconnnnnncconnnonnnconn non tenen nen terere nnne netten 4 6 BA 8 Start 12 Bit Conversion Read MSB Data Read Write esses eee 4 6 BA 09 Start 8 Bit Conversion Read LSB Data Read Write sess 4 7 BA 10 Read Status Update DAC Outputs Read Write eese ener enne 4 7 BA II uie to t ener ee een Per tine t eie esee ee ete ere de REY 4 7 BA 12 D A Converter 1 LSB ADA1110 Write Only esee enne nennen enne 4 7 BA 13 D A Converter 1 MSB ADA1110 Write Only sees enne enne neret nnne 4 7 BA 14 D A Converter 2 LSB ADA1110 Write Only eese enne nne 4 7 BA 15 D A Converter 2 MSB ADA1110 Write Only essere nennen nennen nere nnne 4 7 Programming the AD1110 ADA 1110 esee ttt eere re ar eR ee 4 8 Clearing and Setting Bits in a Port eese E E terne net nennen entente nene tenente 4 8 A D COnV erSIOnS nabasa RO RETRO isp iei p HERR i te Dee er SHEER 4 10 Initializing the 8255 PPL i iir er d tote ete t dl ei e Case ER pp nie 4 10 Selecting
30. atically pops the flags CS and IP that were pushed when the interrupt was called If you find yourself intimidated by interrupt programming take heart Most Pascal and C compilers allow you to identify a procedure function as an interrupt type and will automatically add these instructions to your ISR with one important exception most compilers do not automatically add the end of interrupt command to the procedure you must do this yourself Other than this and the few exceptions discussed below you can write your ISR just like any other 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 that you stick to the basics just something that will convince you that it works such as incrementing a global variable NOTE If you are writing an ISR using assembly language you are responsible for pushing and popping registers and using IRET instead of RET There are a few cautions you must consider when writing your ISR The most important is do not use any DOS functions or routines that call DOS functions from within an ISR DOS is not reentrant that is a DOS function cannot call itself In typical programming this will not happen because of the way DOS is written But what about when using interrupts Then you could have a situation such as this in your program If DOS function X is being executed when an interrupt occurs and the interrupt routine makes a
31. ay be called again before you have completed handling the first run This often leads to a hang that requires a reboot Your ISR should have this structure Push any processor registers used in your ISR Most C and Pascal interrupt routines automatically do this for you Put the body of your routine here Issue the EOI command to the 8259 interrupt controller by writing 20H to port 20H Pop all registers pushed on entrance Most C and Pascal interrupt routines automatically do this for you The following C and Pascal examples show what the shell of your ISR should be like In C void interrupt ISR void f Your code goes here Do not use any DOS functions outportb 0x20 0x20 Send EOI command to 8259 In Pascal Procedure ISR Interrupt begin Your code goes here Do not use any DOS functions Port 20 20 Send EOI command to 8259 end Saving the Startup Interrupt Mask Register IMR and Interrupt Vector The next step after writing the ISR is to save the startup state of the interrupt mask register and the interrupt vector that you will be using The IMR is located at I O port 21H The interrupt vector you will be using is located in the interrupt vector table which is simply an array of 256 bit 4 byte pointers and is located in the first 1024 bytes of memory Segment 0 Offset 0 You can read this value directly but it is a better practice to use DOS function 35H get interrup
32. bits in the range then setting only those bits that must be set using the method shown above for setting multiple bits in a port The following example shows how this two step operation is done Example Assign bits 3 4 and 5 in a port to 101 bits 3 and 5 set bit 4 cleared First read in the port and clear bits 3 4 and 5 by ANDing them with 199 Then set bits 3 and 5 by ORing them with 40 and finally write the resulting value back to the port In C this is programmed as v inportb port address v v 4 199 v v 40 outportb port address v A final note Don t be intimidated by the binary operators AND and OR and try to use operators for which you have a better intuition For instance if you are tempted to use addition and subtraction to set and clear bits in place of the methods shown above DON T Addition and subtraction may seem logical but they will not work if you try to clear a bit that is already clear or set a bit that is already set For example you might think that to set bit 5 of a port you simply need to read in the port add 32 2 to that value and then write the resulting value back to the port This works fine if bit 5 is not already set But what happens when bit 5 is already set Bits O to 4 will be unaffected and we can t say for sure what happens to bits 6 and 7 but we can say for sure that bit 5 ends up cleared instead of being set A similar problem happens when you use subtraction to clear a bit in pl
33. call to DOS function X then function X is essentially being called while it is already active Such a reentrancy attempt spells disaster because DOS functions are not written to support it This is a complex concept and you do not need to understand it Just make sure that you do not call any DOS functions from within your ISR The one wrinkle is that unfortunately it is not obvious which library routines included with your compiler use DOS functions A rule of thumb is that routines which write to the screen or check the status of or read the keyboard and any disk I O routines use DOS and should be avoided in your ISR The same problem of reentrancy exists for many floating point emulators as well meaning you may have to avoid floating point real math in your ISR Note that the problem of reentrancy exists no matter what programming language you are using Even if you are writing your ISR in assembly language DOS and many floating point emulators are not reentrant Of course there are ways around this problem such as those which involve checking to see if any DOS functions are currently active when your ISR is called but such solutions are well beyond the scope of this discussion 4 14 The second major concern when writing your ISR is to make it as short as possible in terms of execution time Spending long periods of time in your ISR may mean that other important interrupts are being ignored Also if you spend too long in your ISR it m
34. ce 2 4 CHAPTER 3 HARDWARE DESCRIPTION This chapter describes the features of the 1110 hardware The major circuits are the A D the D A the timer counters and the digital I O lines This chapter also describes the hardware select able interrupts 3 1 3 2 The 1110 board has four major circuits the A D the D A ADA1110 only the timer counters and the digital I O lines Figure 3 1 shows the block diagram of the board This chapter describes the hardware which makes up the major circuits and hardware selectable interrupts 16 S E ANALOG INPUTS G 5V RANGE 0 TO 10V SELECT RESISTOR 16 10 TO 10V 25 VOLTS CONFIGURABLE 0 TO 10 VOLTS GAIN 110 VOLTS INTERRUPT SELECT PULL UP DOWN RESISTORS 1 0 CONNECTOR TIMER COUNTER o V SELECT ADDRESS ADDRESS RANGE SELECT x5 VOLTS 0 TO 5 VOLTS 0 TO 10 VOLTS 10 VOLTS 12 VOLTS Fig 3 1 AD1110 ADA1110 Block Diagram A D Conversion Circuitry The1110 performs analog to digital conversions on up to 16 single ended software selectable analog input channels The following paragraphs describe the A D circuitry Analog Inputs The input voltage range is jumper selectable for 5 to 5 volts 10 to 10 volts or O to 10 volts By adding resistor configurable gain you can amplify lower level signals to more closely match the board s input ranges This gain circuit is described in Chapter 1 Overvoltage protection to 35 vol
35. counter is available at the I O connector where it can be used for interrupt genera tion or for counting functions The timer counters can be programmed to operate in one of six modes depending on your application The following paragraphs briefly describe each mode Mode 0 Event Counter Interrupt on Terminal Count This mode is typically used for event counting While the timer counter counts down the output is low and when the count is complete it goes high The output stays high until a new Mode 0 control word is written to the timer counter 4 17 1110 1 0 CONNECTOR P2 8 MHz MER ok En PIN 39 EXT CLK 0 0 FIN EXT GATE GATE PIN 41 EXT GATE 0 pan PIN 401 T C OUT 0 TIMER PIN 43 EXT CLK 1 O O COUNTER CLK 1 GATE PIN 46 EXT GATE 1 2 PIN 42 1 T C OUT 1 OUT a TIMER COUNTER CLK EXT CLK 2 2 GATE OUT T C OUT 2 Fig 4 2 8254 Programmable Interval Timer Circuit Block Diagram Mode 1 Hardware Retriggerable One Shot The output is initially high and goes low on the clock pulse following a trigger to begin the one shot pulse The output remains low until the count reaches 0 and then goes high and remains high until the clock pulse after the next trigger Mode 2 Rate Generator This mode functions like a divide by N counter and is typically used to generate a real time clock interrupt The output is initially high and when the count decrements to 1 the output goes low for one clock pulse
36. ct the multiplier The top two jumpers set the range bipolar 5 or unipolar 5 The bottom two jumpers set the multiplier X2 or X1 When a jumper is on X2 the range values become 10 and 10 The table below shows the four possible combinations of jumper settings and the diagram shows the factory setting This header does not have to be set the same as P5 Voltage Range 5 s Xx x DAC1 5 5 X1 X2 P4 Fig 1 4 DAC 1 Output Voltage Range Jumper P4 P5 DAC 2 Output Voltage Range Factory Setting 5 to 5 volts This header connector shown in Figure 1 5 sets the output voltage range for DAC 2 at 0 to 5 5 O to 10 or 10 volts Two jumpers must be installed one to select the range and one to select the multiplier The top two jumpers set the range bipolar 5 or unipolar 5 The bottom two jumpers set the multiplier X2 or X1 When a jumper is on X2 the range values become 10 and 10 The table below shows the four possible combinations of jumper settings and the diagram shows thefactory setting This header does not have to be set the same as P4 Jumpers Top to Bottom Voltage Range as b sr d Stossvois ore on on or oto15vots ON or on or oto ovots Orr on or on 0tox10vots on ON Fig 1 5 DAC 2 Output Voltage Range Jumper P5 1 5 P7 Analog Input Voltage Range and Polarity Factory Setting 5 to 5 Volts This header connector shown in Figu
37. cussion of board functions is included in Chapter 3 Hardware Operation and Chapter 4 Board Operation and Programming The board setup is described in Chapter 1 Board Settings Analog to Digital Conversion The analog to digital A D circuitry receives up to 16 single ended analog inputs and converts these inputs into 12 bit digital data words which can then be read and or transferred to PC memory The analog input voltage range is jumper selectable for bipolar ranges of 5 to 5 volts or 10 to 10 volts or a unipolar range of 0 to 10 volts The board is factory set for 5 to 5 volts Overvoltage protection to 35 volts is provided at the inputs A D conversions are performed by an industry standard 12 bit successive approximation converter This high performance converter and the high speed sample and hold amplifier preceding it make sure that dynamic inlut voltages are accurately digitized For a gain of 1 the resolution of a 12 bit conversion over a 10 volt range is 2 4414 volts and the throughput is 40 000 samples per second The converted data is read and or transferred to PC memory one byte at a time through the PC data bus Digital to Analog Conversion ADA1110 Only The digital to analog D A circuitry on the ADA1110 features two independent 12 bit analog output channels with individually jumper selectable output ranges of 5 to 5 volts 10 to 10 volts 0 to 5 volts or 0 to 10 volts Data is programmed into the D A converte
38. d Write A read shows the count in the counter and a write loads the counter with a new value Counting begins as soon as the count is loaded BA 6 8254 Timer Counter 2 Read Write A read shows the count in the counter and a write loads the counter with a new value Counting begins as soon as the count is loaded BA 7 8254 Control Word Write Only Accesses the 8254 control register to directly control the three timer counters D7 D6 D5 DA D3 D2 D1 DO E BCD Binary 0 binary 1 BCD Counter Select 00 Counter 0 01 Counter 1 10 Counter 2 Read Load 11 read back setting Counter Mode Select 000 Mode 0 event count 001 Mode 1 programmable 1 shot 00 latching operation 010 Mode 2 rate generator 01 read load LSB only 011 Mode 3 square wave rate generator 10 read load MSB only 100 Mode 4 software triggered strobe 11 read load LSB then MSB 101 Mode 5 hardware triggered strobe BA 8 Start 12 Bit Conversion Read MSB Data Read Write Writing to this address starts a 12 bit A D conversion the data written is irrelevant A read provides the MSB 8 most significant bits of the A D conversion as defined below The converted data is left justified When you are performing 8 bit conversions only the MSB must be read ms D7 D6 D5 D4 D3 D2 D1 DO 12 Bit Bit11 Bit10 Bit9 Bit 8 Bit 7 Bit 6 Bit 5 Bit 4
39. e assume that you already have an understanding of data acquisition principles and that you can customize the example software or write your own applications programs When You Need Help This manual and the example programs in the software package included with your board provide enough information to properly use all of the board s features If you have any problems installing or using this board contact our Technical Support Department 814 234 8087 during regular business hours eastern standard time or eastern daylight time or send a FAX requesting assistance to 814 234 5218 When sending a FAX request please include your company s name and address your name your telephone number and a brief description of the problem CHAPTER 1 BOARD SETTINGS The AD1110 and ADA1110 boards have jumper and switch settings you can change if necessary for your application The 1110 is factory configured as listed in the table and shown on a diagram in the beginning of this chapter Should you need to change these settings use these easy to follow instructions before you install the board in your computer Note that by installing resistor packs at three locations around the 8255 PPI and soldering jumpers in the associated pads you can configure the 16 available digital I O lines to be pulled up or pulled down This procedure is explained near the end of this chapter Also note that by installing components at R3 R4 TR4 and C14 you can add
40. e metal housing of the computer to discharge any static buildup and then remove the board from its antistatic bag 5 Holding the board by its edges orient it so that its card edge bus connector lines up with the expansion slot connector in the bottom of the selected expansion slot 6 After carefully positioning the board in the expansion slot so that the card edge connector is resting on the computer s bus connector gently and evenly press down on the board until it is secured in the slot NOTE Do not force the board into the slot If the board does not slide into place remove it and try again Wiggling the board or exerting too much pressure can result in damage to the board or to the computer 7 After the board is installed secure the slot bracket back into place and put the cover back on your computer The board is now ready to be connected via the external I O connector at the rear panel of your computer External I O Connections Figure 2 1 shows the 1110 s P2 I O connector pinout Refer to this diagram as you make your I O connections 12 VOLTS DIGITAL GND AIN1 DO AIN9 AIN2 DO AIN10 AIN3 DO AIN11 AIN4 DO AIN12 AIN5 969 AIN13 AING ma AIN14 AIN7 4344 AIN15 AIN8 49 AIN16 AOUT 1 DAD ANALOG GND AOUT 2 ANALOG GND ANALOG GND DA ANALOG GND PA7 3 3 PC7 PAG 25 29 PC6 PA5 67 8 PC5 PA4 PC4 PA3 6 62 PC3 PA2 83 64 PC2 PA1 65 6 PC1 PAO 62 G8 PCO EXT CLK 0 T C OUT 0 EXT GATE 0 T C OUT 1 EXT CL
41. four bits to the right The MSB must also be weighted correctly result msb 16 1sb 16 Start Convert AID Status Converting Not Converting Converting Not Converting End of convert a D o XX o 7 Read Data LSB MSB LSB MSB Fig 4 1 A D Conversion Timing Diagram For a 12 bit conversion the A D data read is left justified in a 16 bit word with the least significant four bits equal to zero Because of this the two bytes of A D data read must be scaled to obtain a valid A D reading For example for a voltage range of 5 volts once the reading is calculated it can be correlated to a voltage value by subtracting 2048 to scale it and then multiplying by 2 4414 millivolts For example if the A D reading is 1024 the analog input voltage is calculated as follows 1024 2048 bits 2 4414 mV bit 2 49999 volts Note that 8 bit A D conversions can also be performed by writing to I O location BA 9 to start a conversion While an 8 bit conversion has a lower resolution it is performed much more rapidly The key digital codes and their input voltage values are given for 12 bit and 8 bit conversions in the following two tables 12 Bit A D Code Table Input Voltage Range 0 to 10 Volts 10 to 10 Volts 5 to 5 Volts Output Code 9 9976 volts MSB 1111 1111 1111 LSB 47 500 vols 15 000 vols 12 500 volts O volts For 0 to 10 8 5 volts 1 LSB 2 44 millivolts for 10 volts 1 LSB 4 88 millivolts Ou
42. grammed by writing the LSB to BA 14 and the MSB to BA 15 The following tables list the key digital codes and corresponding output voltages for the D A converters D A Bit Weight 256 4 16 4997 8 o 00 o Timer Counters An 8254 programmable interval timer provides three 16 bit 8 MHz timer counters for timing and counting functions such as frequency measurement event counting and interrupts All three timer counters are cascaded at the factory Figure 4 2 shows the timer counter circuitry Each timer counter has two inputs CLK in and GATE in and one output timer counter OUT They can be programmed as binary or BCD down counters by writing the appropriate data to the command word as described in the I O map section at the beginning of this chapter One of two clock sources the on board 8 MH7 crystal or an external clock can be selected as the clock input to each timer counter In addition the timer counters can be cascaded by connecting TCO s output to TC1 s clock input and TC1 s output to TC2 s clock input The diagram shows how these clock sources are connected to the timer counters An external gate source can be connected to each timer counter through the I O connector and P8 TC1 and TC2 s gate input jumper P8 When TCO s gate is disconnected an on board pull up resistor automatically pulls the gate high enabling the timer counter TC1 and TC2 can be jumpered to 5 volts at P8 The output from each timer
43. high on one of these lines generates an interrupt request which is handled by the PC s interrupt controller The interrupt controller checks to see if interrupts are to be acknowledged from that IRQ and if another interrupt is already in progress it decides if the new request should supersede the one in progress or if it has to wait until the one in progress is done This prioritizing allows an interrupt to be interrupted if the second request has a higher priority The priority level is based on the number of the IRQ IRQO has the highest priority IRQ1 is second highest and so on through IRQ7 which has the lowest Many of the IRQs are used by the standard system resources IRQO is used by the system timer IRQ is used by the key board IRQ3 by COM2 IRQ4 by COMI and IRQ6 by the disk drives Therefore it is important for you to know which IRQ lines are available in your system for use by the 1110 board 8259 Programmable Interrupt Controller The chip responsible for handling interrupt requests in the PC is the 8259 Programmable Interrupt Controller To use interrupts you need to know how to read and set the 8259 s interrupt mask register IMR and how to send the end of interrupt EOI command to the 8259 e Interrupt Mask Register IMR Each bit in the interrupt mask register IMR contains the mask status of an IRQ line bit 0 is for IRQO bit 1 is for IRQ1 and so on If a bit is set equal to 1 then the corresponding IRQ is masked
44. ith an example of how each is used with Pascal C and BASIC Note that the modulus operator is used to retrieve the least significant byte LSB of a two byte word and the integer division operator is used to retrieve the most significant byte MSB C Yo 8 a b c a b c a b amp c a b c Pascal MOD DIV AND OR a b MOD c a sbDIVc a b ANDc a bORc MOD N AND OR Many compilers have functions that can read write either 8 or 16 bits from to an O port For example Turbo Pascal uses Port for 8 bit port operations and PortW for 16 bits Turbo C uses inportb for an 8 bit read of a port and inport for a 16 bit read Be sure to use only 8 bit operations with the 1110 Clearing and Setting Bits in a Port When you clear or set one or more bits in a port you must be careful that you do not change the status of the other bits You can preserve the status of all bits you do not wish to change by proper use of the AND and OR binary operators Using AND and OR single or multiple bits can be easily cleared in one operation To clear a single bit in a port AND the current value of the port with the value b where b 255 2 Example Clear bit 5 in a port Read in the current value of the port AND it with 223 223 255 2 and then write the resulting value to the port In BASIC this is programmed as V INP PortAddress V V AND 223 OUT PortAddress V 4 8 To set a single bit in a port OR the current value of the port with the
45. iven diagnostics program 1110DIAG which is especially helpful when you are first checking out your board after installation and when calibrating the board Chapter 5 Before using the software included with your board make a backup copy of the disk You may make as many backups as you need C and Pascal Programs These programs are source code files so that you can easily develop your own custom software for your 1110 In the C directory 1110 H and 1110 INC contain all the functions needed to implement the main C programs H defines the addresses and INC contains the routines called by the main programs In the Pascal directory 1110 PNC contains all of the procedures needed to implement the main Pascal programs Analog to Digital SOFTTRIG Demonstrates how to use a trigger for acquiring data Timer Counters TIMER A short program demonstrating how to program the 8254 for use as a timer Digital VO DIGITAL Simple program that shows how to read and write the digital I O lines Digital to Analog DAC Shows how to use the DACs Uses A D channel 1 to monitor the output of DAC1 WAVES A more complex program that shows how to use the 8254 timer and the DACs as a waveform generator Interrupts INTRPTS Shows the bare essentials required for using interrupts INTSTR A complete program showing interrupt based streaming to disk BASIC Programs These programs are source code files so that you can easily develop your own custom software for y
46. l input voltage for each bit weight for all three input ranges Unipolar Calibration Two adjustments are made to calibrate the A D converter for the unipolar range of 0 to 10 volts One is the offset adjustment and the other is the full scale or gain adjustment Trimpot TR3 is used to make the offset adjustment and trimpot TR1 is used for gain adjustment This calibration procedure is performed with the board set up for a O to 10 volt input range Before making these adjustments make sure that the jumpers on P7 are set for this range Use analog input channel 1 and set it for a gain of 1 while calibrating the board Connect your precision voltage source to channel 1 Set the voltage source to 1 22070 millivolts start a conversion and read the resulting data Adjust trimpot TR3 until it flickers between the values listed in the table at the top of the next page Next set the voltage to 9 49829 volts and repeat the procedure this time adjusting TR1 until the data flickers between the values in the table Note that the value used to adjust the full scale voltage is not the ideal full scale value for a O to 10 volt input range This value is used because it is the maximum value at which the A D converter is guaranteed to be linear and ensures accurate calibration results Table 5 1 A D Converter Bit Weights for All Input Ranges a Ideal Input Voltage millivolts 14997 6 0000 0 2500 0 2750 0 49750 5 4 Data Values for
47. m 4 20 D A Conversion Flow Diagram Figure 4 4 This flow diagram shows you how to generate a voltage output through the D A converter ADA1110 only The outputs of both converters are updated each time an update command is issued by writing to BA 10 Write high byte Update DAC No Fig 4 4 D A Conversion Flow Diagram 4 22 CHAPTER 5 CALIBRATION This chapter tells you how to calibrate the 1110 using the 1110DIAG calibration program included in the example software package and five trimpots on the board These trimpots calibrate the A D converter gain and offset and the D A X2 multiplier output 5 1 5 2 This chapter tells you how to calibrate the A D converter gain and offset and the D A converter X2 multiplier ADA1110 only All A D and D A ranges are factory calibrated before shipping Any time you suspect inaccurate readings you can check the accuracy of your conversions using the procedure below and make adjustments as necessary Using the 11 10DIAG diagnostics program is a convenient way to monitor conversions while you calibrate the board Calibration is done with the board installed in your system You can access the trimpots at the edge of the board Power up the system and let the board circuitry stabilize for 15 minutes before you start calibrating Required Equipment The following equipment is required for calibration Precision Voltage Source 10 to 10 volts Digital Voltmeter
48. on channel you must assign values to bits 0 through 3 in the PPI Port B port at BA 1 The table below shows you how to determine the bit settings 4 10 Starting an A D Conversion A D conversions are started by writing to the appropriate I O port For 12 bit conversions Port BA 8 is used For 8 bit conversions Port BA 9 is used A START CONVERT command must be written for each A D conver sion Figure 4 1 shows the timing diagram for A D conversions Monitoring Conversion Status The A D conversion status can be monitored through the end of convert EOC signal This signal the inverse of the STATUS signal output by the A D converter is low when a conversion is in progress and goes high when the conversion is completed This low to high transition can be used to generate an interrupt on P10 Reading the Converted Data The general algorithm for taking an A D reading is 1 Start a 12 bit conversion by writing to BA 8 out base address 8 0 Note that the value you send is not important The act of writing to this I O location is the key to starting a conversion 2 Delay at least 20 microseconds or monitor end of convert for a transition or use an interrupt 3 Read the least significant byte of the converted data from BA 9 lsb inp base address 9 4 Read the most significant byte of the converted data from BA 8 msb inp base address 8 5 Combine them into the 12 bit result by shifting the LSB
49. onjunction with strobes or hand shaking signals Mode 2 Strobed bidirectional input output Lets you communicate bidirectionally with an external device through Port A Handshaking is similar to Mode 1 These modes are detailed in the 8255 Data Sheet reprinted from Intel in Appendix C Interrupts The 1110 has five jumper selectable interrupt sources on P9 timer counter OUTO OUT1 and OUT2 and PPI PCO INTRB and PC3 INTRA The end of convert signal is available as an interrupt on P10 and can be used to interrupt the computer when an A D conversion is completed Chapter 1 tells you how to set the jumpers on the interrupt header connectors and Chapter 4 describes how to program interrupts 3 5 3 6 CHAPTER 4 BOARD OPERATION AND PROGRAMMING This chapter shows you how to program and use your 1110 board It provides a complete description of the I O map a detailed description of programming operations and operating modes and flow diagrams to aid you in programming The example programs included on the disk in your board package are listed at the end of this chapter These programs written in Turbo C Turbo Pascal and BASIC include source code to simplify your applications programming 4 1 4 2 Defining the VO Map The I O map for the 1110 is shown in Table 4 1 below As shown the board occupies 16 consecutive I O port locations The base address designated as BA can be selected using DIP switch SI as described in
50. our 1110 Analog to Digital SINGLE Demonstrates how to perform single conversions SCAN Demonstrates how to change channels while acquiring data Timer Counters TIMER A short program demonstrating how to program the 8254 for use as a timer Digital VO DIGITAL Simple program that shows how to read and write the digital I O lines Digital to Analog DASCAN Demonstrates D A conversion 4 19 Flow Diagrams The following paragraphs provide a description and flow diagram for the 1110 s A D and D A conversion functions These diagrams will help you to build your own custom application programs e Single Convert Flow Diagram Figure 4 3 This flow diagram shows you the steps for taking a single sample on a selected channel A sample is taken each time you send the Start Convert command All of the samples will be taken on the same channel and until you change the value in the PPI Port B register BA 1 Changing this value before each Start Convert command is issued lets you take the next reading from a different channel Program 8255 PPI Port B out Yes Select Channel Change Channel Start Conversion BA 8 for 12 bit BA 9 for 8 bit Check End of Convert EOC 1 Yes Read LSB BA 9 contains bite 0 3 of 12 bit conversion Yes Read MSB BA 8 contains bits 4 11 of 12 bit conversion bits 0 7 of 8 bit conversion Stop Program Fig 4 3 Single Conversion Flow Diagra
51. our Port C Lower lines and four Port C Upper lines The eight lines of Port B are used for internal board functions You can install and connect pull up or pull down resistors for any or all of these three groups of lines You may want to pull lines up for connection to switches This will pull the line high when the switch is disconnected Or you may want to pull lines down for connection to relays which control turning motors on and off These motors turn on when the digital lines controlling them are high The Port A lines of the 8255 automatically power up as inputs which can float high during the few moments before the board is first initialized This can cause the external devices connected to these lines to operate erratically By pulling these lines down when the data acquisition system is first turned on the motors will not switch on before the 8255 is initialized To use the pull up pull down feature you must first install resistor packs in any or all of the three locations near the 8255 labeled PA PCL and PCH PA takes a 10 pin pack and PCL and PCH take 6 pin packs Figure 1 12 shows a blowup of the PA PCL and PCH resistor pack locations After the resistor packs are installed you must connect them into the circuit as pull ups or pull downs Locate the three hole pads on the board below the resistor packs They are labeled G for ground on one end and V for 5V on the other end The middle hole is common PA is for Port A PCL is
52. po 000099150 Ron oa oo 0000000000 Cn 1o HOd 19d vd E ol No Fig 1 14 Diagram for Removal of Solder Short 1 12 CHAPTER 2 BOARD INSTALLATION The 1110 is easy to install in your IBM PC XT AT or compat ible computer It can be placed in any slot short or full size This chapter tells you step by step how to install and connect the board After you have installed the board and made all of your con nections you can turn your system on and run the 11 10DIAG board diagnostics program included on your example software disk to verify that your board is working 2 1 2 2 Board Installation Keep the board in its antistatic bag until you are ready to install it in your computer When removing it from the bag hold the board at the edges and do not touch the components or connectors Before installing the board in your computer check the jumper and switch settings Chapter 1 reviews the factory settings and how to change them If you need to change any settings refer to the appropriate instructions in Chapter 1 Note that incompatible jumper settings can result in unpredictable board operation and erratic response To install the board 1 Turn OFF the power to your computer 2 Remove the top cover of the computer housing refer to your owner s manual if you do not already know how to do this 3 Select any unused short or full size expansion slot and remove the slot bracket 4 Touch th
53. r by two write operations The outputs of both channels are simulta neously updated by a single write operation 8254 Timer Counter An 8254 programmable interval timer contains three 16 bit 8 MHz timer counters to support a wide range of timing and counting functions Digital VO The 1110 has 16 TTL CMOS compatible digital I O lines which can be directly interfaced with external devices or signals to sense switch closures trigger digital events or activate solid state relays These lines are provided by the on board 8255 programmable peripheral interface chip Pads for installing and activating pull up or pull down resistors are included on the board Installation procedures are given near the end of Chapter 1 Board Settings What Comes With Your Board You receive the following items in your 1110 package e AD1110 or ADA1110 interface board e Software and diagnostics diskette with Turbo Pascal Turbo C and BASIC source code e User s manual If any item is missing or damaged please call Real Time Devices Customer Service Department at 814 234 8087 If you require service outside the U S contact your local distributor Board Accessories In addition to the items included in your 1110 package Real Time Devices offers a full line of software and hardware accessories Call your local distributor or our main office for more information about these accessories and for help in choosing the best items to support your board s applica
54. rd and an external device A read transfers data from the external device through P2 and into PPI Port A a write transfers the written data from Port A through P2 to an external device 4 3 BA 1 PPI Port B Channel Select Read Write Programs the analog input channel bottom four bits Reading this register shows you the current settings D7 D6 D5 D4 D3 D2 D1 DO BA 2 PPI Port C Digital I O Read Write Analog Input Channel Select 0000 channel 1 0001 channel 2 0010 channel 3 0011 channel 4 0100 channel 5 0101 channel 6 0110 channel 7 0111 channel 8 1000 channel 9 1001 channel 10 1010 channel 11 1011 channel 12 1100 channel 13 1101 channel 14 1110 channel 15 1111 channel 16 Transfers the two 4 bit Port C digital input and digital output data groups Port C Upper and Port C Lower between the board and an external device A read transfers data from the external device through P2 and into PPI Port C a write transfers the written data from Port C through P2 to an external device BA 3 8255 PPI Control Word Write Only When bit 7 of this word is set to 1 a write programs the PPI configuration The PPI must be programmed so that Port B is a Mode 0 output port as shown below X don t care 4 X X D7 D6 D5 Mode Set Flag 1 active gap N Mode Select 00 mode 0 01 mode 1 10 mode 2
55. re 1 6 sets the analog input voltage range and polarity Two jumpers are installed to select one of three input ranges as shown in the diagram 5 10 and O to 10 volts N ua N N oo oo o o lt lt T lt lt T lt lt T P7 P7 P7 Fig 1 6a 5 to 5 volts Fig 1 6b 10 to 10 volts Fig 1 6c 0 to 10 volts Factory Setting Fig 1 6 Analog Input Voltage Range and Polarity Jumper P7 P8 8254 Timer Counter TC1 amp TC2 Gate Sources Factory Setting GT1 5V GT2 5V This header connector shown in Figure 1 7 lets you select the gate sources for the 8254 timer counters TC1 and TC2 Each gate can be independently connected to 5 volts tied high or to the external gate 1 2 signal at I O connector P2 pin 46 P8 o 5V a EXT o 5V N EXT Fig 1 7 8254 Timer Counter TC1 amp TC2 Gate Source Jumpers P8 P9 Interrupt Source and Channel Factory Setting Jumper on OUT2 Interrupt Channels Disabled This header connector shown in Figure 1 8 lets you connect any one of five interrupt sources to any of six interrupt channels IRQ2 highest priority channel through IRQ7 lowest priority channel To activate a channel you must install a jumper vertically across the desired IRQ channel Figure 1 8a shows the factory setting Figure 1 8b shows interrupt source OUT2 connected to IRQ3 On the left side of the header you can select any one of five signal sources to generate an interrupt An interr
56. t vector Most C and Pascal compilers provide a library routine for reading the value of a vector The vectors for the hardware interrupts are vectors 8 through 15 where IRQO uses vector 8 IRQ1 uses vector 9 and so on Thus if the 1110 will be using IRQ3 you should save the value of interrupt vector 11 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 in the current IMR at I O port 21H and set the bit that corresponds to your IRQ remember setting a bit disables interrupts on that IRQ while clearing a bit enables them The IMR is arranged so that bit O is for IRQO bit 1 is for IRQ1 and so on See the paragraph entitled Interrupt Mask Register IMR earlier in this chapter 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 on your IRQ temporarily disabled you can assign the interrupt vector to point to your ISR Again you can overwrite the appropriate entry in the vector table with a direct memory write but this is a bad practice Instead use either DOS function 25H set interrupt vector or if your compiler provides it the library routine for setting an interrupt vector Remember that vector 8 is for IRQO vector 9 is for IRQ1 and so on If you need to program the source of your interrupts do
57. that next For example if you are using the program mable interval timer to generate interrupts you must program it to run in the proper mode and at the proper rate Finally clear the bit in the IMR for the IRQ you are using This enables interrupts on the IRQ 4 15 Restoring the Startup IMR and Interrupt Vector Before exiting your program you must restore the interrupt mask register and interrupt vectors to the state they were in when your program started To restore the IMR write the value that was saved when your program started to I O port 21H Restore the interrupt vector that was saved at startup with either DOS function 35H get interrupt vector or use the library routine supplied with your compiler Performing these two steps will guarantee that the interrupt status of your computer is the same after running your program as it was before your program started running Common Interrupt Mistakes Remember that hardware interrupts are numbered 8 through 15 even though the corresponding IRQs are numbered 0 through 7 The most common mistake when writing an ISR is forgetting to issue the EOI command to the 8259 interrupt controller before exiting the ISR D A Conversions ADA1110 Only The two D A converters can be individually programmed to convert 12 bit digital words into a voltage in the range of 5 10 0 to 5 or 0 to 10 volts DAC 1 is programmed by writing the LSB to BA 12 and the MSB to BA 13 DAC 2 is pro
58. tion Application Software and Drivers Our custom application software packages provide excellent data acquisition and analysis support Use SIGNAL MATH for integrated data acquisition and sophisticated digital signal processing and analysis or SIGNAL VIEW for monitoring and data acquisition rtdLinx and rtdLinx NB drivers provide full featured high level interfaces between the board and custom or third party software including Labtech Notebook Notebook XE and LT Control rtdLinx source code is available for a one time fee Hardware Accessories Hardware accessories for the 1110 include the MX32 analog input expansion board which can expand a single input channel on your board to 16 differential or 32 single ended input channels MR series mechanical relay output boards OP series optoisolated digital input boards the OR16 mechanical relay optoisolated digital 1 O board the TS16 thermocouple sensor board the TB50 terminal board and XB50 prototype terminal board for prototype development and easy signal access EX XT and EX AT extender boards for simplified testing and debugging of prototype circuitry and the XT50 twisted pair flat ribbon cable assembly for external interfacing Using This Manual This manual is intended to help you install your new board and get it running quickly while also providing enough detail about the board and its functions so that you can enjoy maximum use of its features even in the most complex applications W
59. tput Code For 0 to 10 8 5 volts 1 LSB 39 063 millivolts for 10 volts 1 LSB 78 126 millivolts 4 12 Interrupts What Is an Interrupt An interrupt is an event that causes the processor in your computer to temporarily halt its current process and execute another routine Upon completion of the new routine control is returned to the original routine at the point where its execution was interrupted Interrupts are very handy for dealing with asynchronous events events that occur at less than regular intervals 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 for it to do nothing while waiting for a keystroke to occur Thus the interrupt scheme is used and the processor proceeds with other tasks Then when a keystroke does occur the keyboard interrupts the processor and the processor gets the keyboard data places it in memory and then returns to what it was doing before it was interrupted Other common devices that use interrupts are modems disk drives and mice Your 1110 board can interrupt the processor when a variety of conditions are met By using these interrupts you can write software that effectively deals with real world events e Interrupt Request Lines To allow different peripheral devices to generate interrupts on the same computer the PC bus has eight different interrupt request IRQ lines A transition from low to
60. ts is provided at the inputs A D Converter The 12 bit A D converter when combined with the typical acquisition time of the sample and hold circuitry provides a throughput rate of 40 000 samples per second The A D output is a 12 bit data word Note that 8 bit conversions can be performed when speed is more critical than resolution Eight bit conversions increase the throughput rate to about 45 KHz 3 3 D A Converters ADA1110 Only Two independent 12 bit analog output channels are included on the ADA1110 The analog outputs are gener ated by two 12 bit D A converters with independent jumper selectable output ranges of 5 10 O to 5 or O to 10 volts The 10 volt range has a resolution of 4 88 millivolts the 5 and 0 to 10 volt ranges have a resolution of 2 44 millivolts and the O to 5 volt range has a resolution of 1 22 millivolts Timer Counters An 8254 programmable interval timer provides three 16 bit 8 MHz timer counters to support a wide range of timing and counting functions These timer counters can be cascaded or used individually for many applications Figure 3 2 shows the timer counter circuit block diagram Each timer counter has two inputs CLK in and GATE in and one output timer counter OUT They can be programmed as binary or BCD down counters by writing the appropriate data to the command word as described in Chapter 4 The command word also lets you set up the mode of operation The six programmable modes are
61. upt source is chosen by placing a jumper across the desired pair of pins The interrupt sources available are timer counter outputs OUTO OUT1 and OUT2 and the 8255 PPT s PCO INTRB and PC3 INTRA signals Note that only ONE interrupt source on this header can be activated at a time If you are also using the EOC interrupt on P10 make sure that you select different IRQ channels on each header 22235553555 QO OH H HO OD 0 O O O H ON ms ON Od BO y Fig 1 8a Factory Setting IRQ disabled P9 ol L23353533535 O OHH HO O 0 O O O H ON ms ON Od 5 O O Fig 1 8b OUT2 connected to IRQ3 P9 Fig 1 8 Interrupt Source and Channel Select Jumper P9 P10 EOC Interrupt Channel Select Factory Setting Disabled This header connector shown in Figure 1 9 lets you connect the end of convert signal from the A D converter to an interrupt channel IRQ2 highest priority channel through IRQ7 lowest priority channel To activate this interrupt you must install a jumper vertically across the desired IRQ channel Figure 1 9a shows the factory setting Figure 1 9b shows the EOC interrupt source connected to IRQ4 EOC EOC P10 P10 IRQ o BA an IRQ N O BA AN Fig 1 9a Fig 1 9b EOC Factory Setting connected to IRQ4 Fig 1 9 EOC Interrupt Channel Jumper P10 S1 Base Address Factory Setting 300 hex 768 decimal One of the most common causes of failure when you are first trying your board is address contention Some of yo
62. ur computer s I O space is already occupied by internal I O and other peripherals When the 1110 board attempts to use I O address locations already used by another device contention results and the board does not work To avoid this problem the 1110 has an easily accessible five position DIP switch S1 which lets you select any one of 32 starting addresses in the computer s I O Should the factory setting of 300 hex 768 decimal be unsuitable for your system you can select a different base address simply by setting the switches to any one of the values listed in Table 1 2 The table shows the switch settings and their corresponding decimal and hexadecimal in parentheses values Make sure that you verify the order of the switch numbers on the switch 1 through 5 before setting them When the switches are pulled forward they are OPEN or set to logic 1 as labeled on the DIP switch package When you set the base address for your board record the value in the table inside the back cover Figure 1 10 shows the DIP switch set for a base address of 300 hex 768 decimal Decimal Hex 54321 Decimal Hex 54321 0 closed en 0 closed 1 open Fig 1 10 Base Address Switch S1 Pull up Pull down Resistors on Digital I O Lines The 8255 programmable peripheral interface provides 16 TTL CMOS compatible digital I O lines which can be interfaced with external devices These lines are divided into three groups eight Port A lines f
63. value b where b 2 Example Set bit 3 in a port Read in the current value of the port OR it with 8 8 25 and then write the resulting value to the port In Pascal this is programmed as V Port PortAddress V V OR 8 Port PortAddress V Setting or clearing more than one bit at a time is accomplished just as easily To clear multiple bits in a port AND the current value of the port with the value b where b 255 the sum of the values of the bits to be cleared Note that the bits do not have to be consecutive Example Clear bits 2 4 and 6 in a port Read in the current value of the port AND it with 171 171 255 2 2 2 and then write the resulting value to the port In C this is programmed as v inportb port address v v amp 171 outportb port address v To set multiple bits in a port OR the current value of the port with the value b where b the sum of the individual bits to be set Note that the bits to be set do not have to be consecutive Example Set bits 3 5 and 7 in a port Read in the current value of the port OR it with 168 168 234 2 27 and then write the resulting value back to the port In assembly language this is programmed as mov dx PortAddress in al dx or al 168 out dx al Often assigning a range of bits is a mixture of setting and clearing operations You can set or clear each bit individually or use a faster method of first clearing all the
64. when the interrupt occurred are now popped from the stack and execution resumes from the point where it was interrupted Using Interrupts in Your Programs Adding interrupts to your software is not as difficult as 1t may seem and what they add in terms of performance is often worth the effort Note however that although it is not that hard to use interrupts the smallest mistake will often lead to a system hang that requires a reboot This can be both frustrating and time consuming But after a few tries you ll get the bugs worked out and enjoy the benefits of properly executed interrupts In addition to reading the following paragraphs study the INTRPTS source code included on your 1110 program disk for a better understand ing of interrupt program development e Writing an Interrupt Service Routine ISR The first step in adding interrupts to your software is to write the interrupt service routine ISR This is the routine that will automatically be executed each time an interrupt request occurs on the specified IRQ An ISR is different than standard routines that you write First on entrance the processor registers should be pushed onto the stack BEFORE you do anything else Second just before exiting your ISR you must write an end of interrupt command to the 8259 controller Finally when exiting the ISR in addition to popping all the registers you pushed on entrance you must use the IRET instruction and not a plain RET The IRET autom
65. x A D Converter ANAN AN AD574 Type acid is Successive approximation Ae amp solution 4 che ec 12 bits 2 44 mV 10V 4 88 mV 20V LING ality tia ead ned reves 1 LSB typ Conversion speed orriren en non cnn cnn cnn rra 20 usec typ Sample and hold acquisition time ecceeceeeeeeeeeeeeeeeeeeeeeeeeeeeteneeteaeeeeete 5 usec typ Throughput aiios a n rta 40 kHz Digital Qian nee CMOS 82C55 N mber of TINGS iride a ann ana 16 Logic compatibility aa ain ett n etre KAPA TTL CMOS Configurable with optional I O pull up pull down resistors High level output voltage ooooocococcconocccononcncnnoncncnanonononononnnn emere 4 2V min Low level output voltage coooccononcccnnonnconanncononnnnnon corno ocn nano cnn nn nr r nar nnnrnnnnnns 0 45V max High level input voltage coooooococccncncocccccccnnnnncccnccnnnno cono nnnannncnncnns 2 2V min 5 5V max Low level input voltage cocoococcccnnnnncccccccccconancccnnconnnnnconnnnnnnnnnnnns 0 3V min 0 8V max Input load curtir 10 pA Input capacitance CNYOESTMBI tir ee reete te tods 10 pF Output capacitance C OUT QESTMEBZ i AGAD 20 pF D A Converter ADA1110 Only cnooooccccccncnonnnononnnnnnononnnnnnanonnrnnannannrnrnnnnass AD7237 Analog Outputs dual 2 channels Resolution siisi messed ces tc e fas rcu idi ota ea c c he RE ERR eye id daa 12 bits Output range S e ka eic n ugue 0 to 5 5 or O to 10 volts Guaranteed linearity across output ranges
Download Pdf Manuals
Related Search
Related Contents
Miele G 1202 User's Manual manuel d`utilisation et d`entretien Mini Clock Radio Night Vision Hidden Camera Tricity Bendix SI 400GR User's Manual New Directions 5 - Higher Education Academy 2.0MB A警告 Operating Instructions - Firmware Center Copyright © All rights reserved.
Failed to retrieve file