A simple microcomputer-controlled device for automated measurement of refractory period of excitable tissue

A simple microcomputer-controlled device for automated measurement of refractory period of excitable tissue

A Simple Microcomputer-controlled Device for Automated Measurement of Refractory Period of Excitable Tissue D. BOSE, J. DELAIVE, AND E.W. A computer...

514KB Sizes 0 Downloads 29 Views

A Simple Microcomputer-controlled Device for Automated Measurement of Refractory Period of Excitable Tissue

D. BOSE, J. DELAIVE, AND E.W.

A computer-controlled

tissue

MAZERALL

stimulator

interface

will

be described.

This device

pulse is introduced after a selected number of pulses. The initial latency of this extra pulse is shorter than the tissue refractory period. The latency is increased, automatically, until the tissue produces a conducted response. This is made possible by the computer checking the tissue response. The device is inexpensive and can be readily controlled by any 8 bit microcomputer, such as the Commodore PET or VIC-20. The use of a signal conditioner has been discussed. Such a circuit facilitates detection of the often slowly occurring action potential of the premature beat riding on the repolarization phase of the normal action potential. can generate

a basic train

at a predetermined

Key Words:

Tissue stimulation;

rate. An extra

Extrasystole; Computer-controlled

device

INTRODUCTION

Electrically excitable cells in nerve, heart, and other tissues do not respond to stimulation unless they get a period of rest after each stimulus. This phenomenon is called “refractoriness” and the measurement of “refractory period” is an important technique. The success of such measurements rests upon accurately following an experimental protocol consisting of interpolation of an extra beat with a gradually increasing or decreasing coupling interval following a normal beat. A device that will allow automating the measurement of refractory period can be of great value in biomedical research by standardizing the experimental protocol and by reducing the tedium of following such a protocol. The recent popularity of 8 bit single board and “personal” microcomputers and the availability of versatile programmable counter chips (e.g., Motorola 6840) makes the task of automating refractory period measurements easy. The interface described in this article is designed to be controlled by the Commodore PET or the WC-20 computer but can be easily adapted to other types of computers that have a parallel port and externally accessible address, data, clock, and read/write lines.

From the Department of Pharmacology and Therapeutics, Faculties of Medicine and Dentistry, University of Manitoba, Winnipeg, Manitoba, Canada. Address requests for reprints to Dr. D. Bose, Department of Pharmacology and Therapeutics, Faculties of Medicine and Dentistry, University of Manitoba, Winnipeg, Manitoba, Canada R3E OW3. Received November 9,lVBl; revised and accepted February 19,1982

91 Journal of Pharmacological B 1982 Elsevier

North

Methods

Holland,

8, 091-098 (1982)

inc., 52 Vanderbilt

Avenue,

New York,

NY 10017

Ol60-5402/8ZO6D9108$0202.75

92

D. Bose et al.

METHODS System Requirement The interface was required to generate rectangular transistor-transistor logic (lTL) compatible pulses at a predetermined regular rate. These pulses were used to stimulate cardiac tissue via a triggered stimulator (e.g., F. Haer Pulsar) either beating in the body of an experimental animal or in an artificial nutrient solution outside the body. The stimuli generated an electrical response in the tissue (action potentials) that can be monitored by placing electrodes on the surface of the tissue or by inserting a microelectrode inside a cell. After a number of such “normal” beats the interface was required to produce an “extra” beat inserted between two normal beats. If this beat was earlier than the refractory period then the tissue did not fire an action potential. The computer sensed this and after a number of normal beats sent an extra beat with a delay 10 msec longer than the previous extra beat. This cycle was repeated until the extra beat caused a tissue response. When this was noticed by the computer the next extra beat was generated 10 msec earlier and was, predictably, not able to excite the tissue. The interval between the normal beat and extra beat was now incremented by 1 msec each time until a response occurred. The interval at which this occurred was the “refractory period.” Hardware

Considerations

