Note: Descriptions are shown in the official language in which they were submitted.
~` -" l 16052~
This invention relates to apparatus for internally implanted
electronic devices adapted to be operated to deliver a fluid medicine to a
desired location within a human body.
A number of approaches have been followed in the prior art for the
dispensing of medical substances in the body.
In United States Patent No. 3~527,220 of Summers, issued September 8,
1970, an implantable drug administrator is shown which operates with a
refillable bladder reservoir and a roller pump which is driven by a magnet
located outside the body.
In United States Patent No. 3,951,147 of Tucker et al, issued
April 20, 1976, a reservoir is formed from a bellows enclosed within a hous-
ing. The contents of the reservoir are pressurized by a fluorocarbon fluid
located in the space between the housing and bellows. The unit continuously
dispenses the liquid to the body site through a capillary tube.
In United States Patent No, 4,146,029 of Ellinwood, Jr., issued
March 27, 1979, a dispenser is shown which dispenses drugs in a predeter-
mined manner which may be modified somewhat by means external to the body.
A piston and bellows pumping device is used to dispense the drug.
A problem with such prior art, implantable drug administration
devices is that there was no way to provide a simple external means to
select the dosage amounts and intervals from a wide range of possible doses
and intervals, and verify that a desired change had been made. Still an-
other problem is the lack of provision in the prior art for a simple means
to inhibit operation of the device.
In accordance with a broad aspect of this invention, there is pro-
vided an implantable drug administration device of the type having a drug
reservoir enclosed within a protective case, an inlet to the reservoir, an
outlet from the reservoir and a means for forcing the drug from the
reservoir at a constant positive pressure, said device further comprising:
means within said case and connected to said outlet from said reservoir for
-1- q~ -
l 160529
receiving the drug from said reservoir, for metering a measured amount of
the drug, and for pumping said measured amount of drug out of said case,
and control means for automatically causing said device to pump a measured
amount of drug out of said case, wherein said means for receiving, metering
and pumping comprises a stepper motor and a pump connected to the stepper
motor.
The control means may comprise a digital computer and in particular
a microprocessor.
The device is programmed as to dosage and interval by an external
programmer. A "special" external programmer can reprogram an implanted
device to alter its "personality" i.e. the duration of the stepper motor
drive pulses, the delay time between pulses and the number of pulses to be
dispensed for a dosage command can all be altered.
The advantages of the present invention will become more apparent
by referring to the following detailed description and accompanying drawings,
in which:
Figure 1 is a pictorial view of the drug administration device
implanted beneath skin (shown in phantom) with the reservoir thereof being
filled by means of a hypodermic syringe;
Figure 2 is a plan view of the drug administration device of Figure
l;
Figure 3 is a plan view of the drug administration device of Figure
2, but with the covering shield removed and turned over along side;
Figure 4 is a view of covering shield taken along line 4-4 of
Figure 3;
~,J -2-
1 16Q52!~
Figure 5, on the first sheet of drawings, is an exploded view
of the drug administration device with catheter not shown;
Figure 6 is a cutaway elevational view of the drug administ-
ration device taken along lines 6-6 of Figure 2;
Figure 7 is a cutaway bottom plan view of the drug administrat-
ion device with part cutaway to reveal the reservoir and associated elements
thereof;
Figure 8 is a sectional view of the filter taken along lines
8-8 of Figure 7, and a detail of Figure 6 taken at 8 thereof and shown in
enlarged scale;
Figure 9, on the second sheet of drawings, is a section of
pump/meter taken along line 9-9 of Figure 1, and a detail of Figure 3 taken
at 9 thereof and shown in enlarged scale;
Figure 10 is a section of the pump taken along line 10-10 of
Figure 9;
Figures llA and llB are a detailed schematic diagram of the
electronics module of the drug administration device;
Figure 12 is a block diagram of the programming of the drug
administration device showing the interrelationship of the executive pro-
gram and the various subroutines shown in Figures 13 through 19;
Figure 13 is a flow chart of the Executive Program;
Figure 14 is a flow chart of the Motor Control Subroutine;
Figure 15 is a flow chart of the Acoustic Output Data Sub-
routine;
Figure 16 is a flow chart of the Output Delay Subroutine;
Figure 17 is a flow chart of the Read New Data Subroutine;
Figure 18, on the thirteenth sheet of drawings, is a flow chart
of the Accept New Parameters Subroutine; and
Figure 19, on the tenth sheet of drawings, is a flow chart of
the Interrupt Subroutine.
t 160529
--4--
Descri~tion of the Preferred Embodiment.
Referring nDw to Figure 1, the drug administra-
tion device 10 is shown implanted below a layer of skin
12, shown in phantom outline only. The drug administra-
tion device has a port 14 into which a hypodermic needle16 can be inserted through ~he skin 12 to inser~ a
quantity of a liquid drug, such as heparin, rphine, or
some other drug, through a septum 18 into a drug reser-
voir A located within the drug administration device 10.
The liquid drug is delivered from the drug administration
device 10 through a catheter port 20 to which a catheter
22 is attached. The catheter 2Z is positioned to deliver
the medication to a particular point in the body. The
catheter has a separate lumen 23 shown in Figure 9 to
permit it to be positioned at the time of implant, using
a suitable stylet.
Figure 3 shows the drug administration device
with the covering shield 24 removed. The shield is formed
from titanium or some similar appropriate non-magnetic
material, as are the other parts of the device which are
exposed to body tissue and fluids in the implanted unit.
A resonator, annunciator or transducer 26 is bonded to
the inner surface of shield 24, as is shown in Figures 3
and 4. Transducer 26 is suitable for producing an audio
output audible outside the body when excited by an elec-
trical signal in the audio range. The shield 24 is
excited by transducer 26, to facilitate transmission of
the audio energy from the body. A suitable transducer
26 can be purchased from Kyocero International. The
30 -transducer is driven by a conductor 28 connected to an
output terminal 9 of an electronic module 3Z which has a
detailed electrical schematic as shown in Figures llA and
llB.
The circuit module 32 is driven by suitable
batteries 34 and 36, which are connected to the battery
input terminals 1 and 2 of the electronic module 32 by
suitable conductors 3~. The batteries are restrained from
' i ,
l 160529
--5--
movement within the devic~ by a non-inductive spacer cup
40 which is attached to the frame 42 of the device.
Also attached to frame 42, is the metering
- pump 44. Pump 44, which is shown in more detail in
Figures 9 and lO, i5 a roller pump. In Figure 10, it can
be seen that a motor 46 drives a gear train 48, which in
turn drives a shaft 50 which is connected to an arm 52.
Motor 46 is a two pole subminiature stepping motor of the
type used in digital watches having analalog time indi-
cating means. Such motors are manufactured by SeikoCorporation. The winding of Motor 46 is driven by
electrical pulses from pins 10 and 11 of electronics
module 32, which step the motor through a fixed arc for
each pulse.
Rollers 54 are each mDunted for rotation about
their axes at both ends of arm 52, which is rotatable
through 360. As shaft 50 is rotated, arm 52 and rollers
54 are rotated about the axis of shaft 50. The arm is
located within a housing 56 and a flexible tube 58 lines
the interior wall of housing 56 as shown in Figure 9. A
shim 59 is interposed between rollers 54 and tubing 58 to
aid in balancing the forces applied to shaft 50 as rollers
54 traverse a complete revolution of shaft 50. As shaft
50 rotates, the wheels 54 roll along shim 59 and compress
tubing 58 against the inner wall of housing 56.
Pump 44 is connected to catheter port 20, which
provides an outlet conduit 62 which is connected to cathe-
ter 22, which can be screwed onto port 20, and receives
its input from an inlet conduit 64, which is connected to
an inlet port 66, which communicates with the fluid
reservoir l9 through a filter 70 shown in Figure 7 and in
cross section in Figures 6 and 8. As shown in Figure 8,
the filter 70 is comprised of a clamping ring and screen
72 which has a number of holes 73 therein for permitting
the flow ~f a liquid therethrough. The clamp ring and
screen 72 holds a pair of fLne filters 74 for screening
out any particles of skin or hair which could have reached
.. ~ _ ; . . ,, .... ", . .. . . . .. .. . ...... . . . ...... .
,' ''`~`
, .. ,~ .,~. . . .
~ 16~529
the fluid reservoir 19 when the reservoir is filled utilizing a hypodermic
needle inserted through the patient's s~in.
The reservoir 19 is formed with its top portion being the
underside of housing 42, and its lower portion formed from a flexible
diaphragm. The flexible diaphragm 76 is protected by a lower shield 78,
which forms a seal against a projecting flange 80, which has a plurality
of circumferential sealing grooves 81, which projects from housing 42.
The upper shield portion 24 is also seated against the flange 80. The
diaphragm is secured to the housing 42 with a circumferential Teflon band
84 and a suitable adhesive to form a sealed reservoir.
After the sealed reservoir 19 has been formed, and lower shield
78 has been positioned against flange 80 of housing 42, the space between
diaphragm 76 and the lower housing 78 is evacuated through the hole 82
shown in Figure 5, and a small amount of a suitable fluorocarbon liquid
is inserted in the hole to backfill the device. The hole 82 is then
welded to seal the unit. In one embodiment, approximately 2.5 CCs of
C Fluorinert ~'IC88 is inserted in the unit. The amount of fluorocarbon
fluid, or other suitable volatile fluid is selected to provide a positive
pressure against bellows 76 when the administration device is implanted in
the patient's body. As is well-known in the art such a volatile fluid
exerts a constant vapor pressure at a given temperature regardless of
volume. Thus, the constant positive pressure compresses bellows 76 and
urges the liquid contents of the reservoir 19 through the filter 70. The
fluid is forced through the screen 72 and the filter segments 74 to the
input port 66 of pump 56. As pump 56 rotates, the rolling action of
rollers 54 at the ends of arm 52 allows a predetermined amount of liquid
to be either pumped or metered from reservoir 19 through the catheter 22 to
the location within the body where it is desired to apply the medical fluid.
The fluid supply in the reservoir is periodically reple.nished by
applying a hypodermic needle 16 as shown in Figure 1. The hypodermic
needle pierces the
f~&
1 1605~9
septum 18. As shown in Figure 6, the septum 18 is seated
against a plug 84. The plug 84 and septum 18 are mounted
in a projesting neck portion 86 of the housing 42. Neck
portion 86 has a central opening to permit access to
septum 18 by hypodermic needle 16. Needle 16 is forced
through the septum 18, which may be formed of a silicone
rubber compound. If the hypodermic needle 16 has a
rounded blunt tip and a delivery port located on the snaft
of the needle, the insertion of the needle through the
septum 18 will not cause a permanent hole to form in septum
18. After the hypodermic needle has been forced through
the septum, its contents are delivered into the chamber in
plug 84 under pressure when the pressure of its contents
exceeds the pressure of reservoir 19, which is typically
3 to 5 psi. The fluid is forced into reservoir 19 through
apertures 88 in plug 84, and bellows 76 is expanded to
accept the fluid. The hypodermic needle is then withdrawn
and the silicone rubber of septum 18 reseals.
Turning now to the electrical schematic of
Figures llA and llB, the detailed circuitry of electronic
module 32 is shown. Batteries 34 and 36 apply a fixed
voltage to the constant current source circuit of transis-
tors Ql and-Q2, which provides a constant current to the
individual circuit elements within electronic module 32
to minimize drain on batteries 34 and 36. The reed switch
89 is encapsulated in the electronic module, and is
actuated by the presence of a magnet, or a programming
device, in contact with the patient's skin in the vicinity
of the drug administration device.
As reed switch 89 is closed, a positive voltage
is connected to the INT input at pin 36 of microprocessor
100. The closing of reed switch 89 by the magnet or pro-
grammer also applies power to ~e receiver circuit 101,
comprised of transistors Q5 through Q8. Receiver circuit
35 101 is a part of the electronic dule 32 as is the
antenna A~T. The antenna is a 1 mh ferrite core antenna
which is also a part of the electronic dule 32. The
. .
..
~ ~60529
--8--
antenna is tuned with a capacitor C6 for receipt of the
175 KC carrier programming signal pulses from the program-
mer.
The entirety of the circuit in the receiver or
demodulator 101 is the same as used in the Medtronic 5995
programmable Xyrel ~ pacemaker.
Programming command information is applied to
the drug administration device by a programmer which has
electrical operating characteristics identical to those
of the Medtronic 9600 Rate Controller programmer. $he
programming command information is applied by setting the
selector switch of the programmer to a position corres-
ponding to a dosage command between 1 and 7 to be applied
and pressing the push button corresponding to the "Activate
A Switch" of the Model 9600 Programmer to deliver two
bursts of between 1 and 7 pulses of 175 KC carrier. The
pulses have a nominal duration of 1.5 msec, and a period
of 3.0 msec. The two bursts or groups of N pulses which
can be referred to as Nl and N2 are sepàrated by at least
2.5 msec. At least 13 msec shall separate different
groups of two bursts. The command programmer produces
1 to 7 Nl pulses to program dosage commands and 1 to 7
N2 pulses to program interval commands. A "make perma-
nent" command to make the dosage and interval commands
permanent is generated by transmitting Nl and N2 bursts
of 8 pulses.
The "personality" of the drug administration
device can be altered using a special programnler having
extended capabilities for the number of pulses generated
in Nl and N2. The device is placed in the motor parameter
subroutine made by causing the programmer to generate a
9 pulse Nl burst and an arbitrary number of N2 pulses.
After enabling the new parameter mode, the device accepts
the new parameters from Nl and N2 bursts of 1 to 16
pulses as indicated in Table 1 below:
~.:
-, ~ ~ , . .~ , *
l 160529
g
Group Nl N2 Result
1 9 1 to 7 Enables new motor parameter
mode
2 1 to 16 1 to 16 Receives 8 bit word to
determine pulse width
3 1 to 16 1 to 16 Receives 8 bit word to
determine motor pulse
period
4 1 to 16 1 to 16) Receives 16 bit word to
~ store data to characterize
) dosage to be dispensed in
) response to an N burst
1 to 16 1 to 16) of one pulse.
The Nl burst in groups 2 and 3 carries the most
significant nibble of the 8 bit word and N2 indicates the
least significant nibble. Group 4 carries the most
significant nibble of the most significant byte in Nl and
the least significant nibble in N2. Similarly, group 5
transmits the most and least significant nibbles of the
least significant byte in bursts Nl and N2. Similar
16 bit words are received for the dosage data to be
stored relative to dosage commands from 2 through 7.
The special programmer allows changing the
personality of the device over a wide range. The motor
pulse width can, in one embodiment, be varied in approxi-
mately 1 msec intervals from 1 msec minimum to 250 msec
maximum. The delay between motor pulses can be varied
in one embodiment between 5.86 msec minimum to 568 msec
ma~imum with approximately 2.2 msec between choices.
The number of pulses delivered to the stepper motor at
each o~ the command dosages can be varied from 0 to
65,535.
Using the command programmer and a typical
device "personality" 7, drug dosages can be selected from
a zero dosage to a 1.0 ml dosage with 0~1 ml increments
between choices. The time interval between dosages can
be selected between 1 and 12 hours in 7 choices. With
the pre~erred embodiment shown and a motor pulse period
of 33 ms, the rate at which the drug is dispensed is
,, - ~
1 ~60529
--10--
1 ml per 39.6 minutes.
Circuit 101 operates to apply a positive pulse
to pin 23 of microprocessor 100 at the ~ input each time
a carrier pulse is recei~ed. Circuit 101 also applied
at pin 22 of microprocessor 100, an EF3 input during the
time that the first group of pulses corresponding to the
dosage are applied. After the dosage command has been
applied, the selector switch of the programmer is moved
to a position to select the time interval command for
administration of the selected dosage and the button is
again pressed, and the pulses are applied to the EF2 input
and the envelope for the train of pulses is applied to the
EF3 input. The input commands are tested and stored as
explained below in connection with the description of the
programming. After the desired input command has been
applied, it can be made permanent by depressing the switch
corresponding to the "Interlock 30 Switch" of the Model
9600 programmer, and then depressing the "Activate A
Switch" twice to transmit a "Make Permanent" command.
The description of the programming below illustrates how
the circuit module 32 functions upon receipt of the "Make
Permanent" command.
A clock input to the microprocessor 100 is
supplied by a 32.768 KHz crystal lOla connected as shown
in Figure llA, with its associated capacitor C9 and
resistor R16.
A connection is made from the CLR input at pin 3
of microprocessor 100 to an output pin 4 of the electronic
module 32 to permit grounding of the CLR input to micro-
30 processor 100. Grounding the reset pin 4 of module 32
resets the microprocessor program counter to position
zero, and provides a convenient and direct means of
restarting the programming on the bench when the reset pin
of the module is accessible.
The other oonnections to the microprocessor at
pins 40 and 16 to apply the DC power are standard, and the
unused logic inputs at pins 37, 38, 2, and 21, are all
,
. ' . ~
.. . . .
l 160~29
tied back ts~ the DC supply through R18.
The microprocessor 100 is connected to a memory
102, which in the embodiment shown, is divided between a
512 byte ROM memory 102a and a 128 byte RPM memory 102b.
5 The information in the RAM memory is modified by the
external programmer, while the information stored in the
ROM, which relates to the programming, is not varied, and
is preloaded at the time the device is assembled.
Electronic module 32 drives either the acoustic
10 transducer 26 from pin 9, or the winding of stepper motor
46 from pins 10 and 11. The circuitry of gates A4 through
A7 function to enable either the acoustic transducer or
the stepper motor winding to accept outputs from the
microprocessor. Operation of the circuitry of gates A4
15 through A7 is discussed in more detail below in connection
with the operation of the programming of the device.
In one embodiment, the following values were
used for the components of the electronic module 32:
Ql' Q2 2~13799
Q5' Q6' Q7' Q8 2N2484
2N6459
Rl, R5~ R6, R14~
R17 10M
R2 ADJUST FOR CURRENT OF 45f~ A
R7 200K
R8~ R13 20~5
~9 3.5M
Rlo, R15 100K
Rll 15K
R12 300K
R16 12M
R18 lM
Cl 10,u f
C2 120pf
C3 .047~f
C4, C5~ Cg 330Pf
.
~\ .
l 160529
-12-
C6 630pf
C7 330pf
C8 .001~f
A4, A7 C~4013
A5, A6 CD 4011
Simplified Description of Operation.
The drug administration device operates to dis-
pense ~elected doses of a medical fluid at selected time
intervals. The external programmer sends a group of 1 to
7 pulses to designate the dosage to be administered and
another group of 1 to 7 pulses to designate the time inter-
val. The pulses indicate the location within memory where
the parameter signals to determine the number o~ pulses
to determine the dosage and to determine the time between
dosages are stored.
A device personality programmer in contrast to
the above-described physician operated external programmer
is used to set certain implanta~le device characteristics.
This may be done either at the time of manufacture or
after the device has been implanted in a patient without
removal of the device. The stepper motor pulse width,
the delay time between stepper motor pulses and tl~e number
of stepper motor pulses to be dispensed for each of the
seven dosage commands are all remotely programmable with
the personality progra~lmer.
Once each second, the device checks to determine
if a magnet or a programmer has been placed over the im-
planted device. When a magnet or programmer is detected,
the dispensing of the drug is immediately inhibited and
the acoustic transducer indicates the 1 to 7 pulses which
were previously set in ~or the dosage and interval. The
programmer can then be used to apply new code pulses which
are read back on the a~oustic ~ransducer. The operating
codes are stored in the device until a separate "Make
Permanent" code is re~eived to cause the device to operate
under control o~ the new commands.
~ lB0529
Description of Program Flow Charts.
There is shown in Figure 12 a flow diagram of the steps for imple-
menting the programming of the drug administration device, the circuit con-
nections for which are shown in Figure 11. In one illustrative embodiment of
this invention, the microprocessor 100 includes a plurality of p~inter
registers for storing pointers or addresses to word locations within the ROM
portion 102B of the memory 102. In this illustrative embodiment, there are
included within the microprocessor 100 the following registers for storing
the indicated pointers or addresses:
R(O) = Working Data Temporary Storage Counter
R~l) = Interrupt Subroutine Program Counter
R(2) = Dummy "X" Register
R(3) = Accoustic Output Subroutine Program Counter
R(4) = Executive Program Counter
R(5) = Variable Delay Counter
R(6) = Data Temporary Storage
R(7) = Dosage/Interval Flag
R(8) = One Second Delay Counter
R(9) = Motor Control Subroutine Program Counter
R(A) = Permanent Data ROM Memory Pointer
R(B) = Just Sent Data RAM Memory Pointer
R(C) = Read New Data Counter
R(D) = Number Of Seconds Delay Counter
R(E) = Previously Sent Data Memory Pointer
R(F) = Working Data Pointer
Further, the flag inputs for the reed switch (EFl) and the data pulse (EFl)
and the data pulse envelope (EF3) are applied to the microprocessor as
shown and described with regard to Figures lla and llb. The notation for
the flag inputs and the pointers and counters is used throughout the program
listing set out below. As is conventional with microprocessors, the micro-
-13-
l 160529
processor 100 includes an address counter 107, which increments one for each
step of the program as it is carried out under the control of the micro-
processor
-13a-
l 160~29
-14-
100 to designate the next location within the memory 102
from which information is b~ be read out. The steps to be
explained with respect to Figure 12 to effect a programmable
drug administration device were implemented using a~ RCA
COSMAC mlcroprocessor by the following machine instructions:
Step
Location Symbolic Notations Remarks
200 DIS ,#00 .. DISABLE THE INTERUPT
.. INPUT
202 LDI A.l(START);PHI 4 .. INITIALIZE R4 AS EXE-
LDI A.0(START);PLO 4 ..CUTIVE PROGR~
..COUNTER
LDI A.l(INTER);PHI 1 ..Rl AS THE INTERUPT
LDI A.0(INTER);PLO 1 ..SUBROUTINE POINTER
.. AND COUNTER
LDI A.l(MOTOR)jPHI 9 ................... R9 AS THE MOTOR
.................................. ............ CONTROL
LDI A.0(MOTOR);PLO 9 ................... SUBROUTINE POINTER
.................................. ............ AND COUNTER
LDI A.l(OUTPUT);PHI 3 .................. R3 AS THE ACOUSTIC
LDI A.0(OUTPUT);PLO 3 .................. OUTPUT SUBROUTINE
.................................. ............ POINTER AND COUNTER
LDI A.l(READND);PHI C .................. RC AS THE READ cNEW
.................................. ............ DATA
LDI A.0(READND);PLO C .................. SUBROUTINE POINTER
.................................. ............ AND COUNTER
LDI A.l(SECDEL):PHI 5 .................. R5 AS THE .7 SECOND
LDI A.0(SECDEL);PLO 5 .................. DELAY SUBROUTINE
.................................. ............ POINTER AND COUNTER
.. (FOR OUTPUT SUB)
LDI A.l(STAOS);PHI 6 .. R6 AS THE OUTPUT
I,DI A.0(STAOS);PLO 6 .. FORMAT TABLE POINTER
LDI #04;PHI A .. ~ AS THE PERMANENT
LDI #00;PLO A .. DATA R~M POINTER
LDI #04jPHI B .. RB AS THE JUST SENT
LDI #02;PLO B .. DATA R~ POINTER
LDI #04;PHI E .. RE AS THE PREVIOUSLY
LDI #04;PLO E .. SENT DATA R~M POINTER
LDI #01;STR A;INC A .. SET DOSAGE ~D
.. INTERVAL TO A 1,1
.. STATE
STR A;DEC A
SEP 4 .. CALL EXECUTIVE
.. PROGRAM
Executive Program.
204 START: SEP 9 .. CALL ~DTOR CONTROL
.. SUBROUTINE
205 BNl START .. CHECK FOR I~GNET-NO
.. GO TO START
t 16~529
-15-
252 LDI #04;PHI F ............... POINT RF TO RAM TO
LDI #06;PLO F ............... HOLD PRESENTLY WORK-
STR B;INC B; ~.ING MOTOR CONTROL
STR B;DEC B PARAMETERS
GLO 9;STR F;
INC F
GHI D;STR F;
INC F
GLO D;STR F;
INC F
GLO A;STR F
254 LDI ~00;PLO A ............... POINT RA TO BEGINING
............... .................. ........... OF PERMANENT DATA R~M
LDA A ....................... AND PLACE THE CON-
STR E;INC E ................. TENTS INTO RE TO
............... .................. ........... SEND OUT DATA
LDN A;DEC A
STR E;DEC E
256 CJSENT: SEP 3 .. CALL ACOUSTIC OUTPUT
2n .. SUBROUTINE
314 SEP C .. CALL R~AD NEW DATA
.. SUBROUTINE
354 LDN B .. CHECK JUST SENT D~TA
XRI #09 .. IF ACCEPT NEW DATA
.. CODE
LBZ ACEPTD .. YES BR~NCH TO ACCEPT
.. NEW DATA
388 LDN B .. CHECK JUST SENT DATA
XRI #08 .. IF PERMANENT CODE
BNZ SENOUT .. NO GO TO SEND OUT
.. DATA
390 INC B
LDN B;DEC B
XRI #08
BZ SETPER .. YES SET I~EW DATA TO
.. PERMANENT
SENOUT: LDA B .. LOAD JUST SENT DATA
.. FROM RB
STR E;INC E ....... TO PREVIOUSLY SENT
.. DATA LOCATION
LDN B;DEC B ....... AND BRANCH TO CALL
.. OUTPUT
STR E;DEC E
BR CJSENT
394 SETPER: LDA E .. LOAD PREVIOUSLY SENT
.. DATA
STR A;INC A ....... INTO THE PERMANENT
.. DATA LGCATION
LDN E;DEC E
STR A;DEC A
396 ~AITMA: SEP C .. CALL READ NEW DATA
.. SUBROUTINE
BR WAITMA .. AND WAIT ~OR INTER-
.. RUPT
1 lB0~29
--16--
Interrupt Su~routine.
402 INTER; IDI A.0 (SINTER) .. SET UP R4 TO RETURN
;PLO 4 ........ CONTROL TO MAIL PRO--
L~I A.0 (READND) .. GRP~q COUNTER
;PLO C
SEP 4 RC TO BEGINING OF
........ ......... ...... ............... ........... READ NEW I~TA SUB
404 SINTER: LDI A.0 (INTER);... RESTORE INTERUPT SUB--
PLO 1 .. ROUTINE
408 LDN B .. C~IECK TO SEE IF JUST
.. ~TA
BZ #08 .. IS ZERO YES RESTART
.. PROGRAM
XRI #08 .. CHECK JUST SENT DATA
~.IF PERMANENT
- BNZ COMMOT .CODE NO GO TO CONTINUE
..MOTOR SUB
INC B
LDN B;DEC B
XRI #03
BZ RESETM .. YES GO TO RESET ~TOR
.. SUB
414 CONMOT: LDI #04;PHI F .... POINT RF TO RAM To
.. RETRIEVE
LDI #06;PLO F .... PRESENTLY WORKING
.. MOTOR CONTROL
LDA F;PLO 9 .. PARAMETERS
LDP. F,PHI D
LDA F;PLO D
LDN F;PLO A
424 SEX 2;OUT 1 .. SET OUTPUT PORT TO
.. MOTOR
BR START .. GO TO ~DTOR CONTROL
.. SUBROUTINE
426 RESETM: LDI A.l (MOTOR);... RESTORE ~DTOR CONTROL
PHI 9 ......... SUBROUTINE
LDI A.0 (MOTOR);
PLO 9
428 LDI ~00;PLO A .... RESTORE PERMANENT
.. DATA POINTER
LDA A;STR E; .. LOAD NEW PERMANENT
INC E ..DATA INTO RE
LDN A;STR E;..TO SEND OUT NEW
DEC E;DEC.PARA~ETERS
A
SEP 3 .. CALL ACOUSTIC OUTPUT
.. SUBROUTII~E
428 BR START .. GO TO ~)TOR CONTROL
.. SU13ROUTINE
50 Motor Control Subroutine.
_
206 I`'IOTOR: SEX 2;REQ;OUT l.SET OUTPUT PORT TO
..MOTOR
... . ~ . . .... ~. . . .
. ~
1 ~6~52g
--17--
208 LDI A.l (INTTAB).POINT RE TO BEGINING
;PHI F .. )F INTERVAL TABLE
LDI A.0 (INTTAB)
;PLO F
Ll)I #04;P~II 0...... POINT R0 TO PULSE
LDI #70;PLO 0...... WIDTH l~ND PULSE
............ ........... ... ..................... I~TERVAL TABLE
INC A .. POINT ~?A lt) INTERVAL
.. # IN RZ!~M
LDN A;SHL;STR ........ GET # MULT. BY 2
B .. tTP~BLE 2 BYTES LONG)
DEC A .. POINT RA TO DOSAGE #
.. IN R~M
SEX B;GLO F; .. INCREMENT INTERVAL
ADD .. TABLE POINTER
PLO F;SEX F .... .. BY # GENERATED FROM
.. INTERVAL #
LDXA ;PHI D .... .. GET INTERVAL DELAY #
I.DX ;PLO D .... .. FROM TABLE AND LOAD
.. INTO DELAY SUB
210 CTR2: SEP 4 .. GO TO EXEC. PROG. AND
.. CHECK ~R M~G.
212 LDI #02 .. LOAD BASIC DELAY #
PHI 8 .. FOR 1 SEC.
214 CTRl; DEC 8; GHI 8
~OP
216 CTR3: BNZ CTRl .. CHECK IF 1 SEC. DELAY
.. DONE
218 DEC D;GHI D
220 BNZ CTR2 .. CHECK IF INTERVAL
GLO D .. DELAY DONE
BNZ CTR2
222 LDI #04;PHI F.... POINT RF TO DOSAGE
.. TABLE IN R~M
LDI #60;PLO F
LDN A;SHL;STR ..... .. . GET DOSAGE # MULT. BY
B .. 2
SEX B;GLO F; .. INCREMENT DOSAGE
ADD .. TABLE POINTER
PLO F;SEX F.... BY # GENERATED FROM
............ ......... .... ... ................... DOSAGE #
LDXA ;PHI D ..... .. LOAD DOSAGE # FROM
............ ......... .... ... ................... TABLE
LDX ;PLO D ..... .. INTO M~)TOR PULSE SUB
.. COUNTER
224 CHECKD: GHI D
BNZ PM .. CHECK IF DOSAGE DONE
GLO D
LBZ ~)TOR
230 PM: DEC D
LDA 0 .. LOAD MOTOR PULSE
.. WIDTH DELAY #
232 SEQ .. PULSE M~TOR
234 BZ MPWDl .. IF PULSE WIDTH DELAY
MPWD: SMI #01 .. O GO TO PULSE INTER-
l 160~9
--18--
.. VAL, ELSE DEC. COUN-
.. ~ER
236 BNZ MPWD .. UNTIL 0 TH33N GO IO
.. PULSE INTERVAL
238 MPWDl: KEQ .. STOP PULSE ~TOR
240 SEP 4 .. CHECK FOR l~GNET
242 LDA 0 .. LOAD PULSE INTERVAL
DEC 0 .. DELAY #. POINT R0
l~EC O .. BACK TO PUSLE WIDTH
.. DELAY # IN R~M.
244 BZ CHECKD .. CHECK PULS. INT. DEL.
.. O GO TO PULSE MDT.
246 PLO 8 .. OTHERWISE DELAY
.. BETWEEN PULSES
248 RECMOT: DEC 8;GLO 8
NOP
250 BNZ RECMOT
BR CHECKD
Output Delay Subroutine.
312 EXIT4: SEP 3 .. EXIT SECOND DELAY SUB
TO OUTPUT SUB
300 SECDEL: LDX ;PLO D ....... LOAD # OF UNIT TIMES
........ ......... ...... .......... .... .......... DELAY FROM TABLE
302 PDSl: LDI #01;PHI 8........ IOAD UNIT TIME #
.. INTO COUNTER
304 PD52: DEC 8;OEII8;
I~OP
306 BNZ PDS2 .. CHECK UNIT TIME DELAY
.. DONE
308 DEC D;GLO D
310 BNZ PDSl .. CHECK # OF UNIT TIME
.. DELAYS IS 0
312 BR EXIT4 .. IF 0 EXIT BACK TO
.. OUTPUT SUB
35 Acoustic Out;?ut Subroutine.
299 EXIT2: DEC 6;1~EC 6 .~WHEN EXITING, RESET R6
DEC E;DECE; TO BEGINNING OF OUT-
.. PUT FOE~M~T TABLE
301 SEP 4 .. CAL~ EXEC. PROGRAM
258 OUTPUT: LDI #01;PLO 7.... . SET DOSAGE INTERVAL
.. FLAG TO DOSAGE
260 SEX 2;OUT 2 ..... .. . SET OUTPUT PORT TO
.. ACOUSTIC
SEX 6
252 SEQ .. TURN ON IONE
264 SEP 5 .. CALL OUTPUT FORMAT
.. DELAY FOR ALERT TONE
266 REQ .. TURN OFF TONE
268 IRX;IRX .. SET R6 TO OFF DELAY #
270 AOS9: SEP 5 .. CALL OUTPUT FORMAT
.. DELAY
.-- , .. ,.. . _,_ . . . . .. _ .. ,
,
. " ,
l 160529
-19-
272 LDA E;PLO 2 ................... ~OAD DOSAGE # INTO
......................... ................... TONE COUNTER
274 AOS6: BZ ADS7 .. CHECK TONE COUNTER 0,
.. NO CONTINUE
276 DEC 2 .. DEC TONE COUNTER
278 SEQ .. TURN ON TGNE
280 SEP 5 .. CALL TONE DELAY SUB
282 REQ .. TURN OFF TONE
284 SEP 5 .. CALL OFF TONE DELAY
.. SUB
286 AOS7: GLO 2
288 BNZ AOS6 .. CHECK IF TONE COUNTER
.. 0, NO REPEAT
290 GLO 7
BZ EXIT2 .. CHECK BOTH DOSAGE AND
.. INTERVAL DONE
294 - DEC 7;DEC 6
296 SEP 5 .. OUTPUT DOSAGE/INTER-
.. VAL SPACE OFF TONE
298 INC 6
BR AOS9 .. CONTINUE OUTPUTING
.. INTERVAL TONES
Read New Data Subroutine.
350 EXIT 3: SEP 4 .. RETURN TO EXECUTIVE
.. PROGRAM
318 READND: SEX C;RET .. ENABLE INTERUPT
,#2C .. INPUT
319 LDI #00 .. CLEAR COUNTER EOR
~.SERIAL BIT WORD
320 STARTR: B3 STARTR .. WAIT FOR FIRST WORD
-tDOSAGE)
322 READDO: B2 OEC~Wl .. CHECK FOR END OF
.. FIRST WORD
324 ADI #01 .. INCREMENT COUNTER
.. FOR EACH BIT
BR STARTR .. CONTINUE COUNTING
.. BITS OF FIRST WORD
328 CECICWl: BN3 READDO .. IF FIRST WORD LONE
330 STR B;INC B ................... STORE FIRST WORD IN
.. RAM IN JUST SENT
.. LOCATION
332 LDI #00 .. CLEAR COUNTER FOR
.. SECOND WORD (INTERVAL)
334 STARRE- B3 STARRE .. WAIT FOR SECOND WORD
336 READIN- B2 CECKW2 .. CHECK FOR END OF
.. SECOND WORD
338 LDI #01 .. INCREMENT CO~NTER FOR
~.EACH BIT
BR STARRE .. CONTINUE COUNTING
o .. BITS OF SECOND WORD
342 ÆCKW2: BN3 READIN .. IF SECOND WORD DONE
344 STR B;DEC B ................... STORE SECOND WORD IN
....... .................. ................... RAM IN JUST SENT
... _ . _ . . . ..... ~, _ _ __ . .
1 160529
--20--
.. LOCATION
346 SEX C
348 DIS ,#2C .. DISABLE INTERUPT
.. INPUT
350 BR EXIT3 .. GO TO EXIrr qO RETURN
.. TO EXEC. PROGRAM
Accept New Parameters Subroutine.
356 ACEPTD: LDI #04;PHI 0.... CLEAR I~OCATION 0 OF
LDI #60; RNO 0.... DOSAGE TABLE IN PAM
LDI #00 .. TO GET READY ~ AC--
.. CEPT NEW PAR~METERS
STR 0
INC 0
STR 0
358 LDI #71;PLO 0.... POINT R0 TO PULSE
.. INTERVAL R~l
.. LOCATION
360 LDI #00 .. LOAD 0 INTO JUST
STR B .. SENT R~ TO CHECK
.. FOR DATA RECEIVED
.. LATER
362 DATAl~ SEP C .. CALL READ i~W D~TA TO
SEX B .. GET FIRST BYTE WHICH
.. IS THE PULSE INTER-
.. VAL #
364 LDI #03 .. WE MUST SUBTRACT 1
.. FROM EACH HEX
SD .. AND THEN COMBINE THE
.. TWO HEX DIGITS
STR B .. TO GET ONE HEX BYTE.
.. R0 POINTS TO
IRX .. THE RZ~M LOCATION
.. WHERE rl~lE BYTE WILL
LDI #01 .. BE PLACED THIS
.. PROCESS IS REPEATED
SD .. UNTIL A NEW PULSE
.. WIDTH BYTE AND A
STR B .. NEW PULSE INTERVAL
.. AND NEW DOSAGE
DEC B .. BYTES ARE RECEIVED OR
IDA B .. INTERUPT OCCURS
SHL
SHL
SHL
SHL
ADD
DEC B
STR 0
DEC 0
GLO 0
XRI #61
BZ STOPDA
366 BR DATP~l
~ 160529
-21-
STOPDA: LBR #0008 ..RESTART ENTIRE PRO-
..GRAM
END
In Figure 13, the flow chart of the executive
program and in ~'igures 14 through 19, the flow charts of
the various subroutines representing the instructions
listed above, the corresponding step for each instruction
is identified under the heading "Step Location".
The program begins at start step 200 by disabling
the interrupt input of the microprocessor 100. The program
then transfers to step 202 wherein the various counters are
initialized, and the dosage and interval commands are set
to a one, one state. The executive program is then called.
Motor Control Subroutine.
As shown in Figure 1~, the first step in the exe-
cutive program following the initialization step 202 is the
call Motor Control Subroutine step 204. The Motor Control
Subroutine as shown in Figure 14 begins with step 206,
where the output port of the microprocessor 100 is set to
energize the circuit for driving the stepper motor winding
by placing an N0 signal at pin 19 which inhibits the acous-
tic transducer operation and enables the Q output of
microprocessor 100 to toggle the stepper motor winding.
The function of the flip-flop A4 is to provide a bipolar
pulse to the stepper motor winding connected across pins 10
and 11 of dule A6. For every Q output of the processor
on pin Al-4, flipflop A4 toggles and steers the current in
the stepper motor winding in first one direction and then
the other. The pulse width of the waveform at Q determines
the width of the motor drive pulses. The-stepper motor
drivers A8 are connected in parallel to provide sufficient
current drive capability to energize the stepper motor
winding.
After the motor output is enabled at step 206,
at step 208, the working data pointer RF is pointed to the
beginning o~ the interval table, and the working data
temporary storage counter RD is pointed to the pulse width
,~ . . .
- .
~60~9
-22-
and pulse interval table in the R~. The permanent data
pointer RA is pointed to the interval number in the RAM
102B and the number stored in RAM at that location is re-
moved and multiplied by two. The next step which occurs in
5 operation 20~ is the pointing of the permanent data tempo-
rary pointer to the dosage number in RAM lo2s~ which is
followed by incrementing o the interval table pointer
~ by the number generated from the interval number in RAM.
Finally, the interval delay is t~ken from R~M and loaded
into the delay subroutine, shown in Figure 16 below.
In step 210, the program moves from the motor
control subroutine of Figure 14 back to the executive pro-
gram at step 205 to check for the magnet. If the magnet is
not present, step 205 returns the program back to step 212
in the motor control subroutine. Step 212 involves the
loading of the one second delay counter R8 with the basic
delay number which will generate a one second delay when
decremented from the counter at the normal operating rate
of the microprocessor 100 when driven by a 32.768 K Hertz
crystal. In step 214, the one second counter is decre-
mented by one unit and in step 216, the contents of R8 are
tested to see if the counter had been decremented to zero
to signify the end of the one second interval.
Steps 214 and 216 are repeated in a loop until
the one second delay is completed at which time the program
moves to step 218 where the interval counter is decremented
and the counter is tested, and if the contents are non-zero,
the program branches back to step 210 until the completion
of the interval delay called for by the number originally
stored in Memory which was transferred to RD at step 208 a~
the beginning of the motor control subroutine. After com-
pletion of the indicated interval delay, the subroutine
moves to step 222.
In step 222, the working data pointer ~ is
pointed to the dosage table in RAM 102B and the dosage data
which is two bytes in length is then loaded into RD. That
number represents the number of motor pulses to be delivered
!
l 1~0~2~
--23--
to apply the dosage called for by the stored command re-
ceived from the external programmer.
Next, step 224 makes an initial check to deter-
mine whether the dosage counter is set at zero to indicate
S that the external progralr~ner was set to call for a zero
level dosage. If it is zero, the subroutine branches back
to the beginning of ~Sotor Control Subroutine, continuing ~o
run intervals without delivering any pulses to the motor.
If the dosage counter is not loaded with a zero, the sub-
10 routine moves to step 230 which decrements RD, and getspulse width number from R~M pointed to by RO, and incre-
ments RO to point at the pulse interval number. In step
232, the drive of the motor commences by setting the Q
output of microprocessor 100 to a one state to toggle
15 flip-flop A4 to pulse the stepper motor winding to drive
the roller pump and dispense a measured dosage of drug to
the body through catheter 22. For every Q output of the
microprocessor 100 on pin Al-4, flip-flop A4 toggles and
steers the current in the stepper motor winding in first
20 one direction and then the other. The duration of the Q
output as a logic one is determined by the number pointed
to by RO.
The motor continues to be driven by pulses as the
accumulator D is decremented in step 234 and its contents
25 tested in step 236. After the pulse width counter has
counted down to zero, the subroutine ves to step 238
to change the Q output of the microprocessor 100 to logic
zero to terminate the pulse to the motor. The subroutin~
progresses to step 240 by calling the executive program to
30 again check for the presence of a magnet in the same fashion
that the check is made once each interval unit at step 210.
If no magnet is present, control is returned to the motor
control subroutine, which moves to step 242.
At step 242, the pulse interval delay number is
35 loaded into R8 and RQ is pointed back to the pulse width
delay number stored in R~M 102. The pulse interval delay
number is checked at step 244. If the delay is equal to
l 160529
-24~
zero, the program moves immediately back b~ step 224, and
the motor delivers the prescribed number of pulses for the
dosage.
If the test at 244 indicates that a nonzero
pulse interval delay is called for, that delay is loaded
at step 246 into the delay counter R8, decremented at step
248, and that counter's output is tested at step 250 until
the counter is fully decremented to zero and the motor
control returns to step 224, where it again checks to see
if dosage is complete.
Acoustic Output Subroutine and One Second Delay Subroutine.
If a magnet is detected after one of the one
second intervals that are set up by the motor control sub-
routine or in the period immediately following completion
of application of a pulse to the stepper motor, the reed
switch is closed and the signal at pin A1-24 of micropro-
cessor 100 switches from a logic HIGH to a LO on EFl and
the processor program reverts to an acoustic program output
subsystem mode as shown in Figure 15. The output subrou-
tine is called after the test at step 205 of the executiveprogram detects the presence of a magnet, and the executive
program moves to step 252. At step 252, the working data
pointer is pointed to the R~M 102 to store the present
motor control parameters. At step 254, the permanent data
memory pointer is pointed to the beginning of the permanent
data RAM, and the contents of that memory location are
placed in the previously sent data memory pointer for
transmission by the acoustic output subroutine. At 256,
the acoustic data subroutine of Figure 15 is called.
Acoustic Output and Output Delay Subroutines.
Referring now to the acoustic output subroutine
of Figure 15 at step 258, the dosage interval flag R7 is
set to "dosage". At step 260, the output port is set into
the acoustic mode by an Nl output strobe. The gates having
outputs A5-3 and A5-4 perform an "anding" function with the
Q signal of the microprocessor and pin 13 of flip-flop A7.
Flip-flop A7, at pin 13, is enabled by an Nl output of the
~ 16~529
--25--
processor at pin Al-18 to allow the timing pulse signal qPA
at pin A1~34 to toggle flip-flop A7-13 and provide a 50
percent duty cycle 2 KHZ signal at pin A5-1. The micropro-
cessor Q output at pin Al-4 modulates the 2KHz audio tone
5 by the input to A5-2. When the acoustic transducer is sel-
ected by an Nl output, the toggling of the stepper motor
via flip-flop A4 is inhibited.
At step 262, the output tone is enabled by driving
the Q output of microprocessor 100 at pin 4. At step
10 264, the output format delay subroutine of Figure 9 is
called for the generation of the time delay for the alert
tone. After the time delay, the subroutine steps to 266
and the tone is terminated by setting Q to logic zero.
The one second, or output delay subroutine shown
15 in Figure 16 operates as follows. The subroutine commences
with step 3û0 which calls for loading of the acoustic delay
number from the output format table pointed to by R6.
At step 3~2 the unit time number is loaded into R8, the
one second delay counter. In the illustrative embodiment
20 shown, the time interval selected is one second, so that
the various tones and time delays are all multiples of one
second. In step 304, the counter R8 is decremented and
tested at step 306 repetitively until completion of the
time delay when the program moves to step 308, which calls
25 for decrementing RD to make sure that the selected number
of delay times has occurred. If the number of seconds
which have elapsed is less than the number called for by RD,
the subroutine loops back to step 302. Once the appro-
priate number of delay time intervals has occurred and
30 RD is fully decremented, the subroutine branches back to
step 312, and exits back to the next step in the output
subroutine shown in Figure 15.
Resuming discussion of the output subroutine of
E`igure 15, the next step following the turn off of the
35 alert tone at step 266 is the setting of R6, with the delay
time between the alert tone and the commencement of the
tones representing the output data. In the embodiment
t 1~0529
--26--
shown, this is a s~ne second delay.
The next step 270 is another one second delay
generated by the one second delay subroutine of Figure 16.
Step 272 causes loading of the dosage number into the tone
5 counter R2. The contents of the tone counter are then
tested at step 274 an~ if equal to zero, causes the program
to branch forward to step 288. If the tone counter is set
with a non-~ero number, the next step i5 to decrement
the tone counter at step 276, turn on the tone at step
10 278, to have the tone's duration determined by the tone
delay subroutine of Figure 16 at step 280, and turn off
the tone at 282 after the time interval elapses. Following
step 282, the time delay subroutine is again called at step
284 to generate the interval that the tone is turned off
15 and the next step, 288, is to determine whether all data
has been sent. If all data had not been sent, the sub-
routine branches back to step 274, and repeats. Thus,
the data transmitted is the five second alert tone, the one
second space, and a number of one second tones separated by
20 one second spaces to represent the command increments.
After the dosage information is transmitted, the
subroutine moves from step 288 to step 290, and the dosage
interval flag is checked. If the flag is still set at do-
sage, the test at 290 results in a NO answer indicating
25 that both the dosage and interval information have not yet
been sent. In step 294, the dosage/interval flag is reset
to interval by decrementing R7. The subroutine then moves
to step 296, which creates a two second delay by using
the output format table and one second delay subroutine.
30 In step 298, the tone delay subroutine of Figure 9 is
called to create another one second delay. Thus, after
delivery of the dosage information tones, there is a three
second delay and the subroutine moves back to step 270,
where the same steps are repeated to deliver the interval
35 data as a series of tones each of which are separated by
one second. After completion of the delivery of the in-
terval information, the checking of the dosage/interval
.. . .
.
l 160529
-27-
flag results in a yes answer to the test at step 2~0. and
the program advances to step 300, where R6 is set to the
start of the output ~ormat table in preparation for the
next time that the acoustic output subroutine is entered.
In the embodiment shown, the format table pointer ~s
reset at step 299 to call for a five second format delay.
The next step 301 resets the previously sent register to
the beginning of the previously sent table, and calls
the executive program.
Read New Data _ubroutine.
The next step reached in the executive program is
step 314, which is the call for the read new data subrou-
tine of Figure 17. Referring now to Figure 17, the first
step in the read new data subroutine is step 318, which
enables the interrupt input. The next step of the read new
data subroutine is step 319, to clear accumulator D, which
will be used to count and temporarily store the pulses
which indicate dosage/interval oommands. As the first
pulses are being received, the program at 320, 322, and 328
tests the flags EF3 and EF2 whose states are dependent
upon receipt of the radio frequency pulses from the exter-
nal programmer. EF2 is the microprocessor input which
indicates individual pulses. EF3 is the microprocessor
input which indicates the envelope of a burst of multiple
pulses. In other words, the processor at step 328, ex-
amines the EF3 input to determine whether the first group
of pulses representing dosage have been completed and
whether a second group of pulses representing interval
is coming. ~fter the first group of pulses have been com-
pletely received, the subroutine progresses to step 330,where the first or dosage command is stored in the RAM in
the JUST SENT location.
The counter accumulator D is then cleared to
receive the second transmitted command. The tests of EF2
and EF3 are performed by program steps 334 and 336 and 342,
and each received pulse is used to increment the accumulator
D counter by one count at step 338. After completion of
~ ~6~29
-28-
the pulse envelope and cessation of EF3, the subroutine
progresses to step 344, and the content of the accumulator
D is stored in RAM in the JUST SENT location. The sub-
routine then clears the accumulator D at step 346 and
disables the interrupt input at step 348 and recalls the
executive program at step 350.
Acce * New ~otor Parameters Subroutin~.
p
After completion of the read new data subroutine
the executive program counter advances the program to step
354, where the test is made to see if the appropriate code
for accepting new parameters has been received. That test
is performed at step 354. The code indicating that new
motor parameters are to ~e received is the receipt of a
code of nine and X. If that oode is received r the branch
from step 354 is to the Accept New Motor and Dosage
Parameters Subroutine of Figure 18.
Referring now to Figure 18, the first step 356
in the Accept l~ew Data subroutine is to load zero into the
location just prior to the first entry of the dosage table
in the RAM. At step 358, R0 points to the pulse interval
RAM location. At step 360, a zero is loaded into the
JUST SENT RAM location to check for data received later.
At step 362, the READ NEW DATA subroutine of Figure 10 is
called to obtain the first byte of data which is repre-
sentative of the pulse interval. In receiving this datafor loading into the RAM r the READ NEW DATA subroutine
operates in precisely the same manner that it operated in
receiving the interval and dosage commands.
In step 364, the two numbers received from the
READ NEW DATA subroutine are between 01 and 10 (HEX). A
one is then subtracted from the numbers to obtain a number
between 0 and F (HEX), and then stored in register E while
a one is subtracted from the second number for the same
reason. The two numbers are assembled together and stored
in the memory at the location pointed to by R0 as a number
between 00 and FF (HEX) as the first parameter. RQ is
then decremented to accep~ a second parameter in the same
l 160~29
-29-
manner as described above. The complete dosage table is
loaded one byte at a time as above until the table is
filled with seven two byte numbers. The program then
goes back to the initialization of registers in the
Executive Program subsequent to step 202. This restarts
the entire program and sends out a code of 1,1 from the
Acoustic Output Subroutine, so that the system with its
new parameter data is then ready to accept the programming
of the interval and dosage commands in the normal fashion.
After the new parameter information is received
and the executive program has stepped through the read new
data subroutine, and advanced to step 354 and received an
indication that no new parameters are to be received, the
program steps to step 388 of Figure 13, and determines if
the make permanent code has been received, the new data is
transferred from the JUST SENT to the PREVIOUSLY SENT data
RAM locations at step 390. If the make permanent code has
not been received, the test of step 392 advances the execu-
tive program to step 398 where the Just Sent Data from
R~M is moved to the previously sent ddta locations, and the
acoustic data subroutine is called at step 256. The pro-
cess of continually reading new data through the Read New
Data subroutine and outputting that new data through the
acoustic data subroutine continues until a make permanent
code is received and the test at step 388 is a yes. Tlle
program than steps to step 394, which causes the Previously
Sent Data to be loaded into the Permanent Data locations.
The program then steps into the Read New Data Subroutine
at step 396, and continues to operate in the Read ~ew Data
Subroutine until the interrupt signal is received by remov-
ing the magnet and opening the reed swi~ch.
Interrupt Subroutine.
The Interrupt Subroutine is shown in Figure 19.
The Interrupt Subroutine is entered from the Accept New
Data Subroutine. The Interrupt Subroutine is initiated
when the reed switch opens as the magnet is removed to
remove the LOGIC 1 from the INT input at pin Al-36 of the
~ . .
l 16~529
-30-
microprocessor 100 when the interrupt input has been en-
abled by the program.
At step 402, the main program coun~er R4 is set
up to return control to the main program counter and RC,
the read new data counter, is set up to the beginning of
the Read New Data Subroutine. At step 404, the Interrupt
Subroutine is restored. Step 408 is a check to see if
the Just Sent Data in the location of memory pointed to by
RB is a permanent code. If the just sent data is a perma-
nent code, the program is restarted by moving to step 428.At step 428, we go back to the start of the Executive
Program.
If, at step 408, it is determined that the just
sent data was not a permanent code, the program moves
through steps 414 through 426 back to the executive pro-
gram. In that situation at step 416, the working data
pointer is pointed at the RAM to retrieve the presently
working motor control perameters, and at 424, the tor
control port is selected and the motor control subroutine
is enabled at 426.