MC6840 Timer At the heart of the interface is the Motorola 6840 programmable timer. Each timer has three built in counters that can operate in a wide variety of modes. The two most pertinent ones are the 16 bit continuous and one-shot modes. Eight memory locations in the computer are assigned to each timer. The counter operating modes are selected by outputting data to control registers occupying the first two locations. 16 bit data for each of the three counters is addressed to latches occupying successive pairs of the last six memory locations. The method of implementing the various timer modes is described more fully in the data sheet issued by Motorola (1978). However, information necessary for the current application is summarized below. In this mode two 8 bit words of data are stored in the 16 bit continuous mode. latch. When the counter is initialized by holding the gate at ground potential, the counter starts counting down from one more than the number put into the latches. Countdown rate depends upon the system clock frequency or the frequency of an external clock pulse fed into the input pin of the counter. This selection is done by putting a 0 or a 1 in bit 1 of the control register. When the counter has counted down to 0, its output changes state and the cycle is repeated. Thus if a number 1 is entered, the output will return to its original state after 2 cycles. To make the counter output a pulse after each cycle, a transition detector (an exclusive OR gate with an R/C delay built between the 2 inputs) has to be connected to the counter output, Bit 7 has to be set to 1 to allow the output of the counter to function. For the counter to work in the continuous mode, bits 3,4, and 5 should be 0. Bit 6 also has to be 0, since interrupt is not being used. Taking all this into consideration,

Automated

Refractory Period Measurement

a number of 128 (decimal) in location 1 (with 1 in location 2) will cause counter 1 to operate in a continuous mode and use an external clock signal for the countdown. A number of 130 will cause the counter to use the internal system clock for the countdown. Likewise 128 (decimal) in location 2 will get it in the continuous mode and because bit 1 is 0, a subsequent insertion of any value into location 1 will cause it to control counter 3. If on the other hand, one puts 129 into the second counter, a number put into location 1 will control counter 1. One other feature of counter 3 is that if bit 0 is set to 1 the counter divides the clock input signal by 8. However, if bit 0 is 0 then the counter divides the input signal by 1. The latter mode is the one used in this device. When bit 0 of counter 1 is set to 1 all counters are reset and stop. When set to 0 all data are loaded from the latch into the three counters, the counters are initialized, and they start counting. The continuous counter is used to divide the system clock signal (1 mHz) by 1000. It is also used to produce the normal pulses and to count their number. 16 bit one-shot mode. Bit 7, 6, 1, and 0 behave in the same manner as above. Bits 4 and 5 are set to 1. In this mode the output is initially low. By momentarily holding the gate pin at ground potential (cf. continuous mode in which it has to be held low for the entire duration of the operation). the output pin goes high and the counter starts counting down from a number that is 1 larger than the number entered into the latches. When the number decrements to 0 the output returns to

To

Slave b

Stimulator x

A2

Al

I

I

FIGURE 1. Functional interconnection of different logic modules in the interface (refer to text for details): Al, AZ, A3, Bl, and B2 = Motorola 6840 timers; TDl and TD2 consist of exclusive OR gates (74LSBB)with a capacitor between the two inputs; AND1 and AND2 consist of 74LSBB ; OSl, OS2, OS3, and OS4 consist of one shots (74LS123).

93

\-Extr.

Saat

Delay

(ES)

.

NO L SIGNAL

AT c

OAD

CAI?

Y98

EB

DELAY

t IGNAL

FIGURE 2. period.

10

20 30 100 110 120 130 140 200 210 220 230 240 300 310

AT

CAI?

f

Flow chart depicting software design for automated

measurement

of refractory

REM PROGRAM TO GENERATE NORMAL AND EXTRA BEATS FOR AUTOMATED REFRACTORY PERIOD MEASUREMENT. REM D. BOSE/J. DELAIVE/E.W. MAZERALU UNIV. OF MANITOBA REM DEPT. OF PHARMACOLOGY/753 MCDERMOT AVE./WINNIPEG/MAN./CANADA/R3EOW3 REM ASSIGN VARIABLES AND SET UP PARALLEL PORT MODES. FL=O: TA=45064: TB=45072: DA=59471: HD=59457: PR=59468: IR=59469: AR=59467: DD=59459 POKE DD, 140: REM SET DDR FOR PAO-4 FOR INPUT & PA5-7 FOR OUTPUT POKE PR, PEEK (PR) OR 1: REM CONFIGURE CA1 FOR DETECTING +VE EDGE POKE AR, 1: CONFIGURE INPUT PORT IN LATCHED MODE REM PARAMETERS ENTRY INPUT “NORMAL PULSE INTERVAL”; B: X=B: GOSUB 1000: BA=XA: BB=XB INPUT”N0. OF NORMAL PULSES”; N: X=N: GOSUB 1000: NA=XA: NB=XB INPUT “INITIAL EXTRABEAT DELAY”; E: X=E: GOSUB 1000: EA=XA: EB=XB INPUT “SCOPE TRIGGER DELAY”; S: S=(B x N)-S: X=S: GOSUB 1000: SA=XA: SB=XB. REM SET UP COUNTERS POKE TA + 1,0: POKE TB + 1,0: REM ALLOW COUNTERS NO. 3 TO BE SET

FIGURE 3. A program in BASIC for the Commodore variables used by the program.

PET or VIC-20 computers and a list of

95 320 330 348 350 360 370 400 410 420 430 440 450 500 SIO 520 530 540 608 610 620 700 710 720 1000 1010

POKE TA, 130 REM SET COUNTER 3 TIMER A FOR 16 BIT CONTINUOUS MODE INTERNAL CLOCK POKE TA + f ,129: REM SET COUNTER 2 TIMER A FOR 16 BIT CONTINUOUS MODE, EXTERNAL CLOCK AND SET BIT 1 TO ALLOW COUNTER 1 TO BE SET POKE TB,O: REM COUNTER 3 TIMER B NOT USED POKE TB + 1,177: REM SET COUNTER 2 FOR 16 BIT ONE SHOT MODE EXTERNAL CLOCK AND ALLOW COUNTER 1 TO BE SET POKETA,l28: REM SET COUNTER 1. TIMERA IN 16 BIT CONT. MODE AND GET ALL COUNTERS GOING POKE TB,176: REM SET COUNTER 1. TIMER B IN 16 BIT ONE-SHOT MODE AND GET ALL COUNTERS GOING REM LOAD DATA POKE TA + 2,BA: POKE TA + 3,BB: REM MSB/LSB NORMAL INTERVAL POKE TA + 4,NA: POKE TA + 5,NB: REM MSB/LSB FOR NO. OF NORMAL PULSES POKE TA + 6,l: POKE TA + 7,244: REM MSBILSB FOR DIVIDE BY 1000 COUNTER POKE TB f 2,0: POKE TB + 3,0: REM SET EXTRABEAT DELAY TO 0 POKE TB + 4,SA: POKE TB + 5,SB: REM MSBiLSB FOR SCOPE TRIGGER DELAY WAIT IR,2: REM WAIT FOR CA1 TO GO HIGH/IF NOT THEN RECYCLE POKE TB + 2,EA: POKE TA + 3,EB: REM LOAD INITIAL EXTRABEAT DELAY WAIT IR,2: REM WAIT AGAIN IF PEEK (HD) AND 141 THEN 600: REM EXIT IF EB PULSE IF PEEK (HD) AND 142 THEN 708: REM EXIT IF NORMAL PULSE REM EB PULSE HANDLING ROUTINE IF FL = 0 THEN FL = 1: E = E - 10: X = E: GOSUB %lOO: EA=XA: EB=XB: GOT0 500: REM CHECKS FLAG/SETS IT IF NOT SET AND DECREMENTS ES BY IO IF FL = 1 THEN PRINT CHR $(347); “REFRACTORY PERIOD = “; E: END REM PULSE HANDLING ROUTINE IF FL = 0 THEN E = E + 10: X = E: GOSUB 1000: EA=XA: EB=XB: GOT0 500: REM IF FLAG NOT SET THEN INCREASE ES BY 10 IF FL = 1 THEN E = E + 1: X = E: COSUB 1000: EA=XA: EB=XB: GOT0 500: REM IF FLAG SET THEN INCREASE ES BY 1 REM SUBROUTINE TO SPLIT 16 BIT WORD INTO TWO 8 BIT BYTES XA=X/256: XB=X - (XA x 256): RETURN VARIABLES TA TB DDR DA CA B N E

= = = = = = = =

Base address of Timer A Base address of Timer B Parallel port data direction register Parallel port latched data input CA1 configuration (responds to +Ve going transition) Basic cycle interval (BABB) (MSB/LSB) No. of pulses in Basic cycle (NA/NB) (MSB/LSB) Extrabeat interval (EA/EB) (MSB/LSB)

S FL IR DA HD PR AR DD

= = = = = = = =

Scope trigger latency (SA/SB) (MSB/LSB) Flag for conducted beat Interrupt flag register (59469 PET) (37149 VIC) Data register (59471 PET) (37136 VIC) Data with handshake (59457 PET) (37136 VIC) Peripheral control register (59468 PET) (37148 VIC) Auxiliary control register (59467 PET) (37147 VIC) Data direction register (59459 PET) (37139 VICE

FIGURE 3. (Continued)

96

D. Bose et al. ground level. Another initialization by grounding the gate restarts the whole cycle. The one shot is used to generate the extra beat and the scope trigger signal. interface The basic interconnections are shown in Figure 1. Counter Al (NORMAL INT) generates the normal pulses. After each cycle its output changes state. Transition detector (701) generates a short positive going pulse at each transition. This pulse is inverted and sent to countdown counter A2. The transition detector consists of an exclusive OR gate in which the inputs are connected together via an R/C delay circuit. Each pulse from TDI causes countdown counter (CD) to decrement. When the set number of normal pulses has been counted, the output changes state and the transition detector (TD2) produces a positive going pulse that triggers the extra beat (EB) (Bl), and scope trigger (SCOPE TRIG) (B2)one shots. Outputs of both one shots go high for set periods of time. A negative edge-triggered one shot connected to the output of EB one shot causes a pulse (extra beat) delayed with reference to the normal beat. The extra beat pulse is ORed with the normal beats (OR) and the output is used to trigger a slave tissue stimulator that drives the heart. To detect whether the extra beat excites the tissue or not a combination of AND (1 and 2) and OS (2, 3, and 4) is used. Any tissue pulse coming via one shot (OS4) alerts the computer via the CA1 (or CBI in the case of the VIC-20) line in the parallel port. The computer immediately reads the latched data in the input port. If bit 0 is set, then the pulse is believed to be synchronous with the normal pulse a 10 msec long pulse from OS2 gates AND I). On the other hand if bit 1 of the input port is set then the response is believed to coincide with the extra beat stimulus (this time a 10 msec long pulse from OS3 triggered by OS1 controls data flow through AND 2). Depending on the nature of the tissue response, the extra beat delay is incremented or decremented under software control according to the protocol shown in Figure 2. The exact memory locations assigned to the timers can be determined by setting up decoders (not shown in schematic) using the computer’s address lines. Base address locations of BOO8(Hex) and 8010 (Hex) for timers A and B, respectively, will suit both the PET as well as VIC-20 computers. Both the address lines as well as the 8 data lines should preferably be buffered. The interface was wire-wrapped on a prototype board and 5 volt power was provided from a regulated supply. The whole unit can be enclosed in one of the many commercially available metal cabinets. Connection between the host computer and the interface can be made with a flat ribbon cable, with the length being kept shorter than 12 in. Alternately the interface can be installed inside the PET cabinet. The small VIC-20 cabinet precludes such an installation. DISCUSSION This interface is inexpensive to construct and the software to run it is in BASIC (Fig. 3). This lends itself to easy user modification. Parameters are input with the help of prompts. Although the device was primarily designed for study of heart muscle, it can be easily adapted for stimulation of other tissues. One of the counters

Automated

Refractory Period Measurement

MV

FIGURE 4. (1980).

Block diagram of tissue signal processing circuit. Triggers 1 and 2 based on Cisek

(B3) is presently unused and can be conveniently used to generate another extra pulse if necessary. Recently designs of several computer-controlled stimulators have been published (Billette et al., 1979; Elharrar, 1980; Propst and Foster, 1980). The present design has been optimized for refractory period and strength interval measurements and is simpler in design. The following precautions have to be observed in the measurement of refractory period.

i) The pulse coming from the tissue has to be conditioned

so that artifacts arising from the stimuli are separated from those arising from the tissue itself. A simple solution of this problem is to use two DC coupled triggers (Cisek, 1980). One of them is adjusted to respond optimally to the fast rising normal action potential and the other to the slower extra systole. This circuit produces a positive going output at negative going deflections. The output of each of these triggers is ANDed with the corresponding stimulus (to reject unwanted triggering) and the two trigger outputs ORed to give a composite output to the computer interrupt input (CAI) (Fig. 4). ii) A second problem may arise from the fact that the method described in this article measures refractory period after making two passes-an initial one with coarse increments and a subsequent one with fine ones. This has the advantage of rapid determination in spite of a 1 msec resolution. However, the first conducted beat can change the subsequently measured refractory period considerably unless a large number of normal beats is interposed between the extra beats. This work was supported Foundation.

by the Manitoba

Heart Foundation and the St. Boniface Hospital Research

REFERENCES Billette R, Guard0 R, Bertrand M, Lafortune M, Roberge FA (1979) Microcmputer-based stimual-

tor for clinical and experimental investigations in electrophysiology. PACE 2:20-27.

97

98

D. Bose et al. Cisek AM (1980) DC-coupled trigger updates quickly. Nectronics 53 : 99. Elharrar VA (1980) A computer-controlled stimulator with applications to cardiac electrophysiology. Am / Physiol239:H278-H282.

Motorola Data Sheet MC68B40-Motorola Inc., Texas, DS9802.

(1978) MC6840/MC68A40/ Semiconductor Products

Propst RH, Foster JR (1980) A microprocessor-controlled dual channel stimulator. IEEE Trans Biomed Eng BME-27:171-174.