WO2015160390A1 - Flow rate sensor system and method for non-invasively measuring the flow rate of a bodily fluid - Google Patents

Flow rate sensor system and method for non-invasively measuring the flow rate of a bodily fluid Download PDF

Info

Publication number
WO2015160390A1
WO2015160390A1 PCT/US2015/000001 US2015000001W WO2015160390A1 WO 2015160390 A1 WO2015160390 A1 WO 2015160390A1 US 2015000001 W US2015000001 W US 2015000001W WO 2015160390 A1 WO2015160390 A1 WO 2015160390A1
Authority
WO
WIPO (PCT)
Prior art keywords
implant
heating element
external
power
communication subsystem
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Ceased
Application number
PCT/US2015/000001
Other languages
French (fr)
Inventor
James H. Goldie
Thieu Q. Truong
Minh Duong
Thomas Russell
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Vivonics Inc
Original Assignee
Vivonics Inc
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Vivonics Inc filed Critical Vivonics Inc
Priority to CA2978539A priority Critical patent/CA2978539C/en
Priority to EP15780530.0A priority patent/EP3131460B1/en
Publication of WO2015160390A1 publication Critical patent/WO2015160390A1/en
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Classifications

    • A—HUMAN NECESSITIES
    • A61—MEDICAL OR VETERINARY SCIENCE; HYGIENE
    • A61B—DIAGNOSIS; SURGERY; IDENTIFICATION
    • A61B5/00—Measuring for diagnostic purposes; Identification of persons
    • A61B5/01—Measuring temperature of body parts ; Diagnostic temperature sensing, e.g. for malignant or inflamed tissue
    • A—HUMAN NECESSITIES
    • A61—MEDICAL OR VETERINARY SCIENCE; HYGIENE
    • A61B—DIAGNOSIS; SURGERY; IDENTIFICATION
    • A61B5/00—Measuring for diagnostic purposes; Identification of persons
    • A61B5/0002—Remote monitoring of patients using telemetry, e.g. transmission of vital signals via a communication network
    • A61B5/0004—Remote monitoring of patients using telemetry, e.g. transmission of vital signals via a communication network characterised by the type of physiological signal transmitted
    • A61B5/0008—Temperature signals
    • A—HUMAN NECESSITIES
    • A61—MEDICAL OR VETERINARY SCIENCE; HYGIENE
    • A61B—DIAGNOSIS; SURGERY; IDENTIFICATION
    • A61B5/00—Measuring for diagnostic purposes; Identification of persons
    • A61B5/02—Detecting, measuring or recording for evaluating the cardiovascular system, e.g. pulse, heart rate, blood pressure or blood flow
    • A61B5/026—Measuring blood flow
    • A—HUMAN NECESSITIES
    • A61—MEDICAL OR VETERINARY SCIENCE; HYGIENE
    • A61B—DIAGNOSIS; SURGERY; IDENTIFICATION
    • A61B5/00—Measuring for diagnostic purposes; Identification of persons
    • A61B5/03—Measuring fluid pressure within the body other than blood pressure, e.g. cerebral pressure ; Measuring pressure in body tissues or organs
    • A61B5/031—Intracranial pressure
    • A—HUMAN NECESSITIES
    • A61—MEDICAL OR VETERINARY SCIENCE; HYGIENE
    • A61B—DIAGNOSIS; SURGERY; IDENTIFICATION
    • A61B5/00—Measuring for diagnostic purposes; Identification of persons
    • A61B5/72—Signal processing specially adapted for physiological signals or for diagnostic purposes
    • A61B5/7271—Specific aspects of physiological measurement analysis
    • A61B5/7278—Artificial waveform generation or derivation, e.g. synthesizing signals from measured signals
    • A—HUMAN NECESSITIES
    • A61—MEDICAL OR VETERINARY SCIENCE; HYGIENE
    • A61B—DIAGNOSIS; SURGERY; IDENTIFICATION
    • A61B2560/00—Constructional details of operational features of apparatus; Accessories for medical measuring apparatus
    • A61B2560/02—Operational features
    • A61B2560/0204—Operational features of power management
    • A61B2560/0214—Operational features of power management of power generation or supply
    • A61B2560/0219—Operational features of power management of power generation or supply of externally powered implanted units
    • A—HUMAN NECESSITIES
    • A61—MEDICAL OR VETERINARY SCIENCE; HYGIENE
    • A61B—DIAGNOSIS; SURGERY; IDENTIFICATION
    • A61B2560/00—Constructional details of operational features of apparatus; Accessories for medical measuring apparatus
    • A61B2560/02—Operational features
    • A61B2560/0223—Operational features of calibration, e.g. protocols for calibrating sensors
    • A—HUMAN NECESSITIES
    • A61—MEDICAL OR VETERINARY SCIENCE; HYGIENE
    • A61B—DIAGNOSIS; SURGERY; IDENTIFICATION
    • A61B2562/00—Details of sensors; Constructional details of sensor housings or probes; Accessories for sensors
    • A61B2562/02—Details of sensors specially adapted for in-vivo measurements
    • A61B2562/0271—Thermal or temperature sensors
    • A—HUMAN NECESSITIES
    • A61—MEDICAL OR VETERINARY SCIENCE; HYGIENE
    • A61B—DIAGNOSIS; SURGERY; IDENTIFICATION
    • A61B5/00—Measuring for diagnostic purposes; Identification of persons
    • A61B5/0002—Remote monitoring of patients using telemetry, e.g. transmission of vital signals via a communication network
    • A61B5/0031—Implanted circuitry

Definitions

  • This invention relates to a flow rate sensor system and method for measuring the flow rate of a bodily fluid.
  • CSF cerebrospinal fluid
  • VP Ventriculo-peritoneal
  • Invasive surgery allows direct observation of the shunt and its flow behavior when it is allowed to drain into a collection vessel. This is different than measuring the flow rate when the shunt is draining into the peritoneum, but it does allow the surgeon to check patency of the shunt and provide an indication of current flow.
  • the ShuntCheck by NeuroDX Development has been shown in clinical studies to provide a means for assessing CSF flow through a VP Shunt.
  • the ShuntCheck uses thermal techniques for determining that CSF flow is present in the shunt.
  • the ShuntCheck relies on a disposable temperature sensor placed over the skin proximate the shunt tubing. An ice cube is placed over the shunt and the effect on the temperature of the skin close to the shunt downstream of the ice cube is monitored.
  • the ShuntCheck has the advantage that it is not implanted, but it has the disadvantage that it is unable to provide a quantitative measure of flow rate.
  • Another conventional quantitative flow measuring device for measuring the flow of CSF in VP shunt tubing uses an implantable device that produces a bubble in the shunt tubing by electrolysis. The bubble is then detected by an electrode arrangement using electric impedance or ultrasonically with a Doppler probe.
  • Extracorporeal high-frequency transmission supplies the energy for electrolysis and flow may be calculated based on the velocity of bubble flow in the tubing.
  • Another conventional VP shunt pressure sensor determines pressure from deflection of a capacitive membrane.
  • the shunt flow sensor membrane has a vacuum on the side of the membrane that is not in contact with fluid. Thus, the device is measuring pressure relative to vacuum.
  • ICP intracranial pressure
  • cranial imaging techniques such as ultrasonography, computer assisted tomography (CAT), magnetic resonance imaging (MRI), and the like.
  • CAT computer assisted tomography
  • MRI magnetic resonance imaging
  • Intracranial pressure monitoring is currently available through implanted catheters and transducers, typically in an intensive care unit.
  • clinicians rely on reports of symptoms from the patient, imaging of the ventricles, or the use of invasive devices to treat diseases related to CSF flow through VP shunts. Additionally, the progression of disease and injuries cannot be studied extensively because of the lack of shunt flow data.
  • an implanted sensor system capable of determining and reporting flow rate of a bodily fluid, such as CSF, that can be queried transcutaneous! y to allow the clinician to noninvasively assess shunt function.
  • This invention features a flow rate sensor system for non-invasively measuring the flow rate of a bodily fluid.
  • the system includes an encapsulated implant having a flow rube having an inlet and an outlet configured to receive a flow of a bodily fluid.
  • a heating element externally coupled to the flow tube is configured to dissipate heat at a predetermined rate over a predetermined amount of time.
  • a temperature sensor externally coupled to the heating element is configured to measure a temperature rise of the heating element over the predetermined amount of time.
  • An implant microcontroller coupled to the temperature sensor is configured to determine the flow rate of the bodily fluid in the flow tube from the measured temperature rise of the heating element over the predetermined amount of time and a curve fit to a stored set of previously obtained calibration measurements.
  • communication subsystem coupled to the implant microcontroller is configured to wirelessly receive power and wirelessly transmit and receive data.
  • the system also includes an external device having an external
  • microcontroller and an external power and communication subsystem coupled to the external microcontroller configured to wirelessly deliver power to the implant power and communication subsystem and transmit and receive data to and from the implant power and communication subsystem.
  • the temperature sensor may include a thermistor or a resistance temperature detector (RTD).
  • the thermistor may be configured as both the temperature sensor and the heating element.
  • the temperature sensor may include a thermocouple.
  • the heating element may include a surface mount resistor.
  • the heating element may include a coil of electrically conductive wire or a printed circuit heater.
  • the heating element may be directly attached to the external surface of the flow tube.
  • the system may include a thermal insulator configured to thermally isolate the heating element and the temperature sensor from cooling paths other than the direct cooling path to the bodily fluid in the flow tube.
  • the thermal insulator may include an insulation layer over the heating element and the temperature sensor.
  • the thermal insulator may include a sealed volume of air surrounding the heating element and the temperature sensor.
  • the flow through flow tube may be comprised of a thin wall of polymer material with low thermal conductivity configured to limit heat transfer along a length and a circumference of the tube while maintaining heat transfer in a radial direction to the fluid.
  • the bodily fluid may include one or more of:
  • the encapsulated implant may be coupled to a shunt, tube, vessel or catheter implanted in a human body or an animal.
  • the shunt may include one or more of: a ventriculo-peritoneal (VP) shunt,
  • the encapsulated implant may be coupled to a distal catheter of the shunt.
  • the encapsulated implant may be coupled to a proximal catheter of the shunt.
  • the heating element and the temperature sensor may be located proximate the outlet.
  • the heating element and the temperature sensor may be located proximate the inlet.
  • the heating element and the temperature sensor may be located between the inlet and the outlet.
  • the external power and communication subsystem includes an external coil coupled to the external microcontroller and the implant power and communication subsystem includes an implant coil coupled to the microcontroller.
  • the implant coil of the encapsulated implant may be located using the magnitude of the induced voltage wirelessly sent from the implant coil to the external coil.
  • the external coil may be positioned proximate and in alignment with the implant coil to achieve sufficient inductive coupling between the external coil and the implant coil.
  • the external coil may be remotely located from and tethered to the external power and communication subsystem.
  • the implant coil may be integrated .
  • the implant coil may be remotely located from and tethered to the encapsulated implant.
  • the external power and communication subsystem may include a resonant circuit comprised of the external coil and a capacitor, and a source of low-level voltage pulses, the external device resonant circuit configured to provide sinusoidal current in the external coil of sufficient amplitude to induce sufficient sinusoidal voltage in the implant coil.
  • the implant power and communication subsystem may include an implant resonant circuit comprised of the implant coil and a capacitor having a resonance frequency closely matched to the resonance frequency of the external resonant circuit to maintain sufficient AC voltage amplitude to power the implant power and communication subsystem and to enable communication between the external power and
  • the implant power and communication subsystem may be configured to convert induced sinusoidal voltages in the implant coil to a highly regulated DC voltage over the range of loading conditions to power the heating element, the temperature sensor, the microcontroller, and components of the implant power and communication subsystem.
  • the external power communication subsystem may be configured to enable the external microcontroller to communicate data to the implant power and
  • the implant power and communication subsystem may transmit binary values serially to the external power and communication subsystem by sequentially applying and removing an electrical load from the implant coil to induce changes in voltage in the external coil that are decoded into data by the external microcontroller.
  • the external power and communication subsystem may include a sense resistor configured to measure change in the amplitude of the current in external power and communication subsystem resulting from changes in the induced voltage in the external coil.
  • the external microcontroller may be coupled to the series resistor and may be configured to decode changes in the current of the external power and communication subsystem into data.
  • the implant microcontroller may be configured to store the set of previously obtained calibration measurements relating heating element temperature rise to flow rate.
  • the implant microcontroller may be configured to determine the flow rate from the measured temperature rise when temperature of the heating element is determined to be no longer rising to minimize the length of time needed to determine the flow rate, the amount of heat generated by the heating device, and the amount of heat delivered to a patient.
  • the implant microcontroller may be configured to store identification information associated with the encapsulated implant.
  • the implant microcontroller may be configured to use the mean value of a set of temperature rise samples obtained over the predetermined amount of time as the temperature rises to determine the flow rate of the bodily fluid in order to increase the signal to noise ratio.
  • the implant microcontroller may be configured to use a weighted average of a set of temperature rise samples obtained over a predetermined amount of time as the temperature rises to determine the flow rate of the bodily fluid in order to increase the signal to noise ratio.
  • the encapsulated implant may be implanted in a human body.
  • the external device may include a smart device including a flow sensor App and a tethered external coil.
  • the external device may include a display for displaying one or more of: the measured flow rate, the predetermined amount of time, induced voltage on the implant coil, and identification information associated with the encapsulated implant.
  • a flow rate sensor system for non-invasively measuring the flow rate of a bodily fluid.
  • the system includes an encapsulated implant having a flow tube having an inlet and an outlet configured to receive a flow of a bodily fluid.
  • a heating element externally coupled to the flow tube is configured to . dissipate heat at a predetermined rate over a predetermined temperature rise of the heating element.
  • a temperature sensor externally coupled to the heating element is configured to measure a temperature drop of the heating element over a
  • An implant microcontroller coupled to the temperature sensor is configured to determine the flow rate of the bodily fluid in the flow tube from the measured temperature drop of the heating element over the predetermined amount of cooling time and a curve fit to a stored set of previously obtained calibration measurements.
  • An implant power and communication subsystem coupled to the implant microcontroller is configured to wirelessly receive power and wirelessly transmit and receive data.
  • the system also includes an external device having an external microcontroller, and an external power and communication subsystem coupled to the external microcontroller configured to wirelessly deliver power to the implant power and communication subsystem and transmit and receive data to and from the implant power and communication subsystem.
  • a flow rate sensor system for non-invasively measuring the flow rate of a bodily fluid.
  • the system includes an encapsulated implant having a heating element externally coupled to a shunt, catheter, tube, or vessel configured to receive a flow of a bodily fluid, the heating element configured to dissipate heat at a predetermined rate over a predetermined amount of time.
  • a temperature sensor externally coupled to the heating element is configured to measure a temperature rise of the heating element over the predetermined amount of time.
  • An implant microcontroller coupled to the temperature sensor is configured to determine the flow rate of the bodily fluid in the shunt, catheter, tube or vessel from the measured temperature rise of the heating element over the predetermined amount of time and a curve fit to a stored set of previously obtained calibration measurements.
  • An implant power and communication subsystem coupled to the implant
  • microcontroller is configured to wirelessly receive power and wirelessly transmit and receive data.
  • the system also includes an external device having an external microcontroller and an external power and communication subsystem coupled to the external microcontroller configured to wirelessly deliver power to the implant power and communication subsystem and transmit and receive data to and from the implant power and communication subsystem.
  • the encapsulated implant may be configured as a two- piece clamp externally coupled to the shunt, catheter, tube, or vessel.
  • a flow rate sensor system for non-invasively measuring the flow rate of a bodily fluid.
  • the system includes an encapsulated implant having a heating element externally coupled to the shunt, catheter, tube, or vessel configured to receive a flow of a bodily fluid, the heating element configured to dissipate heat at a predetermined rate over a predetermined temperature rise of heating element.
  • a temperature sensor externally coupled to the heating element is configured to measure a temperature drop of the heating element over a
  • An implant microcontroller coupled to the temperature sensor is configured to determine the flow rate of the bodily fluid in the shunt, catheter, tube or vessel from the measured temperature drop of the heating element over the predetermined amount of cooling time and a curve fit to a stored set of previously obtained calibration measurements.
  • the system also includes an external device having an external microcontroller and an external power and communication subsystem coupled to the external microcontroller configured to wirelessly deliver power to the implant power and communication subsystem and transmit and receive data to and from the implant power and communication subsystem.
  • the encapsulated implant may be configured as a two- piece clamp externally coupled to the shunt, catheter, tube, or vessel.
  • a method for non-invasively measuring the flow rate of a bodily fluid includes providing an encapsulated implant coupled to a shunt, catheter, tube or vessel, receiving a flow of a bodily fluid in the shunt, catheter, tube or vessel, externally coupling a heating element to the shunt, catheter, tube or vessel configured to dissipate heat at a predetermined rate over a predetermined amount of time, externally coupling a temperature sensor to the heating element, measuring a temperature rise of the heating element over a predetermined amount of time, determining the flow rate of the bodily fluid in the shunt, catheter, tube or vessel from the measured temperature rise and a curve fit to a stored set of previously obtained calibration measurements, providing an external device, wirelessly delivering power to the encapsulated implant, and wirelessly transmitting and receiving data to and from the encapsulated implant.
  • the method may include thermally isolating the heating element and the temperature sensor.
  • the method may further include locating the encapsulated implant using data wirelessly sent from the encapsulated implant to the external device.
  • the method may further include positioning an external coil of the external device proximate and in alignment with an implant coil of the encapsulated ⁇ ⁇
  • the method may include storing on a
  • the method may include storing on a microcontroller of the encapsulated implant identification information associated with the encapsulated implant.
  • the method may include determining the flow rate from a current measured temperature rise up when the temperature of the heating element is determined to be no longer rising to minimize the length of time needed to determine the flow rate, the amount of heat generated by the heating device, and the amount of heat delivered to a patient.
  • a method for non-invasively measuring the flow rate of a bodily fluid includes providing an encapsulated implant coupled to a shunt, catheter, tube or vessel, receiving a flow of a bodily fluid in the a shunt, catheter, tube or vessel, externally coupling a heating element to the shunt, catheter, tube or vessel configured to dissipate heat until a predetermined rate temperature rise is achieved, externally coupling a temperature sensor to the heating element, measuring a temperature drop of the heating element over a predetermined amount of time of cooling, determining the flow rate of the bodily fluid in the flow tube from the measured temperature drop and a curve fit to a set of previously obtained calibration measurements, providing an external device, wirelessly delivering power from the external device to the encapsulated implant, and wirelessly transmitting and receiving data to and from the encapsulated implant and the external device.
  • Fig. 1 is a perspective side view showing the primary components of one embodiment of the flow rate sensor system and method thereof for non-invasively measuring the flow rate of a bodily fluid through a shunt implanted in a patient.
  • Fig. 2 is a top- view showing in further detail one embodiment of the encapsulated implant shown in Fig. 1 ;
  • Fig. 3 is a top- view of the encapsulated implant shown in Fig. 2 without the encapsulant thereon;
  • Fig. 4 is a schematic end-view showing in further detail one example of the placement of the heating element and temperature sensor about the flow tube shown in Figs. 2 and 3;
  • Fig. 5 is a graph depicting one example of a stored set of previously obtained calibration measurements showing a relationship between the temperature rise of the heating element and the flow rate of the bodily fluid used by the encapsulated implant 12 shown in one or more of Figs. 1-3;
  • Fig. 6 is a graph depicting one example of a curve fit to the previously obtained calibration measurements shown in Fig. 5;
  • Fig. 7 is a graph showing one example of the flow rate measured by the encapsulated implant shown in one or more of Figs. 1 -3 compared to the actual flow rate imposed by a syringe pump;
  • Fig. 8 is a graph depicting another example of a stored set of previously obtained calibration measurements showing a relationship between the temperature drop of a heating element and the flow rate of the bodily fluid used by the ,
  • encapsulated implant 12 shown in one or more of Figs. 1-3;
  • Fig. 9 is a graph depicting one example of a curve fit to the previously obtained calibration measurements shown in Fig. 8;
  • Fig. 10 is a schematic block diagram showing one embodiment of the primary components of the implant power and communication subsystem of the encapsulated implant shown in one or more of Figs. 1-3;
  • Fig. 11 is a schematic block diagram showing one embodiment of the primary components of the external power and communication subsystem of the external device shown in Fig. 1 ;
  • Fig. 12 shows an example of a resistance temperature detector (RTD) which may be used for the temperature sensor shown in at least Figs. 3, 4, and 10;
  • RTD resistance temperature detector
  • Fig. 13 shows an example of a thermocouple which may be used for the temperature sensor shown in at least Figs. 3, 4, and 10;
  • Fig. 14 shows an example of the heating element configured as a coil of electrically conductive wire
  • Fig. 15 shows an example of the heating element configured as a printed circuit heater a resistor
  • Figs. 16-17 show examples of the heating element configured as a resistor
  • Fig. 18 is a schematic end-view showing one example of an insulation layer which may be placed about the heating element and temperature sensor shown in at least Figs. 3, 4, and 10;
  • Fig. 19 is a schematic end-view showing an example of an insulation layer of sealed air surrounding the heating element and temperature sensor shown in Figs. 3, 4, and 10;
  • Fig. 20 is a three-dimensional view showing in further detail the insulation layer of sealed air surrounding the heating element and temperature sensor shown in Fig. 19;
  • Fig. 21 is a front side-view showing one example of the primary components of a VP shunt and various locations of the encapsulated implant on a ventricular catheter or a distal catheter;
  • Fig. 22 is a side-view showing in further detail one example of the primary components of the flow rate sensor system shown in one or more of Figs. 1-19;
  • Fig. 23 is a front side-view showing in further detail one example of the alignment of the implant coil shown in at least Figs. 2, 3, and 10 with the external coil of the external power and communication subsystem shown in at least Figs. 1 and 22;
  • Fig. 24 is a schematic diagram showing one example of the implant coil separately located from the encapsulated implant.
  • Fig. 25 is a three-dimensional front-view showing the primary components of another embodiment of the flow rate sensor system for non-invasively measuring the flow rate of a bodily fluid through a shunt catheter, tube or vessel.
  • System 10 includes encapsulated implant 12 and external device 14.
  • encapsulated implant 12 is implanted into human body 15 and is coupled to ventricular or proximal catheter 16 of VP shunt 18.
  • encapsulated implant 12 (shown in phantom) may be coupled to distal catheter 20 of VP shunt 18, indicated at 25.
  • encapsulated implant 12 need not necessarily be coupled in-line to VP shunt 18 as shown and may be externally coupled over any type catheter, shunt, tube, vessel and the like, which is implanted in the human body or the body of an animal and has a flow of bodily fluid there through, as discussed in further detail below.
  • encapsulated implant 12, Fig. 2 includes flow tube 22 having inlet 24 and outlet 26 configured to receive flow of bodily fluid 28.
  • Flow of bodily fluid 28 may include CSF, blood, bile, urine, or other bodily fluid.
  • Encapsulated implant 12 includes encapsulant 30, e.g., a medical grade polyurethane such as Steralloy FDF 2380 (Hapco, Inc. Hanover, MA 02339), silicone, or other biocompatible materials.
  • heating element 32 directly and externally coupled to external surface 23 of flow tube 22 and temperature sensor 34 externally coupled to heating element 32.
  • heating element 32 Figs. 3 and 4
  • temperature sensor 34 is configured to measure the temperature rise of heating element 32 over a ,.
  • predetermined amount of time e.g., 10 seconds, 20 seconds, 30 seconds, and the like, as discussed in further detail below.
  • Encapsulated implant 12, Fig. 3 also includes implant microcontroller 35, preferably coupled to printed circuit board (PCB) 55, configured to determine the flow rate of flow of bodily fluid 28 in flow tube 22 from the temperature rise of heating element 32 over the predetermined amount of time and a curve fit to a stored set of previously obtained calibration measurements.
  • the stored set of previously obtained calibration measurements include measurements of the temperature rises of same heating element 32 and associated imposed flow rates over the same
  • the store set of previously obtained calibration measurements are preferably stored by implant microcontroller 35.
  • the stored set of previously obtained calibration is the stored set of previously obtained calibration
  • measurements shown by data points 40, Fig. 5, may be created by a user request using external device 14, Fig. 1.
  • the stored set of previously obtained measurements may be created by applying a regulated DC voltage to heating element 32, Figs. 3 and 4, that produces a repeatable heat dissipation level from the heating element 32 each time the regulated DC voltage is applied, discussed in further detail below.
  • the resulting heat created within heating element 32 causes a rise in temperature of the heating element 32 over the same predetermined amount of time, e.g., 5, 10, 15, 20, 30, or 40 seconds, or similar time intervals, as that used for the flow rate
  • the rise in temperature of heating element 32 is measured by temperature sensor 34 over the predetermined amount of time, while heating element 32 is turned on and dissipating heat. In order to accurately obtain the temperature rise of temperature sensor 34 and heating element 32, temperature measurements are applied
  • the average of these temperature measurements may serve as a baseline temperature that can be subtracted from the temperature measurements taken after heating element 32 is turned on.
  • the resulting temperature rise over the predetermined amount of time is preferably matched to the imposed flow rate, and two values are stored in the memory of the implant microcontroller 35 as the stored set of calibration measurements.
  • two values are stored in the memory of the implant microcontroller 35 as the stored set of calibration measurements.
  • multiple values of temperature rise versus flow rate over the predetermined amount time and rate of heat dissipation may be stored.
  • a pump capable of accurately delivering a known desired flow rate such as a well-calibrated syringe pump may be used to create the stored calibrated measurement.
  • the stored set of calibrated flow rate measurements may be obtained in this manner at each of multiple flow rate settings over the known range of feasible bodily fluid flow rates through flow tube 22, e.g., from about 0 to about 40 mL/hr.
  • the number of calibration values for the stored set of calibrated flow rate measurements is preferably sufficient to characterize a curve of the rise in temperature of heating element 32 as a function of flow rate, e.g., data points 40, Fig. 5.
  • the heat dissipation from heating element 32, Figs. 3 and 4 need not be precisely known, but is preferably repeatable each time heating element 32 and encapsulated implant 12, Figs. 1 -3, is activated.
  • a regulated DC voltage is applied to heating element 32 and the temperature rise of heating element 32 is sensed by temperature sensor 34 andranchor
  • Curve fitting is preferably applied to the stored set preferably previously obtained calibration measurements of temperature rise versus flow rate to derive a continuous relationship between measured temperature rise and flow rate, as shown by curve 41, Fig. 6. From curve 41 and the measured temperature rise, the flow rate of flow of bodily fluid 28, Fig. 3, through flow tube 22 over the duration of the measurement is inferred.
  • Curve fitting is a well understood process of creating a curve or a continuous mathematical function that closely fits a series of data points. For determination of flow rate, curve fitting can involve either interpolation between calibration data points of measured temperature rises versus flow rates, or the determination of a smooth mathematical function that fits all the data points 40, Fig. 5, to a good approximation. Curve 41 , Fig. 6, shows one example of curve fitting in which linear extrapolation is employed between each of the adjacent data points 40 shown in Fig. 5.
  • Plot 49, Fig. 7 shows one example of the flow rates measured by encapsulated implant 12, indicated at 51 , compared to actual known flow rates imposed by a calibrated syringe pump, indicated at 53.
  • encapsulated implant 12, Figs. 1 -3 accurately determined the flow rate of flow of bodily fluid 28 in flow tube 22.
  • implant microcontroller 35 determines that the temperature of heating element 32 is no longer rising (i.e. that steady state has been reach), then implant microcontroller 35 can terminate the measurement since it has already acquired a sufficient number of temperature values from temperature sensor 34 to determine the flow rate. This can reduce the predetermined amount of time needed to determine the flow rate of flow of bodily fluid 28, e.g., to between about 5 to 10 seconds and minimize the amount of heat needed to be generated by heating element 32.
  • the dependence of the temperature rise of heating element 32 over the duration of a flow rate measurement by encapsulated implant 12 rate arises from the flow rate of flow of bodily fluid 28, Fig. 2, and the heat transfer coefficient for heat transfer from heating element 32 into flow of bodily fluid 28 inside tube 22 in accordance with formula:
  • h Q/(AAT) (1)
  • Q is the heat dissipated by the heating element 32
  • A is the area of heat transfer
  • ⁇ is the difference in temperatures between heating element 32 and bodily fluid 28 flowing in tube 22.
  • the heat transfer coefficient h increases monotonically with flow rate, at least over the range of CSF flow rates possible within a shunt. Therefore, since the level of heat dissipation Q produced by the heating element is fixed for a given applied DC voltage, the temperature rise of heating element 32 during a flow rate measurement will decrease with increasing CSF flow rate.
  • Flow rate sensor system 10 shown in one or more of Figs. 1-4, may also be used to determine flow rate by measuring the temperature drop of heating element 32 after it is allowed to cool for a predetermined amount of time, e.g., 5, 10, 20, 30 seconds, and the like, after the heating element 32 has been previously heated until a predetermined temperature rise is achieved, e.g., 2, 3, 4 °C, and the like.
  • the measured temperature drop is then compared with a set of previously obtained calibration measurements in which temperature drops were measured and stored after heating element 32 was first heated to the same temperature rise and then turned off for the same predetermined amount of time, while precisely known flow rates were imposed.
  • a curve fit or interpolation may be used to estimate flow rate from the stored set of previously _
  • a flow rate may be determined by first turning on heating element 32 and allowing it to continue to warm up until implant microcontroller 35, Fig. 3, detects a predetermined rise in temperature has been achieved, e.g., about 3°C. At this point heating element 32 is turned off and allowed to cool for a predetermined period of time e.g., 5, 10, 15 seconds, and the like. During the cooling of heating element 32, the temperature drop of heating element 32 over a predetermined amount of time will depend on the flow rate of bodily fluid 28 in tube 22, since the rate of cooling of heating element 32 depends on the flow rate of bodily fluid 28.
  • implant microcontroller 35 is configured to determine the flow rate of the bodily fluid in the flow tube from the measured temperature drop of the heating element 32 and curve fit to a stored set of previously obtained calibration measurements having a relationship between temperature drop of heating element and flow rate of bodily fluid established similar as described above.
  • data points 57, Fig. 8 is utilized instead of data points 40, Fig. 5 described above.
  • Curve-fitting or interpolation is preferably applied to the set of previously obtained calibration measurements shown in Fig. 8 in order to infer the flow rate through tube 22 over the duration of the measurement, e.g. as shown by curve 59, Fig. 9.
  • Encapsulated implant also includes implant power and
  • Implant power and communication subsystem 50, Fig. 10, is configured to wirelessly receive power and transmit and receive data.
  • External device 14, Fig. 1 , of system 10 also includes external microcontroller 56, Fig. 1 1, and external power and communication subsystem 58 coupled to external microcontroller 56 configured to wirelessly deliver power to implant power and communication subsystem 50, Fig. 10, and wirelessly transmit and receive data to and from implant power and communication subsystem 50 of encapsulated implant 12, Figs. 1 -3, as discussed in further detail below.
  • temperature sensor 34 includes a thermistor, e.g., thermistor 34' as shown in Fig. 10.
  • temperature sensor 34 may be a resistance temperature detector (RTD), e.g. RTD 102, Fig. 12, or a thermocouple, e.g., thermocouple 104, Fig. 13.
  • RTD resistance temperature detector
  • heating element 32 may be a coil of electrically conductive wire wound around the flow tube 22, e.g., coil 106, Fig. 14, of electrically conductive wire.
  • heating element 32 may be a printed circuit heater, e.g., printed circuit heater 108, Fig. 15.
  • heating element 32 may be a resistor (either surface mount or leaded), e.g. resistor 1 10, Fig. 16, or any of resistors 1 12, Fig. 17.
  • heating element 32 is directly attached to flow tube 22 as shown in Fig. 4.
  • the rise in temperature of the heating element 32 over the predetermined amount of time or the temperature drop over the predetermined amount of time of cooling represents the 'signal' employed during a flow rate measurement to determine flow rate.
  • the signal may be increased by thermally isolating the heating element 32 from heat transfer paths other than conduction/convection to the flow of bodily fluid 28, Fig. 3, flowing through the flow tube 22.
  • encapsulated implant 12 includes thermal insulator 70, Fig. 18, which preferably covers heating element 32 and temperature sensor 34 as shown to thermally isolate heating element 32 and temperature sensor 34 from heat transfer paths other than Vogelliking
  • Thermal insulator 70 may also surround all of flow tube 22, as shown by thermal insulator 70' in phantom.
  • insulation layer 70", Fig. 19 may be a pocket of sealed air created by surrounding flow tube 22 with hollow tube 78.
  • flow tube 22, Figs. 3, 4, 18-20 may be made of a thin walled polymer material with low thermal conductivity, such as polyimide or similar type material, to limit heat transfer along the length and circumference of flow tube 22 while maintaining heat transfer in the radial direction to the bodily fluid in tube 22 made viable by the thin wall thickness of the tube.
  • a thin walled polymer material with low thermal conductivity such as polyimide or similar type material
  • encapsulated implant 12, Fig. 1 may be coupled to VP shunt 18, e.g., to distal catheter 20 of VP shunt 18 or proximal catheter 16.
  • Fig. 21 shows in further detail one example of the structure of VP shunt 18 with distal catheter 20 and proximal or ventricular catheter 16.
  • Encapsulated implant 12 may be located at any position on ventricular catheter 16 or distal catheter 20 as shown.
  • encapsulated implant may be coupled to shunt, catheter, tube, or vessel implanted in the body, such as a ventroarterial shunt or a lumboperitoneal shunt.
  • heating element 32 and temperature sensor 34 are shown located proximate outlet 26. In other examples, heating element 32 and temperature sensor 34 may be located proximate inlet 24 indicated at 80, Figs. 3, or between inlet 24, and outlet 26, as indicated at 82.
  • External power and communication subsystem 58, Fig. 1 1, of external device 14, Fig. 1 includes external coil 90, Fig. 1 1 coupled to microcontroller 56.
  • External power and communication subsystem 58, Fig. 1 1, is configured to inductively transfer power from external coil 90, Figs. 1 1 and 22, to implant coil 52, Figs. 3 and 22, of implant power and communication subsystem 50, Fig. 10.
  • V 2 (t) M (dli/dt)
  • V2 coMIi, (3) where and Ii are the amplitude of the voltage induced in implant coil 52 and the amplitude of the current in the external coil 90, respectively.
  • Ii are the amplitude of the voltage induced in implant coil 52 and the amplitude of the current in the external coil 90, respectively.
  • a voltage is induced in external coil 90 given by:
  • Vj and are the amplitude of the voltage induced in the external coil 90 and the amplitude of the current in external coil 90, respectively
  • the mutual inductance depends both on the self-inductances of the coupled external coil 90 (Li) and implant coil 52 (L 2 ) coils and the coupling coefficient (Kc) between them:
  • M Kc (L,L 2 ) 1/2 , (5) where Kc depends on relative orientation, lateral alignment and proximity of the external coil 90 and implant coil 52.
  • the self-inductance of the external coil 90 (L t ) is preferably set such that the source voltage 132, Fig. 1 1, of the external power and communication subsystem 58 is at a convenient and safe level, whereas the self- inductance of implant coil 52 (L 2 ) and the coupling coefficient (Kc) are preferably sufficient such that the induced voltage (after rectification and filtering) on implant power and communication subsystem 50, Fig. 10, of encapsulated implant 12 is high enough to meet the input voltage specifications of the DC-DC converter 208, Fig. 10, that provides the regulated DC voltage necessary to operate the implant
  • microcontroller 35 heating element 32, temperature sensor 34 and other various electronic components of encapsulated implant 12, Fig. 3, e.g., printed circuit board (PCB) 55 and the various electronics thereon.
  • PCB printed circuit board
  • External power and communication subsystem 58 preferably includes external resonance circuit 92 comprised of external coil 90, and capacitor 94, and source voltage 132 generated by a half bridge driver 103 or by other equivalent device known to those skilled in the art.
  • the external power and communication subsystem 58 is preferably configured to generate AC current flow at a predetermined resonance frequency in external coil 90, in order to induce sinusoidal voltage signals in implant coil 52, shown in at least Figs. 10 and 22.
  • resonant circuit 92, Fig. 1 1 , and analog electronics 96 filter and amplify changes in the voltage drop across current sense resistor 98 in order to recover data communications bits transmitted from implant power and
  • Half-bridge driver circuit 103, Fig. 1 1, with a dedicated controller and two MOSFETs (not shown) may be used to drive external coil 90.
  • External coil 90 in combination with series capacitor 94 preferably forms a resonant circuit with a predetermined resonant frequency, e.g., 100 kHz.
  • a 100 kHz square wave generated by external microcontroller 56 may be applied to half-bridge driver circuit 103 to create a sinusoidal current flow through the external coil 90.
  • the frequency may be adjusted to produce the closest match between resonant circuit 92 and resonant circuit 200, Fig. 10, of implant power and communication subsystem 50, as discussed below.
  • the voltage drop across sense resistor 98, Fig. 1 may be used to monitor the current through external coil 90.
  • the voltage across sense resistor 98 is preferably converted to DC by AC-DC rectifier 120 and filtered by filter 122 and peak detector 124 to remove the 100 kHz signal.
  • the difference between the peak voltage and the filtered voltage is then amplified by amplifier 126, converted to digital signal levels and fed to external microcontroller 56 for decoding of the digital data transmitted by the implant power and communication subsystem 50, Fig. 10 of encapsulated implant 12.
  • the communication subsystem 58, Fig. 1 1 , of external device 14 can modulate the square wave signal delivered to half-bridge driver 103 to encode information.
  • the implant power and communication system 50, Fig. 10 can decode the modulation in order to recover the data being transmitted.
  • resonance frequency may be beneficial because square-wave pulses, which are conveniently produced by half bridge driver 103 or other AC voltage source known to those skilled in the art, give rise to sinusoidally-varying current in external power and communication subsystem 58. Further, the impedance of series resonant circuit 92 is a minimum at resonance, which maximizes the current for a given applied voltage, thereby lowering the voltages to levels as may be found in a common battery or USB interface, e.g., interface port 140. In addition, since the current through external coil 90 varies with the applied square wave frequency, the power delivered to the external coil 90 can be easily tuned by changing the square wave frequency.
  • the value of capacitor 94 is preferably chosen such that the capacitor 94 and external coil 90 resonate at a desirable frequency.
  • resonant frequency may include, inter alia, the available space for external coil 90, frequency-dependent coil losses, skin effect, FCC regulations, guidelines regarding patient exposure to electromagnetic fields, and the like.
  • resonant circuit 92 is driven by a square wave source voltage 132, with its frequency set at or near the resonant frequency of resonant circuit 92.
  • This current gives rise to a magnetic field in the space surrounding external coil 90.
  • a fraction of the field lines of this magnetic field are inductively linked to implant coil 52, Fig. 10, thereby inducing sinusoidally- varying voltage in implant coil 52.
  • Implant power and communication subsystem 50, Fig. 10, of encapsulated implant 12 includes implant resonance circuit 200 comprised of implant coil 52 and capacitor 202.
  • Implant resonance circuit 200 is preferably configured to have a resonance frequency matching the resonance frequency closely provided by resonance circuit 92, Fig. 1 1.
  • the sinusoidally varying magnetic field generated by the sinusoidal current in external coil 90 links the implant coil 52 of resonant circuit 200.
  • the resulting induced sinusoidally varying voltages in implant coil 52, Fig. 10 are then rectified by AC-DC rectifier 204 to create a DC voltage on line 206, which is applied to the input of DC-DC converter 208, which creates a constant regulated DC voltage on line 209.
  • DC-DC power supply 208 provides power to implant
  • microcontroller 35 heating element 32, e.g., a thermistor, in this example, acting as temperature sensor 34, and other components on PCB 55, Fig. 3, of encapsulated implant 12, which may require power.
  • heating element 32 e.g., a thermistor, in this example, acting as temperature sensor 34
  • other components on PCB 55, Fig. 3, of encapsulated implant 12 which may require power.
  • external device 14, Figs. 1 and 22 encodes digital data for communication with encapsulated implant 12, shown in one or more of Figs 1-3, 10 and 22, by changing the magnitude of the source voltage 132, Fig. 1 1, which gives rise to a corresponding change in current in external power and communication subsystem 58, which, in turn, gives rise to a change in the amplitude of the voltage induced on implant coil 52.
  • Implant microcontroller 35 preferably monitors the voltage at the output of the AC-DC rectifier 204 by receive filter 212, in order to decode digital data sent from external power and communication subsystem 58 of external device 14.
  • Closure of the transmit driver switch 210 gives rise to an abrupt increase in current in the implant coil 52 and AC-DC rectifier 204 of the implant power and communication subsystem 50, which, in turn, gives rise to a change in the induced voltage and current flow in external coil 90, and external power and communication subsystem 58.
  • the voltage drop across the sense resistor 92 provides a means for monitoring the current flow in external power and communication subsystem 58 and external device 14 and thus provides a means for external microcontroller 56, onboard the external device 14, to decode the changes in current into digital data.
  • the maximum rate of data transfer i.e., baud rate
  • implant coil 52, Figs. 3, 10, and 22, and external coil 90, Figs. 1 1 and 22, are preferably placed in close proximity to each other, e.g., as shown in Fig. 22 and in further detail in Fig. 23 to provide sufficient inductive coupling between implant coil 52 and external coil 90 such that external power and communication subsystem 58 can wirelessly provide power to implant power and communication subsystem 50 and data can be wirelessly communicated to and from external power and communication subsystem 58 and implant power and communication subsystem 50, as discussed above.
  • external coil 90 of external device 14 may be located relative to implant coil 52 of encapsulated implant 12 in human body 15, Fig. 1 , using 2g data wirelessly sent from implant power and communication subsystem 50 to external power and communication subsystem 58. For example, data communicated from implant power and communication subsystem 50 to external power and
  • communication subsystem 58 includes the magnitude of the induced voltage (after rectification and filtering) onboard implant power and communication subsystem 50 of encapsulated implant 12, which provides a means by which a user of system 10 can position external device 14 and external coil 90, e.g., as shown in Fig. 1 , relative to implant coil 52 of encapsulated implant 12 in human body 15.
  • the induced voltage onboard implant power and communication subsystem 50 is sufficient to both enable wireless communication and power transfer and to power the implant power and communication subsystem 50.
  • the value of the induced voltage of implant coil 52 of implant power and communication subsystem 50 can be the basis for an intuitive, graphical display by external device 14 (discussed below) that enables the user to readily find an acceptable location for the external device 14 and to verify that sufficient coupling between implant coil 52 of encapsulated implant 12 and external coil 90 of external device 14 has been achieved for a calibration or flow measurement.
  • Implant microcontroller 35 is configured to store the measured flow rate, the stored set of previously obtained calibration
  • encapsulated implant 12 e.g. as shown in Figs. 5 and 8
  • identification information associated with the encapsulated implant 12 e.g., the serial number, model number, and the like, in a non-volatile manner.
  • external device 14, Fig. 22, includes display 290 which may display the measured flow, the previously obtained calibration measurements, the value of induced voltage on implant coil 52 or similar type measurements or values, and the identification information associated with encapsulated implant 12.
  • External device 14, Figs. 1, 1 1, and 20 may include interface port 140 coupled to external microcontroller 56 configured to connect to computer subsystem 62, Fig. 1 1 , by electrical cable 63.
  • interface port 140 coupled to external microcontroller 56 may be configured to wirelessly connect computer subsystem 62.
  • Interface port 140 coupled to external microcontroller 56 may also be configured to wirelessly connect to computer subsystem 62 configured as a smart device.
  • implant coil 52 shown in one or more of Figs. 2, 3, 22 and 23, is shown integrated with encapsulated implant 12, this is not a necessary limitation of this invention.
  • implant coil 52, Fig. 24, where like parts have been given like numbers, may be located remotely from encapsulated implant 12 as shown and coupled to encapsulated implant 12 with wires 250.
  • flow rate sensor system 10', Fig. 25, where like parts have been given like numbers, for non-invasively measuring the flow rate of a bodily fluid includes external device 14 with external power and communication subsystem 58, having the same design as discussed above with reference to at least Figs. 1 , 1 1 , and 20.
  • Encapsulated implant 12' includes encapsulated implant 12' that is clamped over a shunt, tube, vessel or catheter 250 implanted in a human body or animal body. Encapsulated implant 12' clamps over shunt, tube, vessel or catheter 250 using clamshell device 252 with clamping members 256 and 258 as shown.
  • Encapsulated implant 12' includes heating element 32 and temperature sensor 34 and implant power and communication subsystem 50 having a similar structure as discussed above with reference to one or more of Figs. 1-24. In this design, heating element 32, Fig. 25, externally and directly couples to shunt, tube, vessel or catheter 250, and temperature sensor 34 is directly externally coupled to heating element 32, e.g., as shown in blow-out caption 264.
  • System 10' operates similar to system 10, discussed above, with reference to one or more of Figs. 1-24.
  • External device 14, Figs. 1 , 22, and 25 may be a dedicated unit, designed for measuring the flow rate of a bodily fluid, or may be a smart device, such as a phone or tablet with an App and attached coil accessory similar to external coil 90 and wires connecting it to external device 14.
  • flow rate sensor system 10 and the method thereof, shown in one or more of Figs. 1-25, that accurately and non-invasively measures the flow rate of a bodily fluid and provides a means of obtaining quantitative information on how a shunt, such as a VP shunt, or other similar type shunt, tube, vessel, or catheter, is functioning when implanted in a human or animal body.
  • System 10 in some examples eliminate the need for obtaining cranial imaging using ultrasound, CT scanning, MRI, X-ray, and the like.
  • Flow rate sensor system 10 can display or report the rate of flow of bodily fluids, such as CSF and other bodily fluids, and can be queried transcutaneously to allow the clinician to non-invasively assess shunt function during emergency room visits or during routine office visits.
  • System 10 enables the primary care physician or specialist to see changes in the flow of bodily fluids over time and anticipate shunt failures prior to the development of symptoms.
  • flow rate sensor system 10 and the method thereof enables timely intervention to maintain shunt function and reduce the likelihood of emergency shunt revision surgeries.
  • Flow rate sensor system 10 and the method thereof can measure and monitor flow rate of bodily fluids in a patient with a shunt who arrives at the emergency room with symptoms possibly indicative of shunt failure and quickly and accurately provide the clinician with information regarding shunt function and, thus, can avoid unnecessary diagnostic or surgical procedures.
  • the result is better care, reduced risk of death or injury from shunt failure, and reduced cost of care for those whose lives depend on continuous and proper function of their shunts.
  • External device 14 enables the clinician to obtain and store a "snapshot" of flow rate of CSF or other bodily fluids whenever needed. Because patient posture and orientation can affect flow through a shunt, the clinician can choose to place patient in various orientations and then take a flow rate measurement at selected orientations.
  • the external device or external coil can be affixed to the patient to enable
  • CSF flow rate measurements could be automatically obtained every half hour to monitor shunt function, both in the hospital and after discharge, for the critical days following a shunt placement or a shunt revision surgery.
  • a CSF flow rate measurement could be taken every 5 minutes on a shunted patient who arrives at the emergency room with symptoms possibly indicative of shunt failure. This would give the clinician complete knowledge of the flow characteristics of the shunt, possibly preventing unnecessary diagnostic or surgical procedures, including MRI or CT imaging and shunt revisions.
  • cmd strtok(line, delim);
  • timeStamp + fset . interval ; // Increment time stamp
  • timeStamp 0; // in case of roll over
  • Chip Temp %s ⁇ r ⁇ n
  • decToStr chipTemp (strToDec (line) )
  • scanTime value
  • word strtok (NULL, delim) ;
  • value abs (value % 100); if (value ⁇ 10) snprintf (decstr, VSTRLEN, "%s .0%d” , istr, value); else snprintf (decstr, VSTRLEN, "%s . %d", istr, value);
  • decptr strchr ( str, ' . ' ) ;
  • TXBUF0 ch; // TX character
  • va_start (ap, fmt);
  • va_end (ap) va_end (ap) ;
  • word[0] ' ⁇ 0'; // strip off leading blanks and tabs and commas
  • STRLEN 40 // maximum string length #define VSTRLEN 10 // maximum number string length struct cmd_table
  • fset t fset ⁇ 0x55, 1, 20, 30, 5, -26975, 0, 0, 0, 0 , 1 * 200, */ ⁇ 0 ⁇ ;
  • BCSCTL1 CALBC1_8MHZ + DIVA_1; // Set DCO and DIVA to divided ACLK by 2....
  • TACTL TASSEL_2 + MC_2 ; // SMCLK, contmode
  • CCTL0 CCIE; // CCR0 interrupt enabled
  • SD24CTL SD24REFON+SD24SSEL_l+SD24DIV_2 // 1.2V ref, SMCLK/4 SD24CCTL0
  • SD24GRP+SD24DF+SD24OSR_1024 // Group with CHI
  • SD24CCTL1 SD24GRP+SD24 DF+SD240SR 1024 // Group with CH2
  • SD24CCTL2 SD24IE+SD24DF+SD240SR 1024; // Enable interrupt
  • SD24CCTL2 SD24SC
  • FCTL3 FWKEY; // Clear Lock bit
  • FCTL1 FWKEY + ERASE; // Set Erase bit
  • FCTL1 FWKEY + WRT; // Set WRT bit for write operation for (; length > 0; --length)
  • FCTL1 FWKEY; // Clear WRT bit
  • FCTL3 FWKEY + LOCK; // Set LOCK bit
  • SD24CCTL2 SD24IE

Landscapes

  • Health & Medical Sciences (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Engineering & Computer Science (AREA)
  • General Health & Medical Sciences (AREA)
  • Veterinary Medicine (AREA)
  • Biophysics (AREA)
  • Biomedical Technology (AREA)
  • Heart & Thoracic Surgery (AREA)
  • Medical Informatics (AREA)
  • Molecular Biology (AREA)
  • Surgery (AREA)
  • Animal Behavior & Ethology (AREA)
  • Physics & Mathematics (AREA)
  • Public Health (AREA)
  • Pathology (AREA)
  • Physiology (AREA)
  • Hematology (AREA)
  • Neurosurgery (AREA)
  • Cardiology (AREA)
  • Artificial Intelligence (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Psychiatry (AREA)
  • Signal Processing (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Measuring And Recording Apparatus For Diagnosis (AREA)
  • Measuring Pulse, Heart Rate, Blood Pressure Or Blood Flow (AREA)

Abstract

A flow rate sensor system for non-invasively measuring the flow rate of a bodily fluid. The system includes an encapsulated implant having a flow tube having an inlet and an outlet configured to receive a flow of a bodily fluid. A heating element externally coupled to the flow tube is configured to dissipate heat at a predetermined rate over a predetermined amount of time. A temperature sensor externally coupled to the heating element is configured to measure a temperature rise of the heating element over the predetermined amount of time.

Description

FLOW RATE SENSOR SYSTEM AND METHOD FOR NON-INVASIVELY MEASURING THE FLOW RATE OF A BODILY FLUID
RELATED APPLICATIONS
This application claims benefit of and priority to U.S. Patent Application Serial No. 14/120,048 filed April 18, 2014, under 35 U.S.C. §§1 19, 120, 363, 365, and 37 C.F.R. § 1.55 and §1.78, which is incorporated herein by this reference.
GOVERNMENT RIGHTS
This invention was made with U.S. Government support under Grant No.
6R44NS056628-04 awarded by the National Institutes of Health. The Government may have certain rights in certain aspects of the subject invention.
FIELD OF THE INVENTION
This invention relates to a flow rate sensor system and method for measuring the flow rate of a bodily fluid.
BACKGROUND OF THE INVENTION
Drainage of cerebrospinal fluid (CSF) is one major life-sustaining therapy which may be used for patients with congenital or acquired hydrocephalus or patients with serious head injuries. Ventriculo-peritoneal (VP) shunt placement for CSF drainage is a common procedure in neurosurgery. However, shunt failure is common and shunt revision surgery is even more common than initial placement. One study of shunt-related deaths from Jan 1990 to July 1996 found that children are dying of shunt failure and that early detection could prevent many of these deaths. Another study of all shunt procedures performed between January 1996 and December 2005, excluding temporary shunts such as external ventricular drains (EVDs), found that the median shunt survival life span was 398 days. These results are in good agreement yet another study that suggests failure rates of 25 to 40 percent in the first year and failure of seventy percent of shunts by five years. These findings point to the importance of the need for a non-invasive and convenient system and method for monitoring shunt function.
Invasive surgery allows direct observation of the shunt and its flow behavior when it is allowed to drain into a collection vessel. This is different than measuring the flow rate when the shunt is draining into the peritoneum, but it does allow the surgeon to check patency of the shunt and provide an indication of current flow.
The ShuntCheck by NeuroDX Development (Bensalem, PA 19020) has been shown in clinical studies to provide a means for assessing CSF flow through a VP Shunt. The ShuntCheck uses thermal techniques for determining that CSF flow is present in the shunt. The ShuntCheck relies on a disposable temperature sensor placed over the skin proximate the shunt tubing. An ice cube is placed over the shunt and the effect on the temperature of the skin close to the shunt downstream of the ice cube is monitored. The ShuntCheck has the advantage that it is not implanted, but it has the disadvantage that it is unable to provide a quantitative measure of flow rate.
Another conventional quantitative flow measuring device for measuring the flow of CSF in VP shunt tubing uses an implantable device that produces a bubble in the shunt tubing by electrolysis. The bubble is then detected by an electrode arrangement using electric impedance or ultrasonically with a Doppler probe.
Extracorporeal high-frequency transmission supplies the energy for electrolysis and flow may be calculated based on the velocity of bubble flow in the tubing.
Another conventional VP shunt pressure sensor determines pressure from deflection of a capacitive membrane. The shunt flow sensor membrane has a vacuum on the side of the membrane that is not in contact with fluid. Thus, the device is measuring pressure relative to vacuum.
Yet another conventional implanted intracranial pressure (ICP) sensor relies on the deflection of a membrane and the resultant change in the resonance of an LC- circuit.
However, none of the devices discussed above have yet to be demonstrated in humans to provide sufficiently reliable and accurate quantitative information on shunt function to be adopted for clinical use.
Current techniques to evaluate implanted shunts may include cranial imaging techniques, such as ultrasonography, computer assisted tomography (CAT), magnetic resonance imaging (MRI), and the like. Such techniques require relatively expensive equipment typically only available in hospitals. Intracranial pressure monitoring is currently available through implanted catheters and transducers, typically in an intensive care unit. Thus, clinicians rely on reports of symptoms from the patient, imaging of the ventricles, or the use of invasive devices to treat diseases related to CSF flow through VP shunts. Additionally, the progression of disease and injuries cannot be studied extensively because of the lack of shunt flow data.
Therefore, there is a need for an implanted sensor system capable of determining and reporting flow rate of a bodily fluid, such as CSF, that can be queried transcutaneous! y to allow the clinician to noninvasively assess shunt function.
SUMMARY OF THE INVENTION This invention features a flow rate sensor system for non-invasively measuring the flow rate of a bodily fluid. The system includes an encapsulated implant having a flow rube having an inlet and an outlet configured to receive a flow of a bodily fluid. A heating element externally coupled to the flow tube is configured to dissipate heat at a predetermined rate over a predetermined amount of time. A temperature sensor externally coupled to the heating element is configured to measure a temperature rise of the heating element over the predetermined amount of time. An implant microcontroller coupled to the temperature sensor is configured to determine the flow rate of the bodily fluid in the flow tube from the measured temperature rise of the heating element over the predetermined amount of time and a curve fit to a stored set of previously obtained calibration measurements. An implant power and
communication subsystem coupled to the implant microcontroller is configured to wirelessly receive power and wirelessly transmit and receive data.
The system also includes an external device having an external
microcontroller and an external power and communication subsystem coupled to the external microcontroller configured to wirelessly deliver power to the implant power and communication subsystem and transmit and receive data to and from the implant power and communication subsystem.
In one embodiment, the temperature sensor may include a thermistor or a resistance temperature detector (RTD). The thermistor may be configured as both the temperature sensor and the heating element. The temperature sensor may include a thermocouple. The heating element may include a surface mount resistor. The heating element may include a coil of electrically conductive wire or a printed circuit heater. The heating element may be directly attached to the external surface of the flow tube. The system may include a thermal insulator configured to thermally isolate the heating element and the temperature sensor from cooling paths other than the direct cooling path to the bodily fluid in the flow tube. The thermal insulator may include an insulation layer over the heating element and the temperature sensor. The thermal insulator may include a sealed volume of air surrounding the heating element and the temperature sensor. The flow through flow tube may be comprised of a thin wall of polymer material with low thermal conductivity configured to limit heat transfer along a length and a circumference of the tube while maintaining heat transfer in a radial direction to the fluid. The bodily fluid may include one or more of:
cerebrospinal fluid (CSF), bile, blood, and urine. The encapsulated implant may be coupled to a shunt, tube, vessel or catheter implanted in a human body or an animal. The shunt may include one or more of: a ventriculo-peritoneal (VP) shunt,
ventroarterial shunt, and lumboperitoneal shunt. The encapsulated implant may be coupled to a distal catheter of the shunt. The encapsulated implant may be coupled to a proximal catheter of the shunt. The heating element and the temperature sensor may be located proximate the outlet. The heating element and the temperature sensor may be located proximate the inlet. The heating element and the temperature sensor may be located between the inlet and the outlet. The external power and communication subsystem includes an external coil coupled to the external microcontroller and the implant power and communication subsystem includes an implant coil coupled to the microcontroller. The implant coil of the encapsulated implant may be located using the magnitude of the induced voltage wirelessly sent from the implant coil to the external coil. The external coil may be positioned proximate and in alignment with the implant coil to achieve sufficient inductive coupling between the external coil and the implant coil. The external coil may be remotely located from and tethered to the external power and communication subsystem. The implant coil may be integrated .
6
with the encapsulated implant. The implant coil may be remotely located from and tethered to the encapsulated implant. The external power and communication subsystem may include a resonant circuit comprised of the external coil and a capacitor, and a source of low-level voltage pulses, the external device resonant circuit configured to provide sinusoidal current in the external coil of sufficient amplitude to induce sufficient sinusoidal voltage in the implant coil. The implant power and communication subsystem may include an implant resonant circuit comprised of the implant coil and a capacitor having a resonance frequency closely matched to the resonance frequency of the external resonant circuit to maintain sufficient AC voltage amplitude to power the implant power and communication subsystem and to enable communication between the external power and
communication subsystem and implant power and communication subsystem. The implant power and communication subsystem may be configured to convert induced sinusoidal voltages in the implant coil to a highly regulated DC voltage over the range of loading conditions to power the heating element, the temperature sensor, the microcontroller, and components of the implant power and communication subsystem. The external power communication subsystem may be configured to enable the external microcontroller to communicate data to the implant power and
communication subsystem by changing the voltage supplied to the resonant circuit of the extemal power and communication subsystem to modulate the amplitude of the voltage induced in the implant coil and use that change in voltage to represent different binary states. The implant power and communication subsystem may transmit binary values serially to the external power and communication subsystem by sequentially applying and removing an electrical load from the implant coil to induce changes in voltage in the external coil that are decoded into data by the external microcontroller. The external power and communication subsystem may include a sense resistor configured to measure change in the amplitude of the current in external power and communication subsystem resulting from changes in the induced voltage in the external coil. The external microcontroller may be coupled to the series resistor and may be configured to decode changes in the current of the external power and communication subsystem into data. The implant microcontroller may be configured to store the set of previously obtained calibration measurements relating heating element temperature rise to flow rate. The implant microcontroller may be configured to determine the flow rate from the measured temperature rise when temperature of the heating element is determined to be no longer rising to minimize the length of time needed to determine the flow rate, the amount of heat generated by the heating device, and the amount of heat delivered to a patient. The implant microcontroller may be configured to store identification information associated with the encapsulated implant. The implant microcontroller may be configured to use the mean value of a set of temperature rise samples obtained over the predetermined amount of time as the temperature rises to determine the flow rate of the bodily fluid in order to increase the signal to noise ratio. The implant microcontroller may be configured to use a weighted average of a set of temperature rise samples obtained over a predetermined amount of time as the temperature rises to determine the flow rate of the bodily fluid in order to increase the signal to noise ratio. The
encapsulated implant may be implanted in a human body. The external device may include a smart device including a flow sensor App and a tethered external coil. The external device may include a display for displaying one or more of: the measured flow rate, the predetermined amount of time, induced voltage on the implant coil, and identification information associated with the encapsulated implant.
In another aspect, a flow rate sensor system for non-invasively measuring the flow rate of a bodily fluid is featured. The system includes an encapsulated implant having a flow tube having an inlet and an outlet configured to receive a flow of a bodily fluid. A heating element externally coupled to the flow tube is configured to . dissipate heat at a predetermined rate over a predetermined temperature rise of the heating element. A temperature sensor externally coupled to the heating element is configured to measure a temperature drop of the heating element over a
predetermined amount of time of cooling. An implant microcontroller coupled to the temperature sensor is configured to determine the flow rate of the bodily fluid in the flow tube from the measured temperature drop of the heating element over the predetermined amount of cooling time and a curve fit to a stored set of previously obtained calibration measurements. An implant power and communication subsystem coupled to the implant microcontroller is configured to wirelessly receive power and wirelessly transmit and receive data. The system also includes an external device having an external microcontroller, and an external power and communication subsystem coupled to the external microcontroller configured to wirelessly deliver power to the implant power and communication subsystem and transmit and receive data to and from the implant power and communication subsystem.
In another aspect, a flow rate sensor system for non-invasively measuring the flow rate of a bodily fluid is featured. The system includes an encapsulated implant having a heating element externally coupled to a shunt, catheter, tube, or vessel configured to receive a flow of a bodily fluid, the heating element configured to dissipate heat at a predetermined rate over a predetermined amount of time. A temperature sensor externally coupled to the heating element is configured to measure a temperature rise of the heating element over the predetermined amount of time. An implant microcontroller coupled to the temperature sensor is configured to determine the flow rate of the bodily fluid in the shunt, catheter, tube or vessel from the measured temperature rise of the heating element over the predetermined amount of time and a curve fit to a stored set of previously obtained calibration measurements. An implant power and communication subsystem coupled to the implant
microcontroller is configured to wirelessly receive power and wirelessly transmit and receive data. The system also includes an external device having an external microcontroller and an external power and communication subsystem coupled to the external microcontroller configured to wirelessly deliver power to the implant power and communication subsystem and transmit and receive data to and from the implant power and communication subsystem.
In one embodiment, the encapsulated implant may be configured as a two- piece clamp externally coupled to the shunt, catheter, tube, or vessel.
In another aspect, a flow rate sensor system for non-invasively measuring the flow rate of a bodily fluid is featured. The system includes an encapsulated implant having a heating element externally coupled to the shunt, catheter, tube, or vessel configured to receive a flow of a bodily fluid, the heating element configured to dissipate heat at a predetermined rate over a predetermined temperature rise of heating element. A temperature sensor externally coupled to the heating element is configured to measure a temperature drop of the heating element over a
predetermined amount of time of cooling. An implant microcontroller coupled to the temperature sensor is configured to determine the flow rate of the bodily fluid in the shunt, catheter, tube or vessel from the measured temperature drop of the heating element over the predetermined amount of cooling time and a curve fit to a stored set of previously obtained calibration measurements. An implant power and
communication subsystem coupled to the implant microcontroller is configured to „„
10
wirelessly receive power and wirelessly transmit and receive data. The system also includes an external device having an external microcontroller and an external power and communication subsystem coupled to the external microcontroller configured to wirelessly deliver power to the implant power and communication subsystem and transmit and receive data to and from the implant power and communication subsystem.
In one embodiment, the encapsulated implant may be configured as a two- piece clamp externally coupled to the shunt, catheter, tube, or vessel.
In another aspect, a method for non-invasively measuring the flow rate of a bodily fluid is featured. The method includes providing an encapsulated implant coupled to a shunt, catheter, tube or vessel, receiving a flow of a bodily fluid in the shunt, catheter, tube or vessel, externally coupling a heating element to the shunt, catheter, tube or vessel configured to dissipate heat at a predetermined rate over a predetermined amount of time, externally coupling a temperature sensor to the heating element, measuring a temperature rise of the heating element over a predetermined amount of time, determining the flow rate of the bodily fluid in the shunt, catheter, tube or vessel from the measured temperature rise and a curve fit to a stored set of previously obtained calibration measurements, providing an external device, wirelessly delivering power to the encapsulated implant, and wirelessly transmitting and receiving data to and from the encapsulated implant.
In one embodiment, the method may include thermally isolating the heating element and the temperature sensor. The method may further include locating the encapsulated implant using data wirelessly sent from the encapsulated implant to the external device. The method may further include positioning an external coil of the external device proximate and in alignment with an implant coil of the encapsulated Λ Λ
11
implant to provide sufficient inductive coupling between an external coil of the external device and an implant coil. The method may include storing on a
microcontroller of the encapsulated implant the set of previously obtained calibration measurements of heat dissipation. The method may include storing on a microcontroller of the encapsulated implant identification information associated with the encapsulated implant. The method may include determining the flow rate from a current measured temperature rise up when the temperature of the heating element is determined to be no longer rising to minimize the length of time needed to determine the flow rate, the amount of heat generated by the heating device, and the amount of heat delivered to a patient.
In another aspect a method for non-invasively measuring the flow rate of a bodily fluid is featured. The method includes providing an encapsulated implant coupled to a shunt, catheter, tube or vessel, receiving a flow of a bodily fluid in the a shunt, catheter, tube or vessel, externally coupling a heating element to the shunt, catheter, tube or vessel configured to dissipate heat until a predetermined rate temperature rise is achieved, externally coupling a temperature sensor to the heating element, measuring a temperature drop of the heating element over a predetermined amount of time of cooling, determining the flow rate of the bodily fluid in the flow tube from the measured temperature drop and a curve fit to a set of previously obtained calibration measurements, providing an external device, wirelessly delivering power from the external device to the encapsulated implant, and wirelessly transmitting and receiving data to and from the encapsulated implant and the external device.
BRIEF DESCRIPTION OF THE SEVERAL VIEWS OF THE DRAWINGS „„
12
Other objects, features and advantages will occur to those skilled in the art from the following description of a preferred embodiment and the accompanying drawings, in which:
Fig. 1 is a perspective side view showing the primary components of one embodiment of the flow rate sensor system and method thereof for non-invasively measuring the flow rate of a bodily fluid through a shunt implanted in a patient.
Fig. 2 is a top- view showing in further detail one embodiment of the encapsulated implant shown in Fig. 1 ;
Fig. 3 is a top- view of the encapsulated implant shown in Fig. 2 without the encapsulant thereon;
Fig. 4 is a schematic end-view showing in further detail one example of the placement of the heating element and temperature sensor about the flow tube shown in Figs. 2 and 3;
Fig. 5 is a graph depicting one example of a stored set of previously obtained calibration measurements showing a relationship between the temperature rise of the heating element and the flow rate of the bodily fluid used by the encapsulated implant 12 shown in one or more of Figs. 1-3;
Fig. 6 is a graph depicting one example of a curve fit to the previously obtained calibration measurements shown in Fig. 5;
Fig. 7 is a graph showing one example of the flow rate measured by the encapsulated implant shown in one or more of Figs. 1 -3 compared to the actual flow rate imposed by a syringe pump;
Fig. 8 is a graph depicting another example of a stored set of previously obtained calibration measurements showing a relationship between the temperature drop of a heating element and the flow rate of the bodily fluid used by the ,
13
encapsulated implant 12 shown in one or more of Figs. 1-3;
Fig. 9 is a graph depicting one example of a curve fit to the previously obtained calibration measurements shown in Fig. 8;
Fig. 10 is a schematic block diagram showing one embodiment of the primary components of the implant power and communication subsystem of the encapsulated implant shown in one or more of Figs. 1-3;
Fig. 11 is a schematic block diagram showing one embodiment of the primary components of the external power and communication subsystem of the external device shown in Fig. 1 ;
Fig. 12 shows an example of a resistance temperature detector (RTD) which may be used for the temperature sensor shown in at least Figs. 3, 4, and 10;
Fig. 13 shows an example of a thermocouple which may be used for the temperature sensor shown in at least Figs. 3, 4, and 10;
Fig. 14 shows an example of the heating element configured as a coil of electrically conductive wire;
Fig. 15 shows an example of the heating element configured as a printed circuit heater a resistor;
Figs. 16-17 show examples of the heating element configured as a resistor;
Fig. 18 is a schematic end-view showing one example of an insulation layer which may be placed about the heating element and temperature sensor shown in at least Figs. 3, 4, and 10;
Fig. 19 is a schematic end-view showing an example of an insulation layer of sealed air surrounding the heating element and temperature sensor shown in Figs. 3, 4, and 10;
Fig. 20 is a three-dimensional view showing in further detail the insulation layer of sealed air surrounding the heating element and temperature sensor shown in Fig. 19;
Fig. 21 is a front side-view showing one example of the primary components of a VP shunt and various locations of the encapsulated implant on a ventricular catheter or a distal catheter;
Fig. 22 is a side-view showing in further detail one example of the primary components of the flow rate sensor system shown in one or more of Figs. 1-19;
Fig. 23 is a front side-view showing in further detail one example of the alignment of the implant coil shown in at least Figs. 2, 3, and 10 with the external coil of the external power and communication subsystem shown in at least Figs. 1 and 22;
Fig. 24 is a schematic diagram showing one example of the implant coil separately located from the encapsulated implant; and
Fig. 25 is a three-dimensional front-view showing the primary components of another embodiment of the flow rate sensor system for non-invasively measuring the flow rate of a bodily fluid through a shunt catheter, tube or vessel.
DETAILED DESCRIPTION OF THE INVENTION
Aside from the preferred embodiment or embodiments disclosed below, this invention is capable of other embodiments and of being practiced or being carried out in various ways. Thus, it is to be understood that the invention is not limited in its application to the details of construction and the arrangements of components set forth in the following description or illustrated in the drawings. If only one embodiment is described herein, the claims hereof are not to be limited to that embodiment.
Moreover, the claims hereof are not to be read restrictively unless there is clear and convincing evidence manifesting a certain exclusion, restriction, or disclaimer. ,.
15
There is shown in Fig. 1 one embodiment of system 10 and the method thereof for non-invasively measuring the flow rate of a bodily fluid. System 10 includes encapsulated implant 12 and external device 14. In the example shown in Fig. 1 , encapsulated implant 12 is implanted into human body 15 and is coupled to ventricular or proximal catheter 16 of VP shunt 18. In other examples, encapsulated implant 12 (shown in phantom) may be coupled to distal catheter 20 of VP shunt 18, indicated at 25. However, encapsulated implant 12 need not necessarily be coupled in-line to VP shunt 18 as shown and may be externally coupled over any type catheter, shunt, tube, vessel and the like, which is implanted in the human body or the body of an animal and has a flow of bodily fluid there through, as discussed in further detail below.
In this example, encapsulated implant 12, Fig. 2, includes flow tube 22 having inlet 24 and outlet 26 configured to receive flow of bodily fluid 28. Flow of bodily fluid 28 may include CSF, blood, bile, urine, or other bodily fluid. Encapsulated implant 12 includes encapsulant 30, e.g., a medical grade polyurethane such as Steralloy FDF 2380 (Hapco, Inc. Hanover, MA 02339), silicone, or other biocompatible materials. Encapsulated implant 12, Fig. 3, where like parts have been given like numbers, shown without encapsulant 30 for clarity, also includes heating element 32 externally coupled to flow tube 22 and temperature sensor 34 externally coupled to heating element 32. Fig. 4 shows in further detail one example of heating element 32 directly and externally coupled to external surface 23 of flow tube 22 and temperature sensor 34 externally coupled to heating element 32. In one embodiment, heating element 32, Figs. 3 and 4, is configured to dissipate heat at a predetermined rate over a predetermined amount of time. In this example, temperature sensor 34 is configured to measure the temperature rise of heating element 32 over a ,.
16
predetermined amount of time, e.g., 10 seconds, 20 seconds, 30 seconds, and the like, as discussed in further detail below.
Encapsulated implant 12, Fig. 3, also includes implant microcontroller 35, preferably coupled to printed circuit board (PCB) 55, configured to determine the flow rate of flow of bodily fluid 28 in flow tube 22 from the temperature rise of heating element 32 over the predetermined amount of time and a curve fit to a stored set of previously obtained calibration measurements. The stored set of previously obtained calibration measurements include measurements of the temperature rises of same heating element 32 and associated imposed flow rates over the same
predetermined amount of time and level of heat dissipation. The store set of previously obtained calibration measurements are preferably stored by implant microcontroller 35.
In one example, the stored set of previously obtained calibration
measurements shown by data points 40, Fig. 5, may be created by a user request using external device 14, Fig. 1. The stored set of previously obtained measurements may be created by applying a regulated DC voltage to heating element 32, Figs. 3 and 4, that produces a repeatable heat dissipation level from the heating element 32 each time the regulated DC voltage is applied, discussed in further detail below. The resulting heat created within heating element 32 causes a rise in temperature of the heating element 32 over the same predetermined amount of time, e.g., 5, 10, 15, 20, 30, or 40 seconds, or similar time intervals, as that used for the flow rate
measurement. The rise in temperature of heating element 32 is measured by temperature sensor 34 over the predetermined amount of time, while heating element 32 is turned on and dissipating heat. In order to accurately obtain the temperature rise of temperature sensor 34 and heating element 32, temperature measurements are „
17
recorded for a few seconds prior to turning on heating element 32. The average of these temperature measurements may serve as a baseline temperature that can be subtracted from the temperature measurements taken after heating element 32 is turned on.
To create the stored set of previously obtained calibration measurements, the resulting temperature rise over the predetermined amount of time is preferably matched to the imposed flow rate, and two values are stored in the memory of the implant microcontroller 35 as the stored set of calibration measurements. In one design, rather than store only one value of temperature rise for calibration, multiple values of temperature rise versus flow rate over the predetermined amount time and rate of heat dissipation may be stored.
In one example, a pump capable of accurately delivering a known desired flow rate, such as a well-calibrated syringe pump may be used to create the stored calibrated measurement. The stored set of calibrated flow rate measurements may be obtained in this manner at each of multiple flow rate settings over the known range of feasible bodily fluid flow rates through flow tube 22, e.g., from about 0 to about 40 mL/hr.
The number of calibration values for the stored set of calibrated flow rate measurements is preferably sufficient to characterize a curve of the rise in temperature of heating element 32 as a function of flow rate, e.g., data points 40, Fig. 5. The heat dissipation from heating element 32, Figs. 3 and 4, need not be precisely known, but is preferably repeatable each time heating element 32 and encapsulated implant 12, Figs. 1 -3, is activated.
In operation, a regulated DC voltage is applied to heating element 32 and the temperature rise of heating element 32 is sensed by temperature sensor 34 and „„
18
recorded by implant microcontroller 35. Curve fitting is preferably applied to the stored set preferably previously obtained calibration measurements of temperature rise versus flow rate to derive a continuous relationship between measured temperature rise and flow rate, as shown by curve 41, Fig. 6. From curve 41 and the measured temperature rise, the flow rate of flow of bodily fluid 28, Fig. 3, through flow tube 22 over the duration of the measurement is inferred.
Curve fitting is a well understood process of creating a curve or a continuous mathematical function that closely fits a series of data points. For determination of flow rate, curve fitting can involve either interpolation between calibration data points of measured temperature rises versus flow rates, or the determination of a smooth mathematical function that fits all the data points 40, Fig. 5, to a good approximation. Curve 41 , Fig. 6, shows one example of curve fitting in which linear extrapolation is employed between each of the adjacent data points 40 shown in Fig. 5.
Plot 49, Fig. 7, shows one example of the flow rates measured by encapsulated implant 12, indicated at 51 , compared to actual known flow rates imposed by a calibrated syringe pump, indicated at 53. As can be seen, encapsulated implant 12, Figs. 1 -3, accurately determined the flow rate of flow of bodily fluid 28 in flow tube 22.
If the implant microcontroller 35 determines that the temperature of heating element 32 is no longer rising (i.e. that steady state has been reach), then implant microcontroller 35 can terminate the measurement since it has already acquired a sufficient number of temperature values from temperature sensor 34 to determine the flow rate. This can reduce the predetermined amount of time needed to determine the flow rate of flow of bodily fluid 28, e.g., to between about 5 to 10 seconds and minimize the amount of heat needed to be generated by heating element 32. The dependence of the temperature rise of heating element 32 over the duration of a flow rate measurement by encapsulated implant 12 rate arises from the flow rate of flow of bodily fluid 28, Fig. 2, and the heat transfer coefficient for heat transfer from heating element 32 into flow of bodily fluid 28 inside tube 22 in accordance with formula:
h = Q/(AAT) (1) where Q is the heat dissipated by the heating element 32, A is the area of heat transfer, and ΔΤ is the difference in temperatures between heating element 32 and bodily fluid 28 flowing in tube 22. The heat transfer coefficient h increases monotonically with flow rate, at least over the range of CSF flow rates possible within a shunt. Therefore, since the level of heat dissipation Q produced by the heating element is fixed for a given applied DC voltage, the temperature rise of heating element 32 during a flow rate measurement will decrease with increasing CSF flow rate.
Flow rate sensor system 10, shown in one or more of Figs. 1-4, may also be used to determine flow rate by measuring the temperature drop of heating element 32 after it is allowed to cool for a predetermined amount of time, e.g., 5, 10, 20, 30 seconds, and the like, after the heating element 32 has been previously heated until a predetermined temperature rise is achieved, e.g., 2, 3, 4 °C, and the like. The measured temperature drop is then compared with a set of previously obtained calibration measurements in which temperature drops were measured and stored after heating element 32 was first heated to the same temperature rise and then turned off for the same predetermined amount of time, while precisely known flow rates were imposed. Similarly, as discussed above with reference to Figs. 5 and 6, a curve fit or interpolation may be used to estimate flow rate from the stored set of previously _
20
obtained calibration measurements. For example, a flow rate may be determined by first turning on heating element 32 and allowing it to continue to warm up until implant microcontroller 35, Fig. 3, detects a predetermined rise in temperature has been achieved, e.g., about 3°C. At this point heating element 32 is turned off and allowed to cool for a predetermined period of time e.g., 5, 10, 15 seconds, and the like. During the cooling of heating element 32, the temperature drop of heating element 32 over a predetermined amount of time will depend on the flow rate of bodily fluid 28 in tube 22, since the rate of cooling of heating element 32 depends on the flow rate of bodily fluid 28. In particular, the rate of cooling will increase as the flow rate of bodily fluid 28 increases, and, therefore, the temperature drop of heating element 32 over a predetermined amount of time of cooling will also increase as flow rate of bodily fluid 28 increases. In this example, implant microcontroller 35 is configured to determine the flow rate of the bodily fluid in the flow tube from the measured temperature drop of the heating element 32 and curve fit to a stored set of previously obtained calibration measurements having a relationship between temperature drop of heating element and flow rate of bodily fluid established similar as described above. In this example, data points 57, Fig. 8, is utilized instead of data points 40, Fig. 5 described above. Curve-fitting or interpolation is preferably applied to the set of previously obtained calibration measurements shown in Fig. 8 in order to infer the flow rate through tube 22 over the duration of the measurement, e.g. as shown by curve 59, Fig. 9.
Encapsulated implant, Figs. 1-3, also includes implant power and
communication subsystem 50, Fig. 10, preferably formed on printed circuit board 55, Fig. 3. Implant power and communication subsystem 50, Fig. 10, is configured to wirelessly receive power and transmit and receive data. External device 14, Fig. 1 , of system 10 also includes external microcontroller 56, Fig. 1 1, and external power and communication subsystem 58 coupled to external microcontroller 56 configured to wirelessly deliver power to implant power and communication subsystem 50, Fig. 10, and wirelessly transmit and receive data to and from implant power and communication subsystem 50 of encapsulated implant 12, Figs. 1 -3, as discussed in further detail below.
In one example, temperature sensor 34, Figs. 3 and 4, includes a thermistor, e.g., thermistor 34' as shown in Fig. 10. In other designs, temperature sensor 34 may be a resistance temperature detector (RTD), e.g. RTD 102, Fig. 12, or a thermocouple, e.g., thermocouple 104, Fig. 13. In other examples, heating element 32 may be a coil of electrically conductive wire wound around the flow tube 22, e.g., coil 106, Fig. 14, of electrically conductive wire. In another design, heating element 32 may be a printed circuit heater, e.g., printed circuit heater 108, Fig. 15. In yet another design, heating element 32 may be a resistor (either surface mount or leaded), e.g. resistor 1 10, Fig. 16, or any of resistors 1 12, Fig. 17.
Preferably, heating element 32, Figs. 3 and 4, is directly attached to flow tube 22 as shown in Fig. 4. The rise in temperature of the heating element 32 over the predetermined amount of time or the temperature drop over the predetermined amount of time of cooling represents the 'signal' employed during a flow rate measurement to determine flow rate. The signal may be increased by thermally isolating the heating element 32 from heat transfer paths other than conduction/convection to the flow of bodily fluid 28, Fig. 3, flowing through the flow tube 22. In one design, encapsulated implant 12 includes thermal insulator 70, Fig. 18, which preferably covers heating element 32 and temperature sensor 34 as shown to thermally isolate heating element 32 and temperature sensor 34 from heat transfer paths other than „„
22
conduction/convection to the flow of bodily fluid 28, Fig. 3. Thermal insulator 70 may also surround all of flow tube 22, as shown by thermal insulator 70' in phantom. In other examples, insulation layer 70", Fig. 19, may be a pocket of sealed air created by surrounding flow tube 22 with hollow tube 78. Fig. 20, where like parts have been given like numbers, shows in further detail insulation layer 70" of sealed air and hollow tube 78 surrounding heating element 32 and temperature sensor 34 and flow tube 22.
In one example, flow tube 22, Figs. 3, 4, 18-20, may be made of a thin walled polymer material with low thermal conductivity, such as polyimide or similar type material, to limit heat transfer along the length and circumference of flow tube 22 while maintaining heat transfer in the radial direction to the bodily fluid in tube 22 made viable by the thin wall thickness of the tube.
As discussed above, encapsulated implant 12, Fig. 1 , may be coupled to VP shunt 18, e.g., to distal catheter 20 of VP shunt 18 or proximal catheter 16. Fig. 21 shows in further detail one example of the structure of VP shunt 18 with distal catheter 20 and proximal or ventricular catheter 16. Encapsulated implant 12 may be located at any position on ventricular catheter 16 or distal catheter 20 as shown. In other examples, encapsulated implant may be coupled to shunt, catheter, tube, or vessel implanted in the body, such as a ventroarterial shunt or a lumboperitoneal shunt.
In the example shown in Figs. 2 and 3, heating element 32 and temperature sensor 34 are shown located proximate outlet 26. In other examples, heating element 32 and temperature sensor 34 may be located proximate inlet 24 indicated at 80, Figs. 3, or between inlet 24, and outlet 26, as indicated at 82.
External power and communication subsystem 58, Fig. 1 1, of external device 14, Fig. 1 , includes external coil 90, Fig. 1 1 coupled to microcontroller 56. Fig. 22, where like parts have been given like numbers, shows in further detail one example of external coil 90 of external device 14 shown placed in close proximity to implant coil 52 of encapsulated implant 12. As shown, implant coil 52 is integrated with encapsulated implant 12, as depicted in further detail in Fig. 3. External power and communication subsystem 58, Fig. 1 1, is configured to inductively transfer power from external coil 90, Figs. 1 1 and 22, to implant coil 52, Figs. 3 and 22, of implant power and communication subsystem 50, Fig. 10.
It is well known that the presence of a time-varying current in one coil will induce a voltage in a nearby second coil. This principle is employed by system 10 for non-invasively measuring the flow rate of a bodily fluid to enable wireless power transfer and communication between external device 14 and encapsulated implant 12. The voltage (V2) induced in the implant coil 52 by external coil 90 may be shown by the equation:
V2 (t) = M (dli/dt)
(2)
where M is the mutual inductance between the implant coil 52 and external coil 90 and Ii (t) is the current in the external coil 90. If the current in the external coil 90 coil is sinusoidally-varying in time at a frequency ω = 2nf, where /is the frequency in Hertz, then:
V2 = coMIi, (3) where and Ii are the amplitude of the voltage induced in implant coil 52 and the amplitude of the current in the external coil 90, respectively. Likewise, if the current in the implant coil is time-varying, a voltage is induced in external coil 90 given by:
(4) where Vj and are the amplitude of the voltage induced in the external coil 90 and the amplitude of the current in external coil 90, respectively
The mutual inductance depends both on the self-inductances of the coupled external coil 90 (Li) and implant coil 52 (L2) coils and the coupling coefficient (Kc) between them:
M = Kc (L,L2)1/2, (5) where Kc depends on relative orientation, lateral alignment and proximity of the external coil 90 and implant coil 52. The self-inductance of the external coil 90 (Lt) is preferably set such that the source voltage 132, Fig. 1 1, of the external power and communication subsystem 58 is at a convenient and safe level, whereas the self- inductance of implant coil 52 (L2) and the coupling coefficient (Kc) are preferably sufficient such that the induced voltage (after rectification and filtering) on implant power and communication subsystem 50, Fig. 10, of encapsulated implant 12 is high enough to meet the input voltage specifications of the DC-DC converter 208, Fig. 10, that provides the regulated DC voltage necessary to operate the implant
microcontroller 35, heating element 32, temperature sensor 34 and other various electronic components of encapsulated implant 12, Fig. 3, e.g., printed circuit board (PCB) 55 and the various electronics thereon.
External power and communication subsystem 58, Fig. 1 1 , preferably includes external resonance circuit 92 comprised of external coil 90, and capacitor 94, and source voltage 132 generated by a half bridge driver 103 or by other equivalent device known to those skilled in the art. The external power and communication subsystem 58 is preferably configured to generate AC current flow at a predetermined resonance frequency in external coil 90, in order to induce sinusoidal voltage signals in implant coil 52, shown in at least Figs. 10 and 22. In one example, resonant circuit 92, Fig. 1 1 , and analog electronics 96 filter and amplify changes in the voltage drop across current sense resistor 98 in order to recover data communications bits transmitted from implant power and
communication subsystem 50, Fig. 10, of encapsulated implant 12. Half-bridge driver circuit 103, Fig. 1 1, with a dedicated controller and two MOSFETs (not shown) may be used to drive external coil 90. External coil 90 in combination with series capacitor 94 preferably forms a resonant circuit with a predetermined resonant frequency, e.g., 100 kHz. In one example, a 100 kHz square wave generated by external microcontroller 56 may be applied to half-bridge driver circuit 103 to create a sinusoidal current flow through the external coil 90. The frequency may be adjusted to produce the closest match between resonant circuit 92 and resonant circuit 200, Fig. 10, of implant power and communication subsystem 50, as discussed below. The voltage drop across sense resistor 98, Fig. 1 1, may be used to monitor the current through external coil 90. The voltage across sense resistor 98 is preferably converted to DC by AC-DC rectifier 120 and filtered by filter 122 and peak detector 124 to remove the 100 kHz signal. The difference between the peak voltage and the filtered voltage is then amplified by amplifier 126, converted to digital signal levels and fed to external microcontroller 56 for decoding of the digital data transmitted by the implant power and communication subsystem 50, Fig. 10 of encapsulated implant 12. In order to provide communications as well as power, external power and
communication subsystem 58, Fig. 1 1 , of external device 14 can modulate the square wave signal delivered to half-bridge driver 103 to encode information. The implant power and communication system 50, Fig. 10, can decode the modulation in order to recover the data being transmitted.
The inductance of external coil 90, Fig. 1 1 , and capacitor 94 create a resonant frequency in accordance with the formula:
fn = V[2n(LC)m] (6) where L is the inductance of external coil 90 and C is the capacitance of capacitor 94. At this frequency, the reactive impedance of capacitor 94 cancels out the reactive impedance of external coil 90, and in the vicinity of this frequency, both the reactance and overall impedance of the external power and communication subsystem 58, Fig. 1 1, of external device 14 are greatly reduced.
The use of resonance frequency may be beneficial because square-wave pulses, which are conveniently produced by half bridge driver 103 or other AC voltage source known to those skilled in the art, give rise to sinusoidally-varying current in external power and communication subsystem 58. Further, the impedance of series resonant circuit 92 is a minimum at resonance, which maximizes the current for a given applied voltage, thereby lowering the voltages to levels as may be found in a common battery or USB interface, e.g., interface port 140. In addition, since the current through external coil 90 varies with the applied square wave frequency, the power delivered to the external coil 90 can be easily tuned by changing the square wave frequency. The value of capacitor 94 is preferably chosen such that the capacitor 94 and external coil 90 resonate at a desirable frequency. The choice of resonant frequency may include, inter alia, the available space for external coil 90, frequency-dependent coil losses, skin effect, FCC regulations, guidelines regarding patient exposure to electromagnetic fields, and the like. Preferably, resonant circuit 92 is driven by a square wave source voltage 132, with its frequency set at or near the resonant frequency of resonant circuit 92. This results in a sinusoidally-varying current in the external power and communication subsystem 58 at the frequency of the voltage source pulses. This current gives rise to a magnetic field in the space surrounding external coil 90. A fraction of the field lines of this magnetic field are inductively linked to implant coil 52, Fig. 10, thereby inducing sinusoidally- varying voltage in implant coil 52.
Implant power and communication subsystem 50, Fig. 10, of encapsulated implant 12 includes implant resonance circuit 200 comprised of implant coil 52 and capacitor 202. Implant resonance circuit 200 is preferably configured to have a resonance frequency matching the resonance frequency closely provided by resonance circuit 92, Fig. 1 1. The sinusoidally varying magnetic field generated by the sinusoidal current in external coil 90 links the implant coil 52 of resonant circuit 200. The resulting induced sinusoidally varying voltages in implant coil 52, Fig. 10, are then rectified by AC-DC rectifier 204 to create a DC voltage on line 206, which is applied to the input of DC-DC converter 208, which creates a constant regulated DC voltage on line 209. DC-DC power supply 208 provides power to implant
microcontroller 35, heating element 32, e.g., a thermistor, in this example, acting as temperature sensor 34, and other components on PCB 55, Fig. 3, of encapsulated implant 12, which may require power.
In one example, external device 14, Figs. 1 and 22, encodes digital data for communication with encapsulated implant 12, shown in one or more of Figs 1-3, 10 and 22, by changing the magnitude of the source voltage 132, Fig. 1 1, which gives rise to a corresponding change in current in external power and communication subsystem 58, which, in turn, gives rise to a change in the amplitude of the voltage induced on implant coil 52. Implant microcontroller 35 preferably monitors the voltage at the output of the AC-DC rectifier 204 by receive filter 212, in order to decode digital data sent from external power and communication subsystem 58 of external device 14. „„
28
Implant power and communication subsystem 50, Fig. 10, of encapsulated implant 12, Figs. 1-3, 10 and 22, preferably communicates to external power and communication subsystem 58, Fig. 1 1 , of external device 14, by modulating the electrical load on implant coil 52, by controlling the closure of a switch within the transmit driver 210, Fig. 10, coupled to the output of AC-DC rectifier 204. Closure of the transmit driver switch 210 gives rise to an abrupt increase in current in the implant coil 52 and AC-DC rectifier 204 of the implant power and communication subsystem 50, which, in turn, gives rise to a change in the induced voltage and current flow in external coil 90, and external power and communication subsystem 58. The voltage drop across the sense resistor 92 provides a means for monitoring the current flow in external power and communication subsystem 58 and external device 14 and thus provides a means for external microcontroller 56, onboard the external device 14, to decode the changes in current into digital data. The maximum rate of data transfer (i.e., baud rate) may be limited by the carrier frequency. In one example, at a carrier frequency of 100 kHz, a reasonable rate is 1200 baud.
Preferably, implant coil 52, Figs. 3, 10, and 22, and external coil 90, Figs. 1 1 and 22, are preferably placed in close proximity to each other, e.g., as shown in Fig. 22 and in further detail in Fig. 23 to provide sufficient inductive coupling between implant coil 52 and external coil 90 such that external power and communication subsystem 58 can wirelessly provide power to implant power and communication subsystem 50 and data can be wirelessly communicated to and from external power and communication subsystem 58 and implant power and communication subsystem 50, as discussed above.
In one embodiment, external coil 90 of external device 14 may be located relative to implant coil 52 of encapsulated implant 12 in human body 15, Fig. 1 , using 2g data wirelessly sent from implant power and communication subsystem 50 to external power and communication subsystem 58. For example, data communicated from implant power and communication subsystem 50 to external power and
communication subsystem 58 includes the magnitude of the induced voltage (after rectification and filtering) onboard implant power and communication subsystem 50 of encapsulated implant 12, which provides a means by which a user of system 10 can position external device 14 and external coil 90, e.g., as shown in Fig. 1 , relative to implant coil 52 of encapsulated implant 12 in human body 15. Preferably, the induced voltage onboard implant power and communication subsystem 50 is sufficient to both enable wireless communication and power transfer and to power the implant power and communication subsystem 50. Thus, the value of the induced voltage of implant coil 52 of implant power and communication subsystem 50 can be the basis for an intuitive, graphical display by external device 14 (discussed below) that enables the user to readily find an acceptable location for the external device 14 and to verify that sufficient coupling between implant coil 52 of encapsulated implant 12 and external coil 90 of external device 14 has been achieved for a calibration or flow measurement. Proper placement and orientation of external coil 90 of external device 14 and implant coil 52 of encapsulated implant 12 over the course of the flow rate measurement can be maintained by, inter alia, positioning and securing the external device 14 with apparel or by hand, such that the external coil 90 is positioned over implant coil 52, affixing the external coil 90 temporarily to the skin directly over the implant coil 52, e.g., using medical grade tape or adhesive, or longer term affixation, e.g., suturing, adhesive, of the external device 14 and external coil 90 to the skin over the encapsulated implant 12 for a period over which regular flow measurements will be needed. Preferably, implant microcontroller 35, Figs. 3 and 10, is configured to store the measured flow rate, the stored set of previously obtained calibration
measurements, e.g. as shown in Figs. 5 and 8, and identification information associated with the encapsulated implant 12, e.g., the serial number, model number, and the like, in a non-volatile manner.
In one example, external device 14, Fig. 22, includes display 290 which may display the measured flow, the previously obtained calibration measurements, the value of induced voltage on implant coil 52 or similar type measurements or values, and the identification information associated with encapsulated implant 12.
External device 14, Figs. 1, 1 1, and 20, may include interface port 140 coupled to external microcontroller 56 configured to connect to computer subsystem 62, Fig. 1 1 , by electrical cable 63. In another example, interface port 140 coupled to external microcontroller 56 may be configured to wirelessly connect computer subsystem 62. Interface port 140 coupled to external microcontroller 56 may also be configured to wirelessly connect to computer subsystem 62 configured as a smart device.
Although, as discussed thus far, implant coil 52, shown in one or more of Figs. 2, 3, 22 and 23, is shown integrated with encapsulated implant 12, this is not a necessary limitation of this invention. In other embodiments, implant coil 52, Fig. 24, where like parts have been given like numbers, may be located remotely from encapsulated implant 12 as shown and coupled to encapsulated implant 12 with wires 250.
Although, as discussed above with reference to one or more of Figs. 1-24 encapsulated implant 12 is shown having flow tube 22, Fig. 3, with inlet 24 and outlet 26 which receive flow of bodily fluid 28 in-line and heating element 32 and temperature sensor 34 and implant power and communication subsystem 50 are integrated in part of encapsulated implant 12, this is not a necessary limitation of this invention. In another embodiment, flow rate sensor system 10', Fig. 25, where like parts have been given like numbers, for non-invasively measuring the flow rate of a bodily fluid includes external device 14 with external power and communication subsystem 58, having the same design as discussed above with reference to at least Figs. 1 , 1 1 , and 20. However, in this embodiment, system 10', Fig. 25, includes encapsulated implant 12' that is clamped over a shunt, tube, vessel or catheter 250 implanted in a human body or animal body. Encapsulated implant 12' clamps over shunt, tube, vessel or catheter 250 using clamshell device 252 with clamping members 256 and 258 as shown. Encapsulated implant 12' includes heating element 32 and temperature sensor 34 and implant power and communication subsystem 50 having a similar structure as discussed above with reference to one or more of Figs. 1-24. In this design, heating element 32, Fig. 25, externally and directly couples to shunt, tube, vessel or catheter 250, and temperature sensor 34 is directly externally coupled to heating element 32, e.g., as shown in blow-out caption 264. System 10' operates similar to system 10, discussed above, with reference to one or more of Figs. 1-24.
External device 14, Figs. 1 , 22, and 25, may be a dedicated unit, designed for measuring the flow rate of a bodily fluid, or may be a smart device, such as a phone or tablet with an App and attached coil accessory similar to external coil 90 and wires connecting it to external device 14.
The result is flow rate sensor system 10 and the method thereof, shown in one or more of Figs. 1-25, that accurately and non-invasively measures the flow rate of a bodily fluid and provides a means of obtaining quantitative information on how a shunt, such as a VP shunt, or other similar type shunt, tube, vessel, or catheter, is functioning when implanted in a human or animal body. System 10 in some examples eliminate the need for obtaining cranial imaging using ultrasound, CT scanning, MRI, X-ray, and the like. Flow rate sensor system 10 can display or report the rate of flow of bodily fluids, such as CSF and other bodily fluids, and can be queried transcutaneously to allow the clinician to non-invasively assess shunt function during emergency room visits or during routine office visits. System 10 enables the primary care physician or specialist to see changes in the flow of bodily fluids over time and anticipate shunt failures prior to the development of symptoms. Thus, flow rate sensor system 10 and the method thereof enables timely intervention to maintain shunt function and reduce the likelihood of emergency shunt revision surgeries. Flow rate sensor system 10 and the method thereof can measure and monitor flow rate of bodily fluids in a patient with a shunt who arrives at the emergency room with symptoms possibly indicative of shunt failure and quickly and accurately provide the clinician with information regarding shunt function and, thus, can avoid unnecessary diagnostic or surgical procedures. The result is better care, reduced risk of death or injury from shunt failure, and reduced cost of care for those whose lives depend on continuous and proper function of their shunts.
External device 14 enables the clinician to obtain and store a "snapshot" of flow rate of CSF or other bodily fluids whenever needed. Because patient posture and orientation can affect flow through a shunt, the clinician can choose to place patient in various orientations and then take a flow rate measurement at selected orientations. The external device or external coil can be affixed to the patient to enable
automatically-initiated, periodic measurements and storage of the flow rates of bodily fluids, such as CSF, over an extended time period. This allows the clinician to see any trends in the flow characteristics of the shunt over a desired period of time. For example, CSF flow rate measurements could be automatically obtained every half hour to monitor shunt function, both in the hospital and after discharge, for the critical days following a shunt placement or a shunt revision surgery. In a second example, a CSF flow rate measurement could be taken every 5 minutes on a shunted patient who arrives at the emergency room with symptoms possibly indicative of shunt failure. This would give the clinician complete knowledge of the flow characteristics of the shunt, possibly preventing unnecessary diagnostic or surgical procedures, including MRI or CT imaging and shunt revisions.
For enablement purposes only, the following code portions are provided which can be executed on implant microcontroller 35 and external microcontroller 56 to carry out the primary steps and/or functions of flow rate sensor system 10 shown in one or more of Figs. 1-25 and recited in the claims hereof. Other equivalent algorithms and code can be designed by a software engineer and/or programmer skilled in the art, using the information provided herein.
IMPLANT CODE
* comm.c
*
* Created on: Feb 1, 2013
* Author: Tom
*/
#include <stdio. h>
ttinclude <stdlib . h>
ttinclude <string . h>
#include "main.h"
#include "comm. h"
#include "measure . h"
#include "uartl.h"
// List of all commands with a short description
const struct cmd__table commands [ ] =
{
"cal", "calibrate flow (ml/hr) ", do_calibrate } ,
"del", "delete cal table flow (ml/hr)", do_delCal}, "meas", "measure flow", do_meas},
"adc", "display ADC <loop count>", do_adc},
"zero", "zero ADCs", do_zero},
"exp", "set exp averaging", do_exp},
"up", "y = use upstream sensor", do_upstream} ,
"time", "set scan time <time> <interval>", do_time}, "heat", "0 = off, 1 = on", dojieat},
"com", "comm test off time (ms) ", do_comm}, "term", "comm echo test", do_term},
// "echo", "echo chars to remote", do_echo},
"info", "display settings", do_info},
"help", "this help screen", do_help},
"", "", NULL}
};
// UART selector 0 = UART0, 1 = UART1
uint8_t uartSelect = 0;
// I/O buffer is global so it can be shared and strtok can be called // from called function
char line [STRLEN] ;
// global buffer for dec to str conversions
char decstr [VSTRLEN] ;
const char delimf] = " ,\t";
const char null str[] = ""; cmdHandler: Processes commands received from USB
void cmdHandler (void)
{
char *cmd;
int i;
uartSelect = 0; // reset to uart 0
if (kbhitlO) uartSelect = 1; else if ( ! kbhit ( ) ) return;
getlnput (line, STRLEN) ;
cmd = strtok(line, delim);
// parse (line, cmd) ;
if (cmd != NULL)
{
for (i = 0; commands [ i ]. func != NULL; ++i)
{
if (strcmp (commands [i] . cmd, cmd) == 0)
{
// pass the first parameter to called function
// additional parameters can be fetched by calling strtok
(commands [i] . func) (strtok (NULL, delim) ) ;
break;
}
}
if (commands [i] . func == NULL && cmd[0] != ';') printf ( "Invalid command\r\n" ) ;
}
printf ("\r\nl> ") ;
}
//
// do_term: Send and receive characters from UART0 to UART1
// _
void do_term(char *word)
{
char ch;
while (1)
{
if (kbhitlO)
{
ch = getcharl ( ) ;
putchar ( ch) ;
}
if (kbhit ())
{
ch = getchar ( ) ;
if (ch == Oxlb) break;
putcharl (ch) ;
putchar (ch) ;
}
}
// flush buffers
if (kbhitlO) getcharl ();
if (kbhit ()) getchar ();
}
//
// do_comm: Comm test
//
void do_comm(char *word)
{
uintl6_t offtime = 0,ontime = 0;
if (word != NULL)
{
ontime = atoi (word) ; if (ontime == 0)
{
while (!kbhitOO && !kbhitlO)
{
putchar1 (word[0] ) ;
usdelay (offtime) ;
}
return;
}
}
word = strtok (NULL, delim) ;
if (word != NULL) offtime = atoi (word) ;
bic_SR_register (GIE) ; // Disable all interrupts
while (!kbhitOO && !kbhitlO)
{
TX2_O ( ) ;
usdelay ( ontime ) ;
TX2_OFF ( ) ;
usdelay (offtime) ;
}
bis_SR_register (GIE) ; // Enable all interrupts
}
getchar ( ) ;
}
//
// do_heat : Turns heater on or off
//
void do_heat (char *word)
{
if (word ! = NULL)
{
if (atoi (word) == 1) HEAT_ON ( ) ;
else HEAT_OFF() ;
}
}
//
// do_upstream: Enable or disable the upstream temperature sensor
// ' y' = upstream sensor is present
// ' n ' = no upstream sensor
//
void do_upstream (char *word)
{
if (word != NULL)
{
if (strchr (word, ' y' ) != NULL) fset.mode |= UPSTREAM;
else fset.mode &= -UPSTREAM;
printf ( "Sensor must be re-calibrated after changing raode\r\n") ;
}
}
//
// do_calibrate : Measure a flow and record calibration values
// Format: cal <flo'w rate> [<heater rise> <downstream rise]
// flow rate is in ml/hr, heater and downstream rise in degrees C
// void do_calibrate (char *word)
{
int i;
flowCal t new;
// If there are no arguments, list the cal table
if (word == NULL)
{
printf ( "\tFLOW\tHEAT\r\n" ) ;
for (i = 0; i < fset . calEntries; ++i)
{
printf ("cal\t%s\t" , decToStr (fset . cal [i] .flow) )
printf ("%s\r\n", decToStr ( fset . cal [ i ]. heat )) ;
printf ( "%s\r\n", decToStr ( fset . cal [ i ] .down) ) ;
}
return;
}
// Check to make sure there is room in the cal table
if (fset. calEntries >= MAX_CAL_TABLE)
{
printf ("Cal table is full - delete first\r\n" ) ;
return;
}
// Parse the flow rate and check that it is valid
new. flow = strToDec (word) ;
if. (new. flow < 0 | | new. flow > 9900)
{
printf ( "Invalid flow rate\r\n") ;
return;
}
// Parse for user entry of heat param of cal table
// If present, enter into table without performing a temp scan
// This allows the cal table to be restored from a saved file on the PC word = strtok (NULL, delim) ;
if (word != NULL)
{
new. heat = strToDec (word) ;
addCal (new) ;
}
// Perform a calibration by doing a temperature scan and then entering the
// results into the calibration table
else
{
scanReady ( ) ;
printf ("Set flow to %s ml/hr and press enter...",
decToStr (new. flow) ) ;
if (getchart) == Oxlb) return; // escape
printf ("\r\n") ;
calibrate (new. flow) ;
}
writeSettings ( ) ;
//
// do_delCal: Delete an entry in the calibration table
// Format: del <flow rate> (ml/hr)
//
void do delCal (char *word) {
intl6 t flowRate;
if (word != NULL)
flowRate = strToDec (word) ;
{
// if (flowRate == 0 && strchr (line, Ό ' ) == NULL) return;
delCal (flowRate) ;
writeSettings ( ) ;
}
// do_meas: Measure flow rate by doing a temperature scan and then computing
flow
// Format: meas
void do_meas ( char *word)
{
intl6 t flow;
scanReady ( ) ;
printf ( "Start flow and press enter...");
if (getchar() == Oxlb) return;
printf ("\r\n") ;
flow = measureFlow ( 1 ) ;
if (flow >= 0) printf ("\r\nFlow = %s ml/hr\r\n", decToStr ( flow) ) ;
//-
// do_zero: Zero the ADCs
// Format: zero
//
void do_zero(char *word)
{
zeroADC ( ) ;
printf ("ADCO = %d ADC1 = %d ■ ADC2 = %d\r\n",
(intl6_t ) ( fset . zero [0] /fset . exp) ,
(intl6_t ) (fset.zero[l]/fset. exp) ,
( int16_t ) (fset.zero[2]/fset. exp) ) ;
// do_adc: Display current ADC readings until key press
// if a parameter of c is specified, show ADC counts instead of temperature // Format: adc [c]
void do_adc(char *word)
{
int i, cnt = 0;
uintl6_t now, timeStamp = 0;
if (word != NULL) cnt = atoi (word) ;
if (cnt == 0) cnt = 32000;
if (cnt != 1) printf ("TIME\tUP\tHEAT\tVIN\r\n") ;
now = mslO;
while (!kbhitO && cnt != 0)
{
for (; cnt != 0 && ! kbhit ( ) ; —cnt)
{ 3g idle = tempEven ( ) ;
if (cnt != 1 I I timeStamp != 0) printf ( "%s\t " ,
declToStr (timeStamp) ) ;
for (i = 0; i < 2; ++i)
{
if (strchr (word, 'c') == NULL) printf("%s",
decToStr (chanTemp (i) ) ) ;
else printf ( "%d", chanADC (i) ) ;
putchar ( ' \t ' ) ;
}
printf ("%s\r\n",decToStr(inVoltage() ) ) ;
while (now - mslO < fset . interval* 10 ) ; // Wait for interval
timeStamp += fset . interval ; // Increment time stamp
if (timeStamp > 30000) timeStamp = 0; // in case of roll over
now += fset . interval*10; //
increment
for next interval
}
}
if (kbhitO) getcharO;
}
/*
// _ _
// do_chipTemp: Display the microcontroller chip temperature
// If a parameter is given, calibrate to that temperature
// Format: chip [<cal temperature>] (deg C)
/
void do_chipTemp ( char *word)
{
printf ("Chip Temp = %s\r\n", decToStr (chipTemp (strToDec (line) ))) ;
}
*/
/ „
// do_exp: Set the exponential moving average.
// Do not allow an exponent of zero or more than 1000
// Format: exp <exp factor>
// Note that l/<exp factor> is added into the moving average each sample
//
void do_exp(char *word)
{
intl6_t new = 0;
if (word != NULL)
{
new = atoi (word) ;
if (new > 0 && new <= 1000)
{
fset.zero[0] = ( fset . zero [ 0] * new) / fset.exp;
fset.zerofl] = ( fset . zero [ 1 ] * new) / fset.exp;
fset.zero[2] = ( fset . zero [ 2 ] * new) / fset.exp;
fset.exp = new;
writeSettings ( ) ;
}
else printf ( "Invalid exp factor\r\n" ) ;
}
// // do_time: Set the scan time from 1 to 3000 seconds. Optionally set
// the scan interval* for 0.1 to 100.0 seconds.
// Format: time <scan time> [<scan interval>] (seconds)
//
void do_time(char *word)
{
intl6_t value;
if (word != NULL)
{
value = atoi (word) ;
if (value > 0 && value < 3000) fset . scanTime = value; word = strtok (NULL, delim) ;
if (word ! = NULL)
{
value = strToDec (word) /10;
if (value > 0 && value <= 100) fset . interval = value;
}
writeSettings ( ) ;
}
}
//
// do_info: Display settings and calibration constants
// Format: info
//
void do_info(char *word)
{
printf ("Scan time = %d sec\r\n", fset . scanTime ) ;
printf ("Scan interval = %s\r\n", declToStr ( fset . interval )) ;
printf ( "Exponential averaging = %d\r\n", fset.exp);
printf ( "Upstream sensor enabled = %c\r\n", { fset . mode&UPSTREAM) ? 'y' :
' n ' ) ;
// printf ("Low flow threshold <= %s ml/hr\r\n", decToStr ( fset . calLo) ) ; }
//
// do_help: Prints a list of commands
// Format: help
/
void do_help(char *word)
{
int i;
for (i = 0; commands [i] . func != NULL; ++i)
{
printf ( "%s\t%s\r\n" , commands [i] . cmd, commands [i] . desc) ;
}
}
/
// decToStr: Converts decimal number with two places to a string
// Returns ptr to STATIC string
//
char *decToStr (intl6_t value)
{
char istr [VSTRLEN] ;
if (value < 0) snprintf (istr, VSTRLEN, "-%d", abs (value/100) ) ;
else snprintf (istr, VSTRLEN, "%d", value/100);
value = abs (value % 100); if (value < 10) snprintf (decstr, VSTRLEN, "%s .0%d" , istr, value); else snprintf (decstr, VSTRLEN, "%s . %d", istr, value);
return decstr;
}
//
// decToStr: Converts decimal number with one place to a string // Returns ptr to STATIC string
//
char *declToStr (intl6_t value)
{
char istr [VSTRLEN] ;
if (value < 0) snprintf (istr, VSTRLEN, "-%d" , abs (value/10 )) ; else snprintf (istr, VSTRLEN, "%d", value/10);
snprintf (decstr, VSTRLEN, "%s . %d", istr, abs (value % 10));
return decstr;
}
//
// strToDec: Converts a decimal string with two decimal places to an // integer of the form value*100.
//
intl6_t strToDec (char *str)
{
intl6_t intg = 0;
uintl6_t frac = 0;
char sdec[3] = "00";
char *decptr;
intg = atoi(str) * 100;
decptr = strchr ( str, ' . ' ) ;
if (decptr != NULL)
{
if (decptrfl] != '\0')
{
sdec[0] = decptr [ 1] ;
if (decptr[2] != '\0') sdec[l] = decptr [2];
frac = atoi(sdec);
}
}
return (intg+frac) ;
//
// getlnputO: Reads a line from UART0 and fills a string
// Implements backspace correctly. Adds a CRLF to output.
//
void getlnputO (char *line, int maxlen)
{
char ch;
int i = 0;
line[0] = '\0';
while (1)
{
ch = getchar ( ) ;
if (ch == '\r' I I ch == ' \η ' || ch == Oxlb || ch == '\0' ) {
putchar ('\r');
putchar ( ' \n ' ) ; line[i] = '\0';
return;
}
if (ch == ' \b' )
{
if (i > 0)
{
putchar ( ' \b' ) ;
putchar ( ' ' ) ;
putchar ( ' \b' ) ;
—i;
}
}
else if (i < maxlen-3)
{
putchar (ch) ;
line[i] = ch;
++i;
}
}
}
//
// getlnput: Reads a line from UARTO or UART1 and fills a string
// Implements backspace correctly. Adds a CRLF to output.
//
void getlnput ( char *line, int maxlen)
{
if (uartSelect == 1) getlnputl ( line, maxlen);
else getlnputO ( line, maxlen);
}
//
// getcharO : Inputs a single character from UARTO
//
int getcharO (void)
{
while (!(IFG1 & URXIFGO))/* if (sleepTimer == 0) return ' \0'*/; return RXBUF0;
}
//
// getchar: Inputs a single character from UARTO or UART1
//
int getchar (void)
{
if (uartSelect == 1) return getcharl();
else return getcharO () ;
}
// _
// putcharO: Output a single character on UARTO
// ____ int putcharO (int ch)
{
while (! (IFG1 & UTXIFG0)); // USART TX buffer ready?
TXBUF0 = ch; // TX character
return 0;
}
// // putchar: Output a single character on UARTO or UART1
/
int putchar (int ch)
{
if (uartSelect == 1)
{
putcharl (ch) ;
putcharO (ch) ;
}
else putcharO (ch) ;
return 0;
}
/
// kbhitO: Returns 1 if character waiting at UARTO
//
int kbhitO(void)
{
return (IFG1 & URXIFGO);
}
//
// kbhit: Returns 1 if character waiting at UARTO or UART1
//
int kbhit (void)
{
if (uartSelect == 1) return kbhit1();
return (IFG1 & URXIFGO);
}
//
// printf: redirected to UARTO
// The library version of printf () does not use putchar ( ) so it is // not enough to just redefine putchar () .
//
int printf (const char *fmt, ...)
{
char buf [60] , *p;
va_list ap;
va_start (ap, fmt);
vsnprintf (buf, sizeof(buf), fmt, ap) ;
for (p = buf; *p; ++p)
{
putchar ( *p) ;
}
va_end (ap) ;
return 0;
}
/*
//
// parse: Copy first word of a string to a new string and then // remove it from the original string.
// word must be same length as line to avoid overwriting
//
void parse (char *line, char *word)
{
int i, j;
word[0] = '\0'; // strip off leading blanks and tabs and commas
for (i = 0; linefi] != '\0' && (line[i] == ' '
I I line[i] == ' \t ' || line[i] == ' , ' I I line[i] \n ' ) ;
++i) ;
if (linefi] = = '\0') return;
// copy non-blank chars to word
for (j = 0; linefi] != '\0' && line[i] != ' ·' && line[i] != \f
&& line[i] != ' , ' ; ++i, ++j ) word[j] = linefi];
word[j] = '\0';
// move up remaining chars
for (j = 0; linefj] != '\0' ++i) line[j] = linefi];
linefj] = ·\0';
* comm.h
Created on: Feb 1, 2013
Author: Tom
V
#ifndef COMM_H
#define COMM H
#define STRLEN 40 // maximum string length #define VSTRLEN 10 // maximum number string length struct cmd_table
{
char *cmd; // command name
char *desc; // command description for help void (*func) (char *); // pointer to command handler
};
// Function prototypes
void cmdHandler ( oid) ;
uint32_t inpNum(char *prompt, uint32_t min, uint32_t max);
void getlnput (char *line, int maxlen) ;
int kbhit (void) ;
void do_calibrate (char *word) ;
void do_meas (char *word) ;
void do_scan(char *word) ;
void do_help(char *word) ;
void do_info(char *word) ;
void printDecimal (intl6_t value);
void do_exp(char *word) ;
void do_time(char *word) ;
void do_delCal (char *word) ;
void do_zero(char *word) ;
void do_adc(char *word) ;
void do_chipTemp ( char *word) ;
void do_disp(char *word) ;
void do_calLo ( char *word) ;
void do_upstream (char *word) ;
char *decToStr (intl6_t value);
char *declToStr (intl6_t value);
void printADC (char chan) ; //void parse (char *line, char *word) ;
void do_heat (char *word)
void do_comm (char *word)
void do_term(char *word)
int putcharO(int ch) ;
int getcharO (void) ;
int kbhitO (void) ;
#endif /* COMM H
li¬ lt main . c
I I Vivonics Thermal Flow Sensor Implant
I I Version: 2.2 - October 2013
I I Author: Tom Russell
I I I I Control program for flow sensor.
I I v2.1 - add feature for single thermistor operation
II v2.12 - correct strToDec function
I I v2.13 - really corrected strToDec function
I I v2.20 - removed parse function and use strtok to save stack space
II made dec to str functions return same global str
II printf needs at least 120 bytes - allocate 200 bytes for stack II- tinclude <stdio.h>
tinclude <stdlib.h>
#include "main . h"
#include "comm. h"
#include "measure . h"
tinclude "uartl.h"
// Settings to be saved and read from flash
// exp = 20, time = 30, interval = 0.5s
fset t fset = {0x55, 1, 20, 30, 5, -26975, 0, 0, 0, 0 , 1 * 200, */{0}};
// ADC variables set in interrupts
volatile int32_t avg[3]; // averaged adc counts volatile intl6_t adc[3]; // adc counts volatile uintl6_t mslO = 0; // 10 ms up counter volatile bool enableAveraging = 1; 11 1 = exponential averaging enabled
//volatile intl6_t sleepTimer = SLEEP_TIME; // sleep timer for keypad timeout
bool idle = 0; // 1 all temperatures the same
int main (void) initialize ( ) ;
_stack = STACKCHECK;
LED_0 ( ) ;
msdelay (1000) ;
LED_OFF ( ) ;
readSettings ( ) ;
msdelay (50) ;
autoBaud ( ) ; // send character for auto baud adjustment
// Print welcome message to each of the UART ports uartSelect = 1;
printf ( "\r\nVivonics Thermal Flow Implant v2.20\r\n" ) ;
printf("I> ");
// ADCs are sampled in background so loop here waiting for a user command RX_Ready(); // start software UART
while (1)
{
if (_stack != STACKCHECK)
{
printf ("*STACK OVERFLOW*\r\n" ) ;
abort ( ) ;
}
cmdHandler ( ) ;
}
//
// initialize: Initialize ports, USART and ADC
//
void initialize (void)
{
int i;
// Set DCO for calibrated 8MHz
WDTCTL = DTPW + WDTHOLD; // Stop DT
if (CALBC1_8MHZ ==0xFF | | CALDCO_8MHZ OxFF)
{
while (1) ; // If calibration constants erased
// do not load, trap CPU!! }
// MCLK = 1MHz
BCSCTL1 = CALBC1_8MHZ + DIVA_1; // Set DCO and DIVA to divided ACLK by 2....
DCOCTL = CALDCO_8MHZ;
BCSCTL2 |= DIVS_3 + DIVM_3; // MCLK = SMCLK = DCOCLK/8 = 1MHz
// BCSCTL2 |= DIVS_3 + DIVM_2; // SMCLK = DCOCLK/8 =
1MHz, MCLK = 2 MHz
// Wait for DCO to settle
do
{
IFG1 &= -OFIFG; // Clear OSCFault flag for (i = 0x47FF; i > 0; i— ) ; // Time for flag to set
}
while ( (IFG1 & OFIFG) ) ; // OSCFault flag still set?
// Setup Port 1 and 2
P1_INIT() ;
P2 INIT ( ) ;
// Setup flash memory timing generator for flash write
FCTL2 = FWKEY + FSSELO + FN4+FN3; // MCLK/24 = 333kHz (MCLK =
8MHz)
// Setup USARTO for 115k baud
ME1 |= UTXEO + URXEO; // Enable USARTO TXD/RXD UOCTL |= CHAR; // 8-bit character
UOTCTL |= SSEL1; // UCLK= SMCLK U0BR0 = 0x08; // 1MHz 115200 U0BR1 = 0x00; // 1MHz 115200
UOMCTL = 0x6d; // 1MHz 115200 modulation UOCTL &= -SWRST; // Initialize USART state machine
// IE1 |= URXIEO; // Enable USARTO RX interr
// Setup Timer AO to count us and interrupt every 10ms
TACTL = TASSEL_2 + MC_2 ; // SMCLK, contmode
CCTL0 = CCIE; // CCR0 interrupt enabled
// Initialize SD24 for conversion of all 3 channels
// Two's complement output, interrupt on done, 1024 oversampling
// Clock speed = 250kHz based on maximum source resistance of 40k
// See datasheet settling time. Sample rate is 4ms
SD24CTL = SD24REFON+SD24SSEL_l+SD24DIV_2 // 1.2V ref, SMCLK/4 SD24CCTL0 |= SD24GRP+SD24DF+SD24OSR_1024 // Group with CHI
SD24CCTL1 |= SD24GRP+SD24 DF+SD240SR 1024 // Group with CH2
SD24CCTL2 |= SD24IE+SD24DF+SD240SR 1024; // Enable interrupt
#ifdef THERMISTOR // Thermistors do not use PGA
SD24CTL |= SD24VMIDON; // Turn on external
VREF
#else
SD24INCTL0 = SD24GAIN_32 // PGA Gain 32 SD24 INCTLl = SD24GAIN_32 // PGA Gain 32 SD24 INCTL2 = SD24GAIN_32 // PGA Gain 32
#endif
msdelay ( 10 ) ; // Delay 1.2V ref startup
SD24CCTL2 |= SD24SC; bit to start conversion
// Enable interrupts
TAR = 0; // Initialize timer A
CCR0 = 10000; //
bis_SR_register (GIE) ; // Enable all interrupts
}■
//
// usdelay: Delays for given number of us (max = 65000)
//
void usdelay (uintl6_t us)
{
uintl6_t start = TAR;
while (TAR - start < us) ;
//
// msdelay: Delays for given number of ms (max = 65000)
//
void msdelay (uintl6_t ms)
{
uintl6_t start = TAR;
while (ms > 0)
{
while (TAR - start < 1000);
start += 1000; — ms ;
}
}
//
// writeSettings : Write values to flash.
// Flash INFO segments are only 64 bytes long so split the data into 2 segments .
//
void writeSettings (void)
{
writeSegment ( (char *) 0x1040, (char *)&fset, 64);
writeSegment ( (char *)0xl080, ((char *)&fset)+64, sizeof ( fset ) -64 ) ;
}
//
// writeSegment: Write values to flash segment.
// Length should not be longer than 64 bytes for info segments
//
void writeSegment (char *Flash_ptr, char *data, int length)
{
// char *Flash_ptr; // Flash pointer
// Flash_ptr = (char *) 0x1040; // Initialize Flash pointer
FCTL3 = FWKEY; // Clear Lock bit
FCTL1 = FWKEY + ERASE; // Set Erase bit
*Flash_ptr = 0; // Dummy write to erase segment
FCTL1 = FWKEY + WRT; // Set WRT bit for write operation for (; length > 0; --length)
*Flash_ptr++ = *data++;
FCTL1 = FWKEY; // Clear WRT bit
FCTL3 = FWKEY + LOCK; // Set LOCK bit
}
//
// readSettings : Read values from flash in segment C & D into RAM
//
void readSettings (void)
{
fset_t *Flash_ptr = (fset_t *) 0x1040; // locationsh
if (Flash_ptr->flag != 0x55) writeSettings () ;
fset = *Flash_ptr;
}
//
// SD24AISR: Interrupt for SD24 configured for continuous conversion
// Read conversion results and save in global variables.
//
ipragma vector=SD24_VECTOR
interrupt void SD24AISR (void)
{
switch (SD24IV)
{
case 2: // SD24MEM Overflow
break;
. case 4: // SD24MEM0 IFG
break;
case 6: // SD24MEM1 IFG break;
case 8 : // SD24MEM2 IFG
adc[0] = SD24MEM0;
adc[l] = SD24MEM1;
adc[2] = SD24MEM2;
break;
// P10UT Λ= BITO; // debug
//
// TIMERAOISR: Interrupt for Timer AO
// Interrupt every 10 ms and increment counters
// Add to the exponential moving average for each channel and control LED // Allow software UART to interrupt to avoid timing errors
//
#pragma vector=TIMERA0_VECTOR
interrupt void TIMERAOISR (void)
{
int i;
// static uint8_t heat = 0;
static uint8_t ledcnt = 0;
// Disable SD24 interrupts and re-enable global interrupt
// so that only software UART can interrupt
SD24CCTL2 &= -SD24IE;
bis_SR_register (GIE) ; // Enable all interrupts
CCR0 += 10000; // Add 10ms offset to CCR0
++msl0; // Increment 10 ms counter
// if (sleepTimer != 0) --sleepTimer;
/*
// Heater control
if (heaterPower != 0 && heat % heaterPower == 0) HEAT_O ( ) ;
else HEAT_OFF ( ) ;
++heat;
if (enableAveraging)
{
for (i = 0; i < 3; ++i)
{
avg[i] += ((int32 t ) fset . exp*adc [ i ] avg [i] ) /fset . exp;
}
}
// Flash LED every second
LED_OFF ( ) ;
if (++ledcnt >= 100)
{
LED_O ( ) ;
ledcnt = 0;
}
// disable GIE again and re-enable SD24
bic_SR_register (GIE) ; // Disable all interrupts
SD24CCTL2 |= SD24IE;
// Unused interrupts ^
#pragma vector=USART0RX_VECTOR interrupt void USART0_RX (void)
{
}
/* defined in msp430 software uart #pragma vector=TIMERAl_VECTOR interrupt void TIMERAIISR (void)
{
}
*/
#pragma vector=USART0TX_VECTOR interrupt void USARTOTXISR (void)
{
}
#pragma vector=PORTl_VECTOR
interrupt void PORT1ISR ( void)
{
}
#pragma vector=PORT2_VECTOR
interrupt void PORT2ISR (void)
{
}
#pragma vector=WDT_VECTOR
interrupt void WDTISR(void)
{
while (1) ;
}
#pragma vector=NMI_VECTOR
interrupt void NMIISR(void)
{
while (1) ;
}
/*
* rnain.h
*
* Created on: Jan 31, 2013
* Author: Tom
*/
#include <msp430.h>
#ifndef MAIN_H_
tdefine MAIN H
struct bits8 {
unsigned int bO 1
unsigned int bl 1
unsigned int b2 1
unsigned int b3 1
unsigned int b4 1
unsigned int b5 1
unsigned int b6 1 unsigned int b7 : 1;
};
#define SFR8BIT(x) ((volatile struct bits8 *) (&x))
// Implement a bool type extension
#define false 0
#define true 1
#define bool char
// Variable types for MSP430
typedef unsigned long uint32_t;
typedef long int32_t;
typedef unsigned int uintl6_t;
typedef int intl6_t;
typedef unsigned short uint8_t;
typedef short int8_t;
typedef struct flowCal_s {
intl6_t flow; // flow rate in ml/hr * 100
intl6_t heat; // heater delta t in deg C * 100
// intl6_t down; // downstream delta t in deg C * 100
} flowCal t;
ttdefine MAX CAL TABLE 20 // max entries in flow cal table
typedef struct fset_s
{
char flag; // set to 0x55 to indicate flash written
char mode; // 0x01 = use upstream sensor
intl6_t exp; // exponential averaging factor
intl6_t scanTime; // default scan time in sec
intl6_t interval; // scan time interval in sec * 10
intl6_t chipTempOff; // chip temp calibration offset
int32_t zero[3]; // zero channel offsets intl6_t calEntries; // number of entries in cal table
// intl6_t calLo; // threshold for low flow regime ml/hr*100
flowCal_t cal [MAX_CAL_TABLE] ; flow calibration table } fset_t;
ttdefine UPSTREAM 0x01 // bit 0 in mode
#define SLEEP TIME 3000
// PORT 1
ttdefine HEAT 0x01 // P1.0 heat on
#define RX2 0x02 // Pl.l RX2
#define RX2A 0x04 // PI.2 RX2 alternate
ttdefine TX 0x08 // PI.3 TX
#define RX 0x10 // PI.4 RX tdefine P1NC 0x60 // PI.5, PI.6 = no connect
tdefine TX2 0x80 // PI.7 = TX2
// select UART for TX and RX, select CCI1B for RX2, TA1 OUT for TX2
// enable pullup resistor on RX so not floating when disconnected
tdefine P1_INIT() { PIOUT = RX; P1REN = RX; P1DIR = HEAT+P1NC+TX+TX2 ; P1SEL
TX+RX+TX2+RX2 ; P1SEL2 = TX2; }
//tdefine PI INIT() { PIOUT = 0; P1DIR = HEAT+P1NC+TX+TX2 ; P1SEL = TX+RX; }
#define HEAT_ON ( ) (PIOUT |= 0x01) // turn heat tdefine HEAT_OFF ( ) (PIOUT &= -0x01] // turn heat off tdefine IS HEAT O ( ) (PIOUT & 0x01)
// Port 2
// Note P2.6, .7 default to crystal so need to change P2SEL bit
tdefine TX2A 0x01 // P2.0 = TX2 alternate
tdefine LED 0x40 // P2.6 = LED tdefine P2 INIT() { P20UT = 0; P2DIR = -TX2A; P2SEL = 0; }
tdefine LED_OFF() (P20UT &= -LED)
tdefine LED_ON ( ) (P20UT |= LED)
tdefine LED TOGO ( P20UT Λ= LED)
tdefine TX2_O ( ) (TACCTL1 = OUT); // TX2 is TA1 OUT tdefine TX2 OFF ( ) (TACCTL1 = 0); //
// Globals
extern fset_t fset;
extern volatile uintl6_t mslO; // 10 ms counter extern volatile intl6_t adc[3]; // adc counts extern volatile int32_t avg[3]; // average adc with exp fact
extern volatile bool enableAveraging; user abort
extern bool idle;
extern uint8 t uartSelect; // uart port number extern long long _stack;
tdefine STACKCHECK 0x5555555555555555
// Function prototypes
void initialize (void) ;
void msdelay (uintl6_t ms);
void usdelay (uintl6_t ms) ;
intl6_t strToDec (char *str) ;
void readSettings (void) ;
void writeSettings (void) ;
void writeSegment (char *Flash_ptr, char *data, int length) ;
void adcPower (bool enable);
// Compile flags
// uncomment next line for thermistor inputs
tdefine THERMISTOR
tifdef REMOTE_IO
tdefine putchar putcharl
tdefine getchar getcharl #define kbhit kbhitl
#define printf printfl
iendif
#endif /* MAIN_H_ */
/*
* measure. c
* Created on: Feb
* Author: Tom
*/
#include <stdio.h>
#include <stdlib.h>
iinclude "main.h"
iinclude "measure. h"
#include "comm.h"
//#define MAX_CAL_TABLE 10
//struct flowCal calTable [MAX_CAL_TABLE] ;
//uintl6_t calEntries = 0; // number of entries in cal table
//uintl6_t calTime = 100; // calibrated scans are 100 sec
intl6_t coldComp = 0; // cold junction compensation in counts
const intl6_t steady = 10; // steady state is less than 1 deg/sec
const intl6_t chipTempGain = 72; // counts per 100 deg C ( .00132/ (0.6V/32768) )
const intl6_t countsPerDegC = 64; // type T counts per deg C at gain 32
//
// chanADC: Return the ADC counts for the channel
// <chan> = 0, 1 or 2 with no test for out of range.
//
intl6_t chanADC (char chan)
{
// counts was scaled up by expFact to avoid truncation errors during averaging
return (intl6_t) ( (avg [chan] - fset . zero [chan] ) /fset . exp) ;
}
//
// chanTemp: Convert ADC counts to temperature in degrees C * 100
// VREF 40k THERM GND
/ / I I
// V+ V-
//
intl6_t chanTemp (char chan)
{
const intl6_t mintemp = 1100; // 11C
// Thermistor lookup table based on 1.2V ref
// SEMITEC 223Fu3122 + 40k resistor
// measured across thermistor which decreases resistance with temperature // llC - 59C .
const intl6_t tempTable[] =
{
32268, 31570, 30878 , 30192 , 29514 , 28843, 28180, 27525, 26879, 26242, 25614, 24996, . 388,23790,23203,
22626, 22059, 21503, 20959, 20425, 19902, 19390, 18889, 18399, 17920, 17452, 16994, ]
548, 16112, 15686, 15271,
14866, 14472, 14087, 13712, 13347, 12991, 12645, 12308, 11979, 11660, 11349, 11047, 10753, 10467, 10188, 9918, 9655, 9399,
-32768
};
int i;
intl6_t temp;
intl6_t counts;
// counts was scaled up by expFact to avoid truncation errors during averaging
counts = (avg[chan] - fset . zero [chan] ) /fset . exp;
// Check for counts out of range
if (counts >= tempTable [ 0 ] ) return mintemp;
// Loop through table of counts to find the temperature
// Temperature is given in degC * 100
for (i = 0; counts < tempTable [i] ; ++i);
temp = (int32_t) 100* (tempTable [i-1] - counts) / (tempTable [i-1] - tempTable [i] ) ;
temp += (i - 1)*100 + mintemp;
return temp;
}
// _
// scanTemp: Scans for given time and prints temperatures.
// Start at -10 seconds and when 0 seconds is reached, turn on heat and
// zero the delta temperatures. When done, return the avg delta temperatures
// scanReadyO should be called before calling scanTemp () .
// _
flowCal t scanTemp (int16 t sec, bool silent)
{
// int i;
uintl6_t now; // interval timer
intl6_t timeStamp = -50; // time stamp in 0.1 sec units intl6_t heatZero = 0/*, downZero 0*/;
int32_t heatAvg = 0; // summing register for heat
// int32_t downAvg = 0; // summing register for down
flowCal t cal; // flow calibrate structure cal. flow = 0;
printf ( "TIME\tUP\tHEAT\r\n" ) ;
now = mslO;
sec *= 10;
// Print the temperature every scan interval seconds
while (!kbhitO)
{ idle = tempEven();
if (fset.mode&UPSTREAM) cal.heat = chanTemp(l) - chanTemp(O) - heatZero;
else cal.heat = chanTemp ( 1 ) - heatZero;
// At time stamp 0 zero the temperature differences and turn on heat
if (timeStamp == 0)
{
heatZero = cal.heat;
// downZero = cal.down;
cal.heat/* = cal.down*/ = 0;
// heaterPower = 1;
HEAT_ON ( ) ;
LED_ON();
}
// else if (timeStamp >= sec / 2) heaterPower = 0;
// Keep track of sum of the temperature differences for averaging // Only average second half of time interval because starting is // similar
if (timeStamp > 0) , {
heatAvg += cal.heat;
// downAvg += cal.down;
// if (heaterPower > 1 && cal.heat < 150)
// {
// printfC'Full power\r\n") ;
// heaterPower = 1;
// }
'}
printf ("%s\t", declToStr ( timeStamp) ) ;
printf ("%s\t", decToStr ( chanTemp ( 0 ) ) ) ;
printf ("%s\r\n", decToStr (cal . heat ) ) ;
// printf ("%s\r\n", decToStr (cal .down) ) ;
if (timeStamp >= sec) break;
while (now - mslO < fset . interval* 10 ) ; // Wait for interval timeStamp += fset . interval ; // Increment time stamp now += fset . interval*10; // increment for next interval
}
// Compute averages and turn off the heat
cal.heat = heatAvg * fset . interval / timeStamp;
// cal.down = downAvg * fset . interval / timeStamp;
// heaterPower = 0;
HEAT_OFF ( ) ;
LED_OFF ( ) ; ',
if (kbhitO)
{
getchar ( ) ;
cal. flow = -1;
printf ( "Aborted\r\n" ) ;
}
else
{
if (fset.mode&UPSTREAM) printf (" \r\nAverage Heater - Upstream") else printf ( "\r\nAverage Heater Rise");
printf (" = %s\r\n", decToStr ( cal . heat )) ;
}
return cal; //
// scanReady: Returns false if not ready to start scanning due to
// temperature difference in sensors. Also update cold junction comp. //
bool scanReady (void)
{
// chipTemp (0) ;
msdelay (500) ;
if ( ! tempEven ( ) )
{
printf ( "Warning - temperature sensors not within +/- 0.5C\r\n"); return 0;
}
return 1;
}
// __
// tempEven: Return 1 if both sensors are within 0.5C
//
bool tempEven (void)
{
return (chanTemp(l) - chanTemp(O)) <= 50;
}
/ _
// addCal: Adds a calibration point to the calibration table.
// Entries are sorted by flow rate.
//
void addCal ( flowCal_t calpt)
{
int i, j;
if (fset . calEntries >= MAX_CAL_TABLE-1 ) return;
// Locate the insertion point in the table
for (i = 0; i < fset . calEntries ; ++i)
if (calpt. flow <= fset . cal [ i ]. flow) break;
// If rate already exists or at end of table, just write it
if (i >= fset . calEntries )
++fset . calEntries ;
else if (calpt. flow < fset . cal [i] . flow)
if (i >= MAX_CAL_TABLE-1 )
{
printf ( "Calibration table is full\r\n");
return;
}
// Move entries up to make room for new entry
for (j = fset . calEntries ; j >= i; --j )
{
fset . cal [ j +1] = fset . cal [j ] ;
}
++fset . calEntries;
}
fset. cal [i] = calpt; „ if (fset . calEntries == 0) fset . calEntries = 1;
}
//
// delCal: Delete a calibration entry
// If flowRate < 0 delete the whole table
//
void delCal (intl6_t flowRate)
{
int i, j;
// If flow rate < 0 delete the whole table
if (flowRate < 0) fset . calEntries = 0;
else
{
// Locate the entry to delete
for (i = 0; i < fset . calEntries ; ++i) if (flowRate == fset . cal [i] . flow) break; if (i >= fset . calEntries)
printf ( "Entry not found\r\n" ) ;
return;
// move up the entries to fill the gap for (j = i; j < fset . calEntries-1 ; ++j ) fset.cal[j] = fset . cal [ j+1] ;
--fset . calEntries ;
}
//
// calibrate: Perform a flow calibration
// flowrate = ml/hr * 100
//
void calibrate ( intl6_t flowRate)
{
flowCal_t new;
new = scanTemp ( fset . scanTime, 1);
if (new. flow != -1)
{
new. flow = flowRate;
addCal (new) ;
}
}
//
// measureFlow: Make a flow rate measurement
// Return: flow rate in ml/hr * 100
//
intl6_t measureFlow (bool silent)
{
flowCal_t meas;
int i;
int32_t interp;
// check to make sure cal table has an entry for no flow if (fset.cal [0] . flow != 0 I I fset . calEntries == 0)
{
printf ( "Calibration table has no 0 ml/hr entry\r\n" ) ; return -1;
}
// perform a temperature scan and abort if it was interrupted
meas = scanTemp ( fset . scanTime, silent);
if (meas. flow == -1) return -1;
// Start at the highest flow rate and search down until the measured temp // rise is greater than in the table. Interpolate between values.
printf ("Flow search:");
for (i = fset . calEntries-1 ; i >= 0; --i)
{
printf (" %d", i) ;
if (meas. heat <= fset . cal [i] . heat)
{
if (i == fset . calEntries-1 ) return fset . cal [i] . flow;
else
{
interp = 1000* ( int32_t ) (meas . heat - fset . cal [ i+1 ]. heat ) / ( fset . cal [i] . heat - fset . cal [i+1] . heat) ;
return fset . cal [ i+1 ]. flow
- (interp * ( fset . cal [ i+1 ]. flow - fset.cal [i] . flow) /1000) ;
}
}
}
return 0;
/*
// Start at the highest flow rate and search down until the measured temp
// rise is greater than in the table. Interpolate between values.
// Do not exceed the temperature rise of 0 flow as this may produce
// ambiguous results.
if (fset.calLo != 0)
{
if (meas. heat + 50 < fset . cal [ 0 ]. heat )
{
printf ("Flow search:");
for (i = fset . calEntries-1 ; i >= 0; --i)
{
printf (" %d", i);
if (meas. heat <= fset . cal [i] . heat )
{
if (i == fset . calEntries-1 ) return
fset. cal [i] . flow;
else
f
interp = 1000* (int32_t) (meas . heat - fset.cal [i+1] .heat)
/ ( fset . cal [i] . heat - fset.cal[i+l] .heat) ;
return fset . cal [i+1] . flow
- (interp * ( fset . cal [ i+1 ]. flow - fset.cal[i] .flow) /1000) ;
}
}
} }
printf ( "\r\nlo flow search:");
// Flow was not found so search using downstream temp starting fron no flow
// Do not exceed a flow rate of 2 ml/hr (geometry dependent) for (j = 0; j <= fset . calEntries-1 && fset . cal [ j ]. flow <=
fset.calLo; ++j )
{
printf (" %d", j ) ;
// if (j > 1 && fset . cal [j -1 ]. heat > meas.heat) break;
if (meas.down <= fset . cal [j ]. down)
{
if (j == 0) return 0;
else
{
interp = 1000* ( int32_t ) ( fset . cal [j ]. down - meas . down )
/ ( fset . cal [j ]. down - fset . cal [j-1] . down) ; return fset . cal [ j ] . flow
- (interp * (fset . cal [j ]. flow - fset.calfj-
1] . flow) /1000) ;
}
}
}
}
printf ( "\r\nhi flow search:");
// Go back to searching from high to low flow rates using the heater temp for (i = fset . calEntries-1 ; i >= 0; --i)
{
printf (" %d", i) ;
if (meas.heat <= fset . cal [i ]. heat )
{
if (i == fset . calEntries-1 ) return fset . cal [i] . flow;
else
{
interp = 1000* ( int32_t ) (meas . heat - fset . cal [ i+1 ]. heat ) / ( fset . cal [i] . heat - fset . cal [i+1 ]. heat ) ;
return fset . cal [i+1] . flow
- (interp * ( fset . cal [ i+1 ]. flow - fset.calfi] .flow)/1000) ;
}
}
}
printf ("\r\nCan't find flow rate in table\r\n");
return -1;
*/
}
//
// zeroADC: Record the ADC values while both thermistors are at the
// same temperature and save the offset
// _
void zeroADC (void)
{
fset.zero[0] = fset.zero[l] = fset.zero[2] = 0;
printf ("Make sure both thermistors are at the\r\n");
printf ("same temperature and press enter...");
if (getchar() == Oxlb) return;
printf ("\r\n") ; msdelay (10000) ;
fset . zero [1] = avg[l] - avg[0];
// fset . zero [2] = avg[2] - avg[0];
writeSettings ( ) ;
}
//
// inVoltage: measure the input voltage and return as dec2 number
// assumes adc is on
//
uintl6_t inVoltage (void)
{
uint32_t temp;
temp = 1313L * fset.exp;
temp = avg[2] * 100L / temp;
return (uintl6_t ) temp;
}
/*
//
// chipTemp: Returns the internal temperature of the microcontroller. // Format is degrees C * 100 (2315 = 23.15C)
//
intl6_t chipTemp ( intl 6_t cal)
{
uint8_t saveChan;
int32_t chipT = 0;
int i;
// Turn off exponential averaging of ADC channels
enableAveraging = 0;
// Switch channel 2 to internal temperature sensor
saveChan = SD24INCTL2;
SD24INCTL2 = SD24INCH_6;
for (i = 0; i < 100; ++i)
{
msdelay (5) ;
chipT += adc [2] ;
}
SD24 INCTL2 = saveChan;
msdelay (100) ;
enableAveraging = 1;
// If a value is given, compute the offset to calibrated the internal sensor
if (cal != 0)
f
fset . chipTempOff = cal - chipT/chipTempGain;
writeSettings ( ) ;
}
chipT = chipT/chipTempGain + fset . chipTempOff;
// Set the cold junction compensation for the thermocouples
coldComp = chipT;
return ( intl 6_t ) chipT ;
}
*/
/*
* measure . h * Created on: Feb 1, 2013
* Author : Tom
*/
#ifndef MEASURE_H_
#define MEASURE_H_
// Public globals
extern const intl6_t countsPerDegC;
extern uint8_t heaterPower;
// Function prototypes
flowCal_t scanTemp (intl6_t sec, bool silent);
intl6_t countsToTemp ( int32_t counts) ;
intl6_t flowCallndex (intl6_t flow);
intl6_t measureFlow (bool silent);
void calibrate (intl6_t flowRate);
int calComp (const void *a, const void *b) ;
void delCal (intl6_t flowRate);
void zeroADC (void) ;
intl6_t chipTemp (intl6_t cal);
intl6_t chanTemp ( char chan);
intl6_t chanADC(char chan);
bool scanReady (void) ;
void addCal ( flowCal_t calpt) ;
bool tempEven (void) ;
uintl6_t inVoltage (void) ;
tendif /* MEASURE_H_ */
/* —COPYRIGHT— ,BSD_EX
* Copyright (c) 2012, Texas Instruments Incorporated
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met :
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of Texas Instruments Incorporated nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
* OR BUSINESS INTERRUPTION) HOWEVER ' CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* ********************************************************
* MSP430 CODE EXAMPLE DISCLAIMER
*
* MSP430 code examples are self-contained low-level programs that typically
* demonstrate a single peripheral function or device feature in a highly
* concise manner. For this the code may rely on the device's power-on default
* register values and settings such as the clock configuration and care must
* be taken when combining code from several examples to avoid potential side
* effects. Also see www.ti.com/grace for a GUI- and www.ti.com/msp430ware
* for an API functional library-approach to peripheral configuration.
*
* —/COPYRIGHT--*/
//****************************************************************************
// MSP430x21xl Demo - Timer_A UART 9600, lMHz DCO SMCLK
//
// Description: This program demonstrates a full-duplex 9600-baud UART using // Timer_A3 and the DCO. A character is echoed on the Hyperterminal of a // a PC . The DCO frequency settings are stored in INFOA flash segment.
// ACLK = n/a, MCLK = SMCLK = saved DCO lMhz
// //* External watch crystal installed on XIN XOUT is required for ACLK *// //
// MSP430F21xl
//
// /l\l XINI-
//
// RST XOUT I - // I
// PI.3 I > Power for MAX3221
7/ CCI0A/TXD/P1.1 I
// I 9600 8N1
// CCI0B/RXD/P2.2 | <
//
// L. estlund / A. Dannenberg
// Texas Instruments, Inc
// July 2005
// Built with CCE Version: 3.2.0 and IAR Embedded Workbench Version: 3.30A //****************************************************************************
// Modified for mps430afe253 by Tom Russell for thermal sensor implant only // Note that this is a half duplex UART where send and receive are on the same line
// Transmit polarity is inverted because of transistor output
// Extra time added between transmit bytes to allow for capacitor recharge
// 2400 BAUD
// TX on PI.7 (0UT1)
// RX on Pl.l (CCI1B)
// Timer Al interrupt iinclude <msp430.h>
#include <stdio . h>
#include <stdlib. h>
#include <string . h>
#include "main.h"
#include "uartl .h"
#include "comm. h" // Define TX and RX in main.h must select alternate functions for capture/compare
// Timer A must be configured for lMHz
// Uncomment next line for IRDA inverted transmit and receive
// In IRDA each bit is divided into a pulse and then return to "zero"
// This avoids the implant losing power for too long which can cause
// it to reboot, but more likely causes rounding of the bits as current
// needs to flow to recharge the DC input capacitor
// Transmitter should select 1/4 bit time pulse width
#define IRDA
/*
// Conditions for 2400 Baud S DART, SMCLK = lMHz
#define Bitime_recv_offset 208 // ~ 0.5 bit length
#define Bitime_phase_0 208 // -0.5 bit time
#define Bitime_phase_l 209 // remainder of bit time idefine Bitime 417 // 2398 baud
*/
// 1200 baud
// transmit from remote to implant = 1/4 bit time
// (longest bit time available on the SI32 controller)
// transmit from implant to remote = 1/2 bit time (still
#ifdef IRDA
idefine Bitime_recv_offset 105 // 1/8 bit length
#else
idefine Bitime_recv_offset 417 // 0.5 bit length
iendif
idefine Bitime_phase_0 417 // 1/2 bit time idefine Bitime_phase_l 417 // remainder of bit time idefine Bitime 834 // 1200 baud
volatile uintl6_t RXTXData // RXTX shift register volatile uint8_t BitCnt; // RXTX bit counter volatile char RXbuf = 0 // received character volatile uint8_t TXphase = // bit phase for TX RZ volatile bool RXbusy = 0; // 1 = receiving a char
// _
// autoBaud: Sends a series of 0x00 for IRDA or 0x55 for non-IRDA
// so remote can fine tune baud rate
//
void autoBaud (void)
{
int . i ;
for (i = 0; i < 5; ++i)
{
iifdef IRDA
putcharl ( 0 ) ;
ielse
putcharl ( 0x55 ) ;
iendif
msdelay (10) ;
}
}
// _
// getcharl: Inputs a single character from software DART // Once a character is read, buffer is cleared and interrupts // enabled to receive next character.
// _
int getcharl (void)
{
int ch;
while (RXbuf == 0); // wait for a character ch = RXbuf;
RXbuf = 0;
RX_Ready ( ) ;
return ch;
}
// _ _
// putcharl: Output a single character on software UART1
// _ _ _
int putcharl (int ch)
{
.RXTXData = ch;
TX_Byte ( ) ; // returns when complete
// putcharO (ch) ; // debug echo to UART0
return 0;
}
// _ ____
// kbhitl: Returns waiting character or 0 but does not empty buffer
//
int kbhitl (void)
{
return RXbuf; // return non-zero if character in buffer
}
/*
//
// printf: redirected to UART0
// The library version of printf () does not use putchar ( ) so it is
// not enough to just redefine putchar () .
// _ _
int printf1 (const char *fmt, ... )
{
char buf [60] , *p;
va_list ap;
va_start(ap, fmt);
vsnprintf (buf, sizeof(buf), fmt, ap) ;
for (p = buf; *p; ++p)
{
putcharl ( *p) ;
}
va_end (ap) ;
return 0;
}
*/
//
// getlnputl: Reads a line from UART1 and. fills a string
// Implements backspace correctly. Adds a CRLF to output.
// ECHO characters to UART0 since UART1 may be busy
//
void getlnputl (char *line, int maxlen)
{
char ch; int i = 0;
line[0] = '\0';
while (1)
{
ch = getcharl ( ) ;
if (ch == '\r' M ch == '\η' | | ch == Oxlb | | ch == '\0' )
{
putcharO ( ' \r ' ) ;
putcharO ( ' \n' ) ;
putcharl ( ' \r ' ) ;
putcharl |'\n');
line[i] = ' \0';
return;
}
if (ch == ' \b' )
{
if (i > 0)
{
putcharO ( ' \b' ) ;
putcharO ( ' ' ) ;
putcharO ( ' \b' ) ;
putcharl ( ' \b' ) ;
putcharl ( ' ' ) ;
putcharl C\b');
—i;
}
}
else if (i < maxlen-3)
{
putcharO ( ch) ;
putcharl (ch) ;
line[i] = ch;
++i;
}
}
// _
// TX_Byte: Function Transmits Character from RXTXData Buffer
// On each compare match in interrupt, output a single bit
// Modified from sample code to invert bit sense
// Added a little extra delay for first bit
//
void TX_Byte (void)
{
// Provide a mechanism for interrupt
// If remote turns off power for > 20ms treat that as an escape received
/*
if ( (PUN & RX2) == 0)
{
msdelay ( 10 ) ;
if ( (PUN & RX2) == 0)
{
RXbuf = Oxlb;
return;
}
}
while (RXbusy) ;
TACCTL0 &= -CCIE; // disable other interrupts BitCnt = 10; // Load Bit counter, 8data + ST/SP TACCR1 = TAR; // Current state of TA counter
TACCR1 += Bitime*2; // Some time till first bit
TXphase = 0; // Reset phase for RZ format
RXTXData |= 0x100; // Add mark stop bit to RXTXData RXTXData = RXTXData « 1; // Add space start bit
TACCTL1 = OUTMODO + OUTMOD2 + CCIE; // TXD = mark = idle (inverted) while ( TACCTL1 & CCIE); // Wait for TX completion
if (RXbuf == 0) RX Ready (); // Ready for RX if last char read
// _
// RX_Ready: Readies UART to Receive Character into RXTXData Buffer
// Sync capture not- possible as DCO=TACLK=SMCLK can be off !!
// Do not set OUTMODO because need to leave output as low, not high
//
void RX_Ready (void)
{
BitCnt = 0x8; // Load Bit countei
TACCTL1 = CM1 + CCIS0/* + OUTMODO*/ + CAP + CCIE; // Neg Edge, Cap
}
//
// Timer Al interrupt: Transmit and receive is done in this interrupt
// Bit sense has been inverted from sample code
//
// Timer Al interrupt service routine
ttpragma vector=TIMERAl_VECTOR
interrupt void Timer_A (void)
{
if (TAIV == 2) // need to check to reset interrupt flag
{
TACCTL0 &= -CCIE; // disable other interrupts
// TACCR1 += Bitime; // Add Offset to CCR1
// RX: On first falling edge capture, switch from capture to compare
// and then sample on each compare match. Note the the SCCI bit
// contains the input value latched on compare match
if (TACCTL1 & CCIS0) // RX on CCI0B?
{
RXbusy = 1;
TACCRl += Bitime; // Add Offset to if( TACCTL1 & CAP ) // Capture mode start bit edge
TACCTL1 &= ~ CAP; // Switch from capture to compare mode
TACCRl += Bitime_recv_offset;
// BIC SR IRQtSCGl + SCG0); // DCO reamins on after reti
}
else
{ RXTXData = RXTXData » 1;
if (TACCTL1 & SCCI) // Get bit waitinc in receive latch
RXTXData |= 0x80;
BitCnt — ; // All bits RXed? if (BitCnt == 0)
//»»»»» Decode of Received Byte Here
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
{
RXbuf = RXTXData;
//
Save received char
TACCTL1 = 0;
// ■ TACCTL1 &= ~ CCIE; // All bits RXed, disable interrupt
TACCTLO |= CCIE;
//
Enable timer AO interrupt
RXbusy = 0;
}
//>>>»>»>> Decode of Received Byte Here
««<«<«««<««<<<«««<«<<«<<
}
}
// TX: Transmit next bit on each compare
else
{
if (BitCnt == 0)
{
TACCTL1 = 0;
// leave in off state (same as stop bit)
// TACCTL1 &= ~ CCIE; // All bits
TXed, disable interrupt
TACCTLO |= CCIE;
//
Enable timer AO interrupt
}
else
{
#ifdef IRDA
if (TXphase == 0)
// after phase 0, return to RESET
{
TACCR1 += Bitime_phase_l;
//
Add Offset to CCR1
if (RXTXData & 0x01) TACCTL1 |= OUTMOD2;
//
inverted from sample code
else TACCTL1 &= -OUTMOD2;
TXphase = 1;
}
else
{
TACCR1 += Bitime_phase_0;
// after phase 1 is next bit
TACCTL1 |= OUTMOD2;
RXTXData = RXTXData » 1; BitCnt — ;
TXphase = 0;
}
#else
TACCR1 += Bitime;
//
Add Offset to CCR1
if (RXTXData & 0x01) TACCTL1 |= OUTMOD2; inverted from sample code
else TACCTL1 &= -OUTMOD2;
RXTXData = RXTXData » 1;
BitCnt --;
ttendif
}
}
}
}
// uartl.h
void TX_Byte (void) ;
void RX_Ready ( void) ;
int getcharl ( void) ;
int putcharl(int ch) ;
int kbhitl (void) ;
void getlnputl (char *line, int maxlen) ;
void autoBaud (void) ;
REMOTE SOURCE CODE
#include "gModes.h"
#include <SI32_PBCFG_A_Type . h>
#include <SI32_PBSTD_A_Type. h>
#include <si32 device. h>
#include <cr_section macros . h>
#include <stdio.h>
#include "main.h"
ttinclude "myPB. h"
#include "myCPU.h" #include "myTIMERO . h"
#include "mySARADCl . h"
#include "myUARTO . h"
#include "myFLASHCTRLO . h"
#include "myPCAO.h"
// Globals
fset_t fset = {0x5555, 100.0, 2.2};
//
// My application.
// Thermal Sensor Wireless Remote
// Version 1.0
// 10/22/13
// Tom Russell - tcrussell@ieee.org 908-578-4615
//
int main (void)
{
// SI32_UART_A_enable_rx_irda_mode (SI32_UART_1) ;
// SI32_UART_A_enable_rx_signal_inversion (SI32_UART_1) ;
// Enter the default operating mode for this application enter_default_mode_from_reset ( ) ;
read_settings ( ) ;
led (GREEN) ;
delay_ms (500) ;
led (RED);
delay_ms (500) ;
led (GREEN) ;
delay_ms (500) ;
led (RED) ;
printf ( "\r\nVivonics Wireless Remote vl.0\r\nR> ");
delay_ms (1000) ;
vboost(O); // don't use booster - too much noise vbusHighCurrent (1) ;
setFreq ( fset . freq) ;
// setFreq (140) ;
// do_on("") ;
while (1)
{
cmdHandler ( ) ;
}
#include <stdbool.h>
ttinclude <stdint.h>
typedef struct
{
uintl6_t flashlnit; // set to 0x5555 if inited float freq; // oscillator frequency in kHz float senseRes; // sense resistor
} fset_t;
extern fset_t fset;
// Copyright (c) 2013 #include "myCLKCTRL . h"
// Copyright (c) 2013
#ifndef _MYCLKCTRL_H_
idefine MYCLKCTRL_H_
#include "gCLKCTRL . h"
#endif // MYCLKCTRL_H
// Copyright .(c) 2013
#include "myCMPO.h"
// Copyright "(c) 2013
#ifndef MYCMP0_H
#define MYCMP0_H
#include <stdbool.h>
// INCLUDE GENERATED CONTENT
#include "gCMPO.h" tendif // MYCMP0_H
// Copyright (c) 2013
#include "myCPU.h"
#include <si32_device . h>
#include <SI.32_WDTIMER_A_T.ype . h>
void mySystemlnit (void)
{
SI32_WDTIMER_A_stop_counter (SI32_WDTIMER_0) ;
}
//_
// delay_ms : Delays for <delay> milliseconds // Maximum delay = 65536 ms
//
void delay_ms (uint32_t delay)
{
uint32_t now;
now = get_msTicks ( ) ;
while (get_msTicks ( ) - now < delay);
}
// Copyright (c) 2013
#ifndef MYCPU_H
#define MYCPU_H
ttinclude "gCPU.h"
void delay_ms (uint32_t delay);
#endif // MYCPU_H
// Copyright (c) 2012 //library
#include <stdbool.h>
#include <stdio.h>
// hal
#include <si32_device . h>
ttinclude <SI32_FLASHCTRL_A_Type . h>
ttinclude <SI32_PBSTD_A_Type . h>
#include <SI32_VMON_A_Type . h>
#include <SI32_RSTSRC_A_Type . h>
// application
#include "main.h"
tinclude "myFLASHCTRLO . h"
#include "myCpu.h"
#define FLASH_PAGE_ADDR OxOFOOO // user flash data address
(@60k)
#define FLASH_PAGES 1 // 1 pages of 1024 bytes each
//
// write_settings : Writes settings to flash
//
void write_settings (void)
{
myFLASHCTRLO_erase_page (0, 0) ;
myFLASHCTRLO_run_write_flash_mode (0, (uintl6_t *)&fset,
( (sizeof (fset) ) /2) +1) ;
}
//
// read_settings : Read settings from flash. If flash not initialized, // write the default settings.
//
void read_settings (void)
{
fset_t *fptr = (fset_t * ) FLASH_PAGE_ADDR;
if ( fptr->flashlnit != 0x5555) write_settings ( ) ;
else fset = *fptr;
}
//============================================
//MODE FUNCTIONS
//
// myFLASHCTRLO_run_erase_page_mode :
// This function erases the flash pages in the range of start_page to // end_page. Each page is 1024 bytes and the first page is page 0 and located
// at FLASH_PAGE_ADDR
//
bool myFLASHCTRLO_erase_page (uintl6_t start_page, uintl6_t end_page)
{
uint32_t i;
if (end_page < start_page I I end_page >= FLASH_PAGES) return 0;
// 1. Enable VDD Supply Monitor and set as a reset source
SI32_VMON_A_enable_vdd_supply_monitor (SI32_VMON_0) ;
SI32 RSTSRC A enable vdd monitor reset source(SI32 RSTSRC 0); for(i = start_page; i <= end_page; i++)
{
// 2. Write the address of the Flash page to RADDR
SI32 FLASHCTRL A write wraddr(SI32 FLASHCTRL 0, FLASH PAGE ADDR +
(i*1024) ) ;
// 3. Enter Flash Erase Mode
SI32_FLASHCTRL_A_enter_flash_erase_mode (SI32_FLASHCTRL_0) ;
// 4. Disable Interrupts
disable_irq ( ) ;
// 5. Write the inital unlock value to KEY
SI32_FLASHCTRL_A_write_flash_key (SI32_FLASHCTRL_0, 0xA5) ;
// 6. Write the single unlock value to KEY
SI32_FLASHCTRL_A_write_flash_key (SI32_FLASHCTRL_0, OxFl) ;
// 7. Write any value to WRDATA in right-j ustified format to // initiate the page erase
SI32_FLASHCTRL_A_write_wrdata (SI32_FLASHCTRL_0 , 0x0000)
// 8. (optional) poll BUSYF if executing code from other than
Memory
// We are executing code from Flash, so no need to poll.
// 9. Enable Interrupts
enable_irq ( } ;
}
/*
#ifdef DEBUG
// Debug Print message to indicate completion
printf ( " \r\n%d flash page(s) at address 0x%x erased . \r\n" , start_page, FLASH_PAGE_ADDR ) ;
#endif
*/
return 1;
}
//
// myFLASHCTRLO_run_write_flash_mode:
// This function writes an array of data of <num_bytes> located at *ptr // to the specified page of flash data. The start of the user flash area // is given in FLASH_PAGE_ADDR and each page is 1024 bytes.
//_
bool myFLASHCTRLO_run_write_flash_mode (uintl6_t start_page,
uintl6_t *ptr, uint32_t num_uintl6)
{
uint32_t i;
uint32_t start_addr;
if (start_page >= FLASH_PAGES) return 0;
start_addr = FLASH_PAGE_ADDR + (start_page*1024 ) ;
// 1. Enable VDD Supply Monitor and set as a reset source
SI32_VMON_A_enable_vdd_supply_monitor (SI32_VMON_0) ;
SI32_RSTSRC_A_enable_vdd_monitor_reset_source (SI32_RSTSRC_0) ;
// 2. Disable Flash Erase Operations
SI32 FLASHCTRL A exit flash erase mode(SI32 FLASHCTRL 0); // Write all the half-words in the array
for(i = 0; i < num_uintl6; i++)
{
// 3. Write the address of the half-word to WRADDR
SI32_FLASHCTRL_A_write_wraddr (SI32_FLASHCTRL_0, start_addr + (2 * i) ) ;
// 4. Disable Interrupts
disable_irq ( ) ;
// 5. Write the inital unlock value to KEY
Sl32_FLASHCTRL_A_write_flash_key (SI32_FLASHCTRL_0, 0xA5);
// 6. Write the single unlock value to KEY
SI32_FLASHCTRL_A_write_flash_key (SI32_FLASHCTRL_0, OxFl);
// 7. Write the data to WRDATA in right-justified format to // initiate the write
Sl32_FLASHCTRL_A_write_wrdata (SI32_FLASHCTRL_0, ptr[i] ) ;
// 8. (optional) poll BUSYF if executing code from other than Flash
Memory
// We are executing code from Flash, so no need to poll.
// 9. Enable Interrupts
enable_irq ( ) ;
}
/*
#ifdef DEBUG
// Print message to indicate completion
printf ( "\r\n%d bytes of data at address 0x%x written . \r\n" , num_uintl6*2, FLASH_PAGE_ADDR ) ;
#endif
*/
return 1;
}
// Copyright (c) 2012
#ifndef MYFLASHCTRL0_H
#define MYFLASHCTRLO H
// INCLUDE GENERATED CONTENT
#include "gFLASHCTRLO . h" void write_settings ( void) ;
void read_settings ( void) ;
bool myFLASHCTRLO_run_write_flash_mode (uintl6_t start_page,
uintl6_t *ptr, uint32_t num_uintl6) ;
bool myFLASHCTRLO_erase_page (uintl6_t start_page, uintl6_t end_page) ;
#endif // MYFLASHCTRL0_H
- // Copyright (c) 2013
ttinclude "mylDACO.h"
// Copyright (c) 2013 #ifndef MYIDAC0_H
#define MYIDAC0_H
#include <stdbool.h>
// INCLUDE GENERATED CONTENT
iinclude "gIDACO.h" tendif // MYIDAC0_H_
// Copyright (c) 2013
// Include peripheral access modules used in this file
#include <SI32_PBCFG_A_Type . h>
#include <si32_device . h>
#include <SI32_PBSTD_A_Type . h>
#include <SI32_PBHD_A_Type . h>
#include "myPB.h"
//
// vboost: Turn on or off the DC-DC boost converter (PB0.11)
//
void vboost (bool enable)
{
if (enable) SI32_PBSTD_A_write_pins_high ( SI32_PBSTD_0 , 1«11 ) ;
else SI32_PBSTD A_write_pins_low ( SI32_PBSTD 0,1«11);
//
// vbusHighCurrent : Turn on the PMOS transistor to allow high current to // flow from USB. Off during startup to avoid- current spike as capacitors // charge. Uses high drive port 4 which is setup for 5V. (PB4.3)
//
void vbusHighCurrent (bool enable)
{
if (enable) SI32_PBHD_A_write_pins_low (SI32_PBHD_4 , 1«3 ) ;
else SI32_PBHD_A_write_pins_high (SI32_PBHD_4, 1«3) ;
}
//
// led: Turn LED RED, GREEN or OFF (PB4.0, PB4.1)
//
void led(int color)
{
if (color == RED)
SI32_PBHD_A_write_pins_high (SI32_PBHD_4, 1«1) ;
SI32_PBHD_A_write_pins_low(SI32_PBHD_4, 1«0) ;
lse if (color == GREEN)
SI32_PBHD_A_write_pins_low(SI32_PBHD_4, 1«1) ;
SI32_PBHD_A_write_pins_high(SI32_PBHD_4, 1«0) ;
lse
SI32_PBHD_A_write_pins_low(SI32_PBHD_4, 1«0) ;
SI32_PBHD_A_write_pins low ( SI32_PBHD 4,1«1); }
// Copyright (c) 2013
ttifndef MYPB_H
#define MYPB_H
#include "gPB.h"
#define OFF 0
#define RED 1
ttdefine GREEN 2
void vboost (bool enable);
void vbusHighCurrent (bool enable);
void led (int color) ;
lendif // MYPB_H
// Copyright (c)
// Include peripheral access modules used in this file
#include <SI32_PCA_A_Type . h>
#include <si32_device . h>
#include <SI32_PCACH_A_Type . h>
ttiiiclude "myPCAO.h"
#include "myCPU.h"
//
// setFreq: Sets the output frequency in units of kHz. Returns // frequency in kHz
//
float setFreq (float kHz)
{
uint32 t count;
count = SystemPeripheralClock/ ( kHz*2000)
if (count > 128) return 0.0;
SI32_PCA_A_write_limit (SI32_PCA_0, count
return SystemPeripheralClock/count/2000 ;
}
// Copyright (c) 2013
#ifndef MYPCA0_H
#define MYPCA0_H
#include <stdbool.h>
// INCLUDE GENERATED CONTENT
#include "gPCAO.h"
float setFreq ( float kHz);
extern float oscFreq;
#endif // YPCA0_H
//
// mySARDACl. c: ADC routines for LC meter
//
// Notes on ADC:
// Interrupt is triggered on the end of any single measurement // Multiple channels can be scanned, end of scan indicated by 0x31 in timeslot
// A single conversion can include a number of conversions which are summed
// Burst mode track time is 64-count, so minimum is 64, not 0
// This time is inserted in between every sample (x4 for 12 bit samples)
// ADC has an internal REF (1.665V) but can also use VREFO which is 2.4V
// VREFO is also tied to the external VREF pin when on
// _
//library
#include <stdbool.h>
#include <stdio.h>
#include <stdint.h>
// hal
#include <si32_device . h>
#include <SI32_SARADC_A_Typ
ttinclude <SI32_PBSTD_A_Type
// application
#include "mySARADCl . h"
#include "myTIMERO . h"
#include "myCpu.h"
// flag cleared inside conversion complete handler
uint32_t ADC_SCAN_DONE = 0;
uint8_t adc_chan = 0;
//=============.===========^
// 2nd Level Interrupt Handlers- (Called from generated code)
void SARADCl_conv_complete_handler (void)
{
SI32_SARADC_A_clear_single_conversion_complete_interrupt (SI32_SARADC__1) ; // SI32_SARADC_A_enable_burst_mode ( SI32_SARADC_1 ) ;
ADC_SCAN_DONE = 1;
} - ·
void SARADCl_scan_done_handler (void)
{
SARADC_A_clear_single_conversion_complete_interrupt ( SI 32_SARADC_1 ) ;
SI32_SARADC_A_clear_scan_done_interrupt (SI32_SARADC_1) ;
SI32_SARADC_A_disable_autoscan (SI32_SARADC_1) ;
SI32_SARADC_A_disable_accumulator (SI32_SARADC_1) ;
ADC_SCAN_DONE = 1 ;
}
/ _ _.
// set_adc_chan : Sets the adc channel for timeslot 0
//
void set_adc_chan (uint8_t chan)
{
SI32_SARADC_A_select_timeslot0_channel (SI32_SARADC_1 , chan) ;
adc_chan = chan;
}
//
// read_adc: Reads ADC channel previously selected by set_adc_chan ( )
// The number of samples and the sample scan timing is set in gSARDACl.c
// Current settings: lus track time x 8 x 4 = 32 us tracking
// 8x4 readings of 1.3us each = 41.6us
// total = 73.6us (measured 82 overall) // Values returned are 0 to 32767 based on 8 12 bit sample set in gSARDACl.c //
uint32_t read_adc (uintl6_t samples)
{
uint32_t adc_value = 0;
uintl6_t i;
for (i = 0; i < samples; ++i)
{
ADC_SCAN_DONE = 0;
// burst mode must be enabled before each conversion start
// it is cleared by hardware after the burst mode conversion completes
SI32_SARADC_A_enable_burst_mode (SI32_SARADC_1) ;
// a l-to-0 transition on ACCMD bit will enable the accumulator foi the next conversion
SI32_SARADC_A_enable_accumulator (SI32_SARADC_1) ;
SI32_SARADC_A_clear_accumulator (SI32_SARADC_1) ;
SI32_SARADC_A_start_conversion (SI32_SARADC_1 ) ;
while ( ! ADC_SCAN_DONE ) ;
adc_value += SI32_SARADC_A_read_data (SI32_SARADC_1) ;
}
return (adc_value/samples ) ; // maximum value 32767
}
// Copyright (c) 2013
#ifndef YSARADC1_H
#define MYSARADC1_H
#include <stdbool.h>
// INCLUDE GENERATED CONTENT
#include "gSARADCl . h"
void set_adc_chan (uint8_t chan) ;
uint32_t read_adc (uintl6_t samples);
// ADC channels on SiM3C144
#define REF_CHAN 4 // reference level is ADC1.4 on pin
PB0.13
#define DATA_CHAN 5 // data level is ADC1.5 on PB0.13
#endif // MYSARADC1_H
// Copyright (c) 2013
// hal
#include <si32_device . h>
#include <SI32_TIMER_A_Type . h>
#include <SI32_PBSTD_A_Type . h>
#include "myTIMERO.h"
//
// delay_us : Delays for <delay> microseconds.
// Timer 0 is clocked from prescaler AHB/2/10 = lMHz.
// It is configured as a 32 bit timer.
// Maximum delay is 4e9 us = 4,294 sec = 71 min
// void delay_us (uint32_t delay)
{
uint32_t now;
// delay *= 10;
now = SI32_TIMER_A_read_count (SI32_TIMER_0) ;
while (SI32_TIMER_A_read_count (SI32_TIMER_0) - now < delay);
}
// Copyright (c) 2013
#ifndef MYTIMER0_H
#define MYTIMER0_H
#include <stdbool.h>
// INCLUDE GENERATED CONTENT
#include "gTIMERO . h"
void delay_us (uint32_t delay) ;
#endif // MYTIMER0_H ·
// Copyright (c) 2013
// library
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
// hal
#include <si32_device . h>
ttinclude <Sl32_CLKCTRL_A_Type . h>
ttinclude <Sl32_UART_A_Type . h>
#include <Sl32_PBSTD_A_Type . h>
#include <SI.32_PCA_A_Type . h>
#include <SI32_PCACH_A_Type . h>
// application
#include "main.h"
ttinclude "myUARTO.h"
ttinclude "myUARTl.h"
#include "myPB.h"
#include "mySARADCl . h"
#include "myTIMERO . h"
#include "myFLASHCTRLO . h"
#include "myPCAO.h"
#include "myCPU.h"
// command table
static struct cmd_table commands [ ] =
{
{"con", "connect to implant", do_echo}, · {"freq", "set oscillator freq (kHz)", do_freq}, {"on", "implant power on", do_on},
{ "off" , "implant power off", do_off},
{ "baud" , "<baud rate> or blank for auto baud set" {"adc", "report half bridge current", do_adc},
{"res", "set sense resistor (ohms)", do_res},
{"help", "this help screen", help),
{"", "", NULL } };
//
// cmdHandler: Processes commands received from USB
//
void cmdHandler (void)
{
char line [STRLEN+1] ; // input line
char cmd[ STRLEN+1] = ""; // command int i ;
if (!kbhitO) return;
getlnput (line, STRLEN);
if (sscanf (line, "%s", cmd) > 0)
{
for (i = 0; commands [i] . func != NULL; ++i)
{
if (strcmp (commands [i] . cmd, cmd) == 0)
{
(commands [i] . func) (line+strlen (commands [i] . cmd) ) ; break;
}
}
if (commands [i] . func == NULL) printf ( "Invalid command\r\n" ) ;
}
printf ( "\r\nR> " ) ;
}
//
// help: Display a list of all commands
//
void help (char *line)
{
int i, cnt;
char cmd [STRLEN];
cnt = sscanf (line, " %s", cmd);
if (strcmp (cmd, "." ) == 0) cnt = 0;
if (cnt <= 0) printf ( "\r\nCommands : \r\n");
for (i = 0; commands [ i ]. func != NULL; ++i)
{
if ((cnt == 1 && strcmp (commands [i] . cmd, cmd) == 0) | | cnt <= 0) {
if (cmd[0] == ' . ' I I commands [i ]. cmd [ 0 ] != '.')
printf ("%-8s %s\r\n", commands [ i ]. cmd,
commands [i] . desc) ;
}
}
}
//
// do_echo: Echo characters between UART0 and UART1
// _
void do_echo(char *line)
{
char ch = 0;
// char last = 0;
printf ( "Press escape to exit\r\n");
do on (line) ; . while (ch != Oxlb) // loop until ESC pressed
{
if (kbhitO)
{
ch = myUARTO_get_char ( ) ;
// if (ch == Oxlb && last == Oxlb) break;
// if (ch == Oxlb) escapeUARTl ( ) ;
myUARTl_send_char (ch) ;
// last = ch;
// ch = 0;
}
else if (kbhitl ( ) )
{
ch = myUARTl_get_char ( ) ;
myUARTO_send_char (ch) ;
}
}
do_off (line) ;
printf ( "Implant power off\r\n");
/
// do_freq: Sets the frequency in kHz
//
void do_freq(char *line)
{
float newFreq;
newFreq = setFreq (atof (line) ) ;
if (newFreq != 0.0)
{
printf ("Oscillator set to %.lf kHz\r\n", newFreq);
fset.freq = newFreq;
write_settings ( ) ;
}
else printf ( "Invalid frequency\r\n" ) ;
}
/
// do_baud:
//
void do_baud(char *line)
{
uintl6 t newBaud;
newBaud = atoi(line);
if (newBaud == 0)
{
// default baud rate
SI32_UART_A_set_rx_baudrate (SI32_UART_1,
SystemPeripheralClock/16/1200 - 1) ;
SI32_UART_A_set_tx_baudrate (SI32_UART_1,
SystemPeripheralClock/16/1200 - 1);
do_off (line) ; // turn off implant
delay_ms ( 1000 ) ; // wait one second
do_on(line); // turn on implant
delay_ms (750) ; // wait a bit since implant takes 1 sec to start while ( kbhitl ( ) ) myUARTl_get_char ( ) ;
SI32JJART_A_enable_rx_autobaud(SI32JJART_l) ;
delay_ms (500) ;
while ( kbhitl ( ) ) myUARTl_get_char ( ) ;
do_off ( line) ; // turn off implant
}
else SI32_UART_A_set_rx_baudrate (SI32_UART_1,
SystemPeripheralClock/16/newBaud - 1 ) ;
SI32_UART_A_set_tx_baudrate (SI32_UART_1, SI32_UART_1->BAUDRATE . RBAUD) ; printfC'BAUD = %d\r\n", SystemPeripheralClock/16/ (SI32_UART_1- >BAUDRATE . RBAUD+1 ) ) ;
}
// _
// do_on: Enable power to implant
//_
void do_on(char *line)
{
SI32_PCA_A_start_counter_timer (SI32_PCA_0) ;
led (GREEN) ;
}
// _ _
// do_off: Disable power to implant
/ _
void do_off(char *line)
{
SI32_PCA_A_stop_counter_timer (SI32_PCA_0) ;
led (RED);
}
// _
// do_adc: Report the current through the half-bridge
// VREF is VDD = 3.3V
//
void do_adc(char *line)
float voltage;
set_adc_chan (REF_CHAN) ;
voltage = 3.3*read_adc ( 8 ) /32768. ;
printf("VREF = %.2f Current = %.2f \r\n", voltage,
voltage/fset . senseRes ) ;
}
/
// do_res : Sets the value of the sense resistor
// _
void do_res(char *line)
{
float res;
res = atof(line);
if (res != 0.0)
{
fset . senseRes = res;
write_settings ( ) ;
}
printf ( "Sense resistor = %.2f ohms\r\n", fset . senseRes ) ;
} // _
// getlnput: Reads a line from the serial port and fills a string
// Implements backspace correctly. Adds a CRLF to output.
// _ void getlnput (char *line, int maxlen)
{
char ch;
int i = 0;
while (1)
{
ch = myUARTO_get_char ( ) ;
if (ch == '\r' I I ch == '\η' | | ch == '\0' )
{
putchar ( ' Nr ' ) ;
putchar ( ' Nn ' ) ;
line[i] = ' N o nreturn;
}
if (ch == ' Nb * )
{
if (i > 0)
{
putchar (' Nb ' ) ;
putchar ( ' ' ) ;
putchar ( ' Nb ' ) ;
--i;
}
}
else if (i < maxlen-3)
{
putchar (ch) ;
line[i] = ch;
++i;
}
}
}
//
// myUART0_printf : redirected to UART0
//
int myUART0_printf (const char *fmt, ...)
{
char buf [80] , *p;
va_list ap;
va_start (ap, fmt) ;
vsnprintf (buf, sizeof(buf), fmt, ap) ;
for (p = buf; *p; ++p) myUART0_send_char ( *p) ;
. va_end (ap) ;
return 0;
)
// _ __
// myUART0_send_char :
// Outputs a single character to UART0.
// _
void myUART0_send_char (uint8_t val)
{
// Block if the output buffer is full
while (SI32 UART A read tx fifo count (SI32 UART 0) >= 4); // Write character to the output buffer
Sl32_UART_A_write_data_u8 (SI32_UART_0, val) ;
}
// _
// myUARTO_get_char :
// Returns a single character received from UARTO.
// Note: This is a blocking function.
//
uint8_t myUARTO_get_char (void)
{
uint8_t val;
// Block if input buffer is empty
while- (SI32_UART_A_read_rx_fifo_count (SI32_UART_0) == 0);
// Read character from the input buffer
val = SI32_UART_A_read_data_u8 (SI32_UART_0) ;
return val;
}
// _
// kbhit : Returns number of chars waiting in the RX FIFO
//__
uint8_t kbhit (void)
{
return Sl32_UART_A_read_rx_fifo_count (SI32_UART_0 ) ;
}
V/ Copyright (c) 2013
#ifndef MYUART0_H
#define MYUART0_H
#include <stdbool.h>
// INCLUDE GENERATED CONTENT
ttinclude "gUARTO.h"
#define STRLEN 80 // max input string ngth
struct cmd_table
{
char *cmd; // command name
char *desc; // command description for help void (*func) (char *) ; // pointer to command handler void getlnput (char *line, int maxlen) ;
void myUART0_send_char (uint8_t val);
uint8_t myUART0_get_char (void) ;
uint8_t kbhit (void);
int myUART0_printf (const char *fmt, ...);
void cmdHandler (void)
void help (char *line) void do_echo(char *line) ;
void do_freq(char *line) ;
void do_on(char *line)
void do_off(char *line) ;
void do_adc(char *line) ;
void do_res(char *line) ;
void do baud(char *line) ;
#endif // MYUART0_H
// Copyright (c) 2013
// library
ttinclude <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
// hal
ttinclude <si32_device . h>
#include <SI32_CLKCTRL_A_Type . h>
ttinclude <SI32_UART_A_Type . h>
ttinclude <SI32_PBSTD_A_Type . h>
ttinclude <SI32_PCA_A_Type . h>
ttinclude <SI32_PCACH_A_Type . h> ttinclude "rnyUARTl.h
ttinclude "myTimerO .
ttinclude "myCPU.h"
ttinclude "main.h"
//
// escapeUARTl: Send escape sequence to implant
//___
void escapeUARTl (void)
{
SI32_PCA_A_stop_counter_timer (SI32_PCA_0) ;
delay_ms (20) ;
SI32_PCA_A_start_counter_timer (SI32_PCA_0) ;
if (kbhitlO) myUARTl_get_char ( ) ;
}
//
// getlnputl: Reads a line from UART1 and fills a string // Implements backspace correctly. Adds a CRLF to output. // NO ECHO
// ,
void getlnputl ( char *line, int maxlen)
{
char ch;
int i = 0;
while (1)
{
ch = myUARTl_get_char ( ) ;
if (ch == ' \r' II ch == '\η' II ch == '\0' )
{
// putchar ( '\r' ) ;
// putchar (' \n' ) ; // line[i] = '\0';
return;
}
if (ch == ' \b' )
{
if (i > 0)
{
// putchar (' \b' ) ;
// putchar (' ');
// putchar (' \b' ) ;
—i;
}
}
else if (i < maxlen-3)
{
// putchar (ch) ;
line[i] = ch;
++i;
}
}
}
//
// myUARTl_printf : redirected to UARTl
//
int myUARTl_printf (const char *fmt, ...)
char buf [80] , *p;
va_list ap;
va_start(ap, fmt);
vsnprintf (buf, sizeof (buf ) , fmt, ap) ;
for (p = buf; *p; ++p) myUARTl_send_char ( *p) ;
va_end ( ap ) ;
return 0;
}
//
// myUARTl_send_char :
// Outputs a single character to UARTl.
// _
void myUARTl_send_char (uint8_t val)
{
// Block if the output buffer is full
while (SI32_UART_A_read_tx_fifo_count (SI32_UART_1) >= ) ;
// Write character to the output buffer
SI32_UART_A_write_data_u8 (SI32_UART_1, val) ;
}
// _
// myUARTl_get_char :
// Returns a single character received from UARTl.
// Note: This is a blocking function.
//
uint8_t myUARTl_get_char (void)
{
uint8_t val;
// Block if input buffer is empty
while (SI32 UART A_read rx fifo count (SI32 UART 1) == 0) ; // Read character from the input buffer
val = SI32_UART_A_read_data_u8 (SI32_UART_1 ) ;
return val;
}
// _
// kbhitl: Returns number of chars waiting in the RX FIFO of UART1 //___
uint8_t kbhitl (void)
{
return SI32_UART_A_read_rx_fifo_count ( SI32_UART_1 ) ;
}
// Copyright (c) 2013
#ifndef MYUART1_H
#define MYUART1_H
iinclude <stdbool.h>
// INCLUDE GENERATED CONTENT
#include "gUARTl.h"
int myUARTl_printf (const char *fmt, ...);
void myUARTl_send_char (uint8_t val);
uint8_t myUARTl_get_char (void) ;
uint8_t kbhitl (void) ;
void escapeUARTl (void) ;
#endif // MYUART1_H
// Copyright (c) 2013
#include "myVREFO.h"
// Copyright (c) 2013
#ifndef MYVREF0_H
ttdefine YVREF0_H
#include <stdbool.h>
// INCLUDE GENERATED CONTENT
#include "gVREFO.h"
#endif // MYVREF0_H
// Copyright (c) 2013
Iinclude "myVREGO.h"
//==========================================================
II 2nd Level Interrupt Handlers (Called from generated code)
//========================================================== void VREG0_vbus_invalid_handler (void)
{
}
// Copyright (c) 2013 #ifndef MYVREG0_H
#define MYVREG0_H
ttinclude <stdbool.h>
// INCLUDE GENERATED CONTENT
#include "gVREGO.h"
void VREGO_vbus_invalid_handler (void) ;
#endif // MYVREG0_H
// Copyright (c) 2013
#include "my DTIMERO . h"
// Copyright (c) 2013
#ifndef MYWDTIMER0_H
#define MYWDTIMER0_H
#include <stdbool.h>
// INCLUDE GENERATED CONTENT
#include "gWDTIMERO . h"
#endif // MYWDTIMER0_H
// _
// Copyright (c) 2010-2011 by Silicon Laboratories. All rights reserved.
// The program contained in this listing is a proprietary trade secret of
// Silicon Laboratories, Austin, Texas, and is copyrighted under the
// United States Copyright Act of 1976 as an unpublished work, pursuant to
// Section 104 and .Section 408 of Title XVII of the United States code.
// Unauthorized copying, adaptation, distribution, use, or display is
// prohibited by this law.
//
// Silicon Laboratories (si32) provides this software solely and exclusively
// for use on Silicon Laboratories' microcontroller products.
//
// This software is provided "as is". No warranties, whether express, implied
// or statutory, including, but not limited to, implied warranties 6f
// merchantability and fitness for a particular purpose apply to this software.
// Silicon Laboratories shall not, in any circumstances, be liable for special,
// incidental, or consequential damages, for any reason whatsoever.
// _
// library
#include <stdio.h>
ttinclude <stdlib.h>
#include <stdarg.h>
#include <string.h>
ttinclude <si32_device . h>
//#include "globals.h"
#include "myUARTO.h"
// _
// Precision32 Support Functions
int sys_write (int iFileHandle, char *pcBuffer, int iLength)
{ int i;
for (i = 0; i<iLength; i++)
{ ·
myUARTO_send_char (pcBuffer [i] ) ; // print each character
}
return iLength; int sys_readc (void)
{
int c;
c = myUARTO_get_char ( ) ;
return c;
//-eof
//
// Copyright (c) 2012 by Silicon Laboratories
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Silicon Laboratories End User
// License Agreement which accompanies this distribution, and is available at
// http : //developer . silabs . com/legal/version/vlO/License_Agreement_vlO . htm
//
//
// Original content and implementation provided by Silicon Laboratories
// _
//=======================
// WARNING:
//
// This file is auto-generated by AppBuilder and should not be modified.
// Any hand modifications will be lost if the project is regenerated.
//====================================^
#include "gClkCtrl.h"
#include. "gCPU.h"
#include <SI32_CLKCTRL_A_Type . h>
#include <si32_device . h>
//===========================^
// Configuration Functions
//=========================^^^
void CLKCTRL_enter_default_mode_from_reset (void)
{
// Set system clock to AHB divider frequency
SystemCoreClock = 20000000;
// Set system peripheral clock to APB divider frequency
SystemPeripheralClock = 20000000;
}
void CLKCTRL_setup_default_mode_clock_gates (void)
{
SI32_CLKCTRL_A_enable_apb_to_modules_0 (SI32_CLKCTRL_0,
SI32_CLKCTRL_A_APBCLKG0_PB0 | SI32_CLKCTRL_A_APBCLKG0_UART0 I SI32 CLKCTRL A APBCLKG0 UART1 | SI32_CLKCTRL_A_APBCLKG0_PCAO I
SI32_CLKCTRL_A_APBCLKG0_TIMER0 | SI32_CLKCTRL_A_APBCLKG0_SARADC1 | SI32_CLKCTRL_A_APBCLKG0_CMP0 | SI32_CLKCTRL_A_APBCLKG0_IDAC0 | SI32_CLKCTRL_A_APBCLKG0_FLASHCTRL0) ; SI32_CLKCTRL_A_enable_apb_to_modules_l (SI32_CLKCTRL_0,
SI32_CLKCTRL_A_APBCLKG1_MISC1 | SI32_CLKCTRL_A_APBCLKG1_MISCO ) ;
}
//
// Copyright (c) 2012 by Silicon Laboratories
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Silicon Laboratories End User
// License Agreement which accompanies this distribution, and is available at
// http : //developer . silabs . com/legal/version/vlO/License_Agreement_vlO . htm
//
//
// Original content and implementation provided by Silicon Laboratories
//
// WARNING:
//
// This file is auto-generated by AppBuilder and should not be modified.
// Any hand modifications will be lost if the project is regenerated.
//============================^
#ifndef GCLKCTRL_H
#define GCLKCTRL H void CLKCTRL_enter_default_mode_from_reset (void) ;
void CLKCTRL_setup_default_mode_clock_gates (void) ;
#endif // GCLKCTRL_H
//____
// Copyright (c) 2012 by Silicon Laboratories
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Silicon Laboratories End User
// License Agreement which accompanies this distribution, and is available at
/ / http : / /developer . silabs . com/legal/version/vlO/License_Agreement_vlO . htm
//
//
// Original content and implementation provided by Silicon Laboratories
// _
// WARNING:
//
// This file is auto-generated by AppBuilder and should not be modified.
// Any hand modifications will be lost if the project is regenerated.
#include "gCMPO.h"
ttinclude "gCPU.h"
// Include peripheral access modules used in this file
#include <SI32_CMP_A_Type . h>
#include <si32 device. h>
Figure imgf000091_0001
void CMP0_enter_default_mode_from_reset (void)
{
// No peripheral code is needed for this mode transition
}
// _
// Copyright (c) 2012 by Silicon Laboratories
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Silicon Laboratories End User
// License Agreement which accompanies this distribution, and is available at
// http: //developer. silabs . com/legal/version/vlO/License_Agreement_vlO . htm
//
//
// Original content and implementation provided by Silicon Laboratories
//
Figure imgf000091_0002
// This file is auto-generated by AppBuilder and should not be modified.
// Any hand modifications will be lost if the project is regenerated.
//============================_
#ifndef GCMP0_H
ttdefine GCMP0_H
void CMP0 enter default mode from reset (void) ;
#endif // GCMP0_H
//
// Copyright (c) 2012 by Silicon Laboratories
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Silicon Laboratories End User
// License Agreement which accompanies this distribution, and is available at
// http : //developer . silabs . com/legal/version/vlO/License_Agreement_vlO . htm
//
//
// Original content and implementation provided by Silicon Laboratories
// _
//^==^^==========^====^==============================================
II WARNING:
//
// This file is auto-generated by AppBuilder and should not be modified. // Any hand modifications will be lost if the project is regenerated.
#include "gCPU.h"
#include <stdio.h>
#include <si32_device . h>
// MODULE VARIABLES
//
//Variable that incrments 1000 times / second
volatile uint32 t msTicks; // APB Clock Frequency in Hz
uint32_t SystemPeripheralClock;
// 2nd LEVEL INTERRUPT HANDLERS
//==============================
/*NONE*/
//======================================
// 1st LEVEL INTERRUPT HANDLERS
void SysTick_Handler ( oid)
{
msTicks++;
/*NO SECOND LEVEL HANDLER SPECIFIED*/
}
//___ _
void NMI_Handler (void)
{
printf ("NMI_Handler\n") ;
/*NO SECOND LEVEL HANDLER SPECIFIED (halt USED)*/ halt ( ) ; void HardFault_Handler (void)
{
printf ( "HardFault_Handler\n" ) ;
/*NO SECOND LEVEL HANDLER SPECIFIED (halt USED)*/ halt ( ) ; void MemManage_Handler ( void)
{
printf ( "Mem anage_Handler\n" ) ;
/*NO SECOND LEVEL HANDLER SPECIFIED (halt USED) * / halt ( ) ; void BusFault_Handler (void)
{
printf ("BusFault_Handler\n") ;
/*NO SECOND LEVEL HANDLER SPECIFIED (halt USED)*/ halt ( ) ; void UsageFault_Handler (void)
{
printf ( "UsageFault_Handler\n") ;
/*NO SECOND LEVEL HANDLER SPECIFIED (halt USED)*/ halt();
/ ========================
// CONFIGURATION FUNCTIONS
//======================== // Sets up systick
void cpu_update ( oid)
{
set_ahb_clock (SystemCoreClock) ;
# if SI32_BASE_CPU_ARMV7M
// set Priority for Cortex-MO System Interrupts.
NVIC_SetPriority ( SysTick_IRQn, (1 « NVIC_PRIO_BITS ) - 1);
// TBD the rest of them
# endif
}
7 /============================™
// SUPPORT FUNCTIONS
7 /==================================^
void set_ahb_clock (uint32_t freq)
{
// UPDATE SYSTICK
if (SysTick_Config(freq / 1000))
{
printf ("ERROR: SysTick_Config failedW);
' }
// UPDATE ITM DIVIDER
*((uint32_t *) 0xE0040010) = ((50 * freq) / ,2000000ο) - 1;
}// set_ahb_clock
//
uint32_t get_msTicks (void)
{
return msTicks;
}// get_msTicks
//
void halt (void)
{
printf ( "HaltedXn" ) ;
// Configurable Fault Status Register
printf (" CFSR: 0x%08X\n", SCB->CFSR) ;
// Hard Fault Status Register
printf (" HFSR: 0x%08X\n", SCB->HFSR) ;
// Debug Fault Status Register
printf (" DFSR: 0x%08X\n", SCB->DFSR) ;
// Memory Management Fault Address Register
printf ( "MMFAR: 0x%08X\n", SCB->MMFAR) ;
// Bus Fault Address register
printf (" BFAR: 0x%08X\n", SCB->BFAR) ;
//Auxiliary Fault Status Register
printf (" AFSR: 0x%08X\n", SCB->AFSR) ;
while (1);
}
//-eof
//
// Copyright (c) 2012 by Silicon Laboratories
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Silicon Laboratories End User
// License Agreement which accompanies this distribution, and is available at
// http : //developer . silabs . com/legal /version/vlO/License_Agreement_vlO . htm
//
// // Original content and implementation provided by Silicon Laboratories
//
//===================∞
// WARNING:
//
// This file is auto-generated by AppBuilder and should not be modified.
// Any hand modifications will be lost if the project is regenerated.
//=============================∞
ttifndef GCPU_H
#define GCPU_H
#include <stdint.h>
// MODE FUNCTIONS
void cpu_update (void) ;
// SUPPORT FUNCTIONS
void set_ahb_clock (uint32_t freq) ;
uint32_t get_msTicks (void) ;
void halt (void) ;
// NVIC table location
# define si32McuOption_map_vectors_to_ram 0
// APB Clock Frequency in Hz
extern uint32_t SystemPeripheralClock;
# if si32McuOption_map_vectors_to_ram
void (*si32_nvic_table [SIM3U1XX_MCU_NVIC_C0UNT] ) (void) ;
# define si32McuOption_vector_ram_base si32_nvic_table
# endif
#endif // GCPU_H
//
// Copyright (c) 2012 by Silicon Laboratories
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Silicon Laboratories End User
// License Agreement which accompanies this distribution, and is available at
// http : //developer . silabs . com/legal/version/vlO/License_Agreement_vlO . htm
//
//
// Original content and implementation provided by Silicon Laboratories
//
//=======================================
// WARNING:
//
// This file is auto-generated by AppBuilder and should not be modified. // Any hand modifications will be lost if the project is regenerated. iinclude "gFLASHCTRLO . h"
#include "gCPU.h"
// Include peripheral access modules used in this file
#include <SI32_FLASHCTRL_A_Type . h>
#include <si32 device. h> II Configuration Functions
//==========================================
void FLASHCTRLO_enter_default_mode_from_reset (void)
{
// No peripheral code is needed for this mode transition
}
//
// Copyright (c) 2012 by Silicon Laboratories
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Silicon Laboratories End User
// License Agreement which accompanies this distribution, and is available at
// http: //developer. silabs . com/legal/version/vlO/License_Agreement_vlO . htm
//
//
// Original content and implementation provided by Silicon Laboratories
// _
II WARNING:
//
// This file is auto-generated by AppBuilder and should not be modified.
// Any hand modifications will be lost if the project is regenerated.
//=========================^
ttifndef GFLASHCTRL0_H
#define GFLASHCTRL0_H
void FLASHCTRLO enter default mode from reset (void) ;
#endif // GFLASHCTRL0_H
//
// Copyright (c) 2012 by Silicon Laboratories
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Silicon Laboratories End User
// License Agreement which accompanies this distribution, and is available at
// http: //developer . silabs . com/legal/version/vlO/License_Agreement_vlO .'htm
//
//
// Original content and implementation provided by Silicon Laboratories
//
// WARNING:
//
// This file is auto-generated by AppBuilder and should not be modified.
// Any hand modifications will be lost if the project is regenerated.
//==========================-_
#include "gIDACO.h"
ttinclude "gCPU.h"
// Include peripheral access modules used in this file
#include <SI32_IDAC_A_Type . h>
iinclude <si32 device. h>
//========================
// Configuration Functions
//======================== void IDACO_enter_default_mode_from_reset (void)
{
SI32_IDAC_A_set_external_trigger_channel (SI32_IDAC_0,
IDAC_A_CONTROL_ETRIG_DACNT7_VALUE) ;
SI32_IDAC_A_enable_module (SI32_IDAC_0) ;
SI32_IDAC_A_select_output_fullscale_lma (SI32_IDAC_0) ;
SI32_IDAC_A_disable_trigger (SI32_IDAC_0) ;
}
/
// Copyright (c) 2012 by Silicon Laboratories
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Silicon Laboratories End User
// License Agreement which accompanies this distribution, and is available at
// http : //developer . silabs . com/legal/version/vlO/License_Agreement_vlO . htm
//
//
// Original content and implementation provided by Silicon Laboratories
//
II WARNING:
//
// This file is auto-generated by AppBuilder and should not be modified.
// Any hand modifications will be lost if the project is regenerated.
//==^===∞∞=^===^^=^====^=^=^==^^== =====∞======∞=====
#ifndef GIDAC0_H
#define GIDACO H
void IDACO enter default mode from reset (void) ;
#endif // GIDAC0_H
//
// Copyright (c) 2012 by Silicon Laboratories
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Silicon Laboratories End User
// License Agreement which accompanies this distribution, and is available at
// http: //developer . silabs . com/legal/version/vlO/License_Agreement_vlO . htm
//
//
// Original content and implementation provided by Silicon Laboratories
//
//=======================================
// WARNING:
//
// This file is auto-generated by AppBuilder and should not be modified. // Any hand modifications will be lost if the project is regenerated.
//=======
#include "gCLKCTRL . h"
Iinclude "gCMPO .h"
iinclude "gCPU.h"
iinclude "gFLASHCTRLO . h
#include "gIDACO.h"
#include "gPB.h"
iinclude "gPCAO.h"
#include "gSARADCl . h"
iinclude "gTIMERO . h" #include "gUARTO.h".
#include "gUARTl.h"
iinclude "gVREFO.h"
iinclude "gVREGO . h"
#include "gWDTIMERO . h"
#include <si32_device . h>
void enter_default_mode_from_reset (void)
{
// Setup clock gates
CLKCTRL_setup_default_mode_clock_gates ( ) ;
// Init WDTIMER
WDTIMERO_enter_default_mode_from_reset ( ) ;
// Setup ports
pb_enter_default_mode_from_reset ( ) ;
// Initialize clock control
SystemCoreClock = 20000000;
cpu_update ( ) ;
CLKCTRL_enter_default_mode_from_reset () ;
// Initialize peripherals
cpu_update ( ) ;
UART0_enter_default_mode_from_reset () ;
UARTl_enter_default_mode_from_reset () ;
FLASHCTRL0_enter_default_mode_from_reset ( ) ;
VREG0_enter_default_mode_from_reset () ;
VREF0_enter_default_mode_from_reset () ;
TIMER0_enter_default_mode_from_reset () ;
CMP0_enter_default_mode_from_reset ( ) ;
IDAC0_enter_default_mode_from_reset () ;
PCA0_enter_default_mode_from_reset () ;
SARADCl_enter_default_mode_from_reset () ;
}
//
// Copyright (c) 2012 by Silicon Laboratories
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Silicon Laboratories End User
// License Agreement which accompanies this distribution, and is available at
// http : //developer . silabs . com/legal/version/vlO/License_Agreement_vlO . htm
//
//
// Original content and implementation provided by Silicon Laboratories
//
//================================~
// WARNING:
//
// This file is auto-generated by AppBuilder and should not be modified. // Any hand modifications will be lost if the project is regenerated.
#ifndef GMODES_H
#define GMODES H
// Default Mode initialization void enter_default_mode_from_reset (void) ;
#endif // GMODES_H
//
// Copyright (c) 2012 by Silicon Laboratories
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Silicon Laboratories End User
// License Agreement which accompanies this distribution, and is available at
// http : //developer .silabs . com/legal/version/vlO/License_Agreement_vlO . htm
//
//
// Original content and implementation provided by Silicon Laboratories
//
//======-.==================================
// WARNING:
//
// This file is auto-generated by AppBuilder and should not be modified. // Any hand modifications will be lost if the project is regenerated.
//============K=====∞=========∞
#include "gPB.h"
// Include peripheral access modules used in this file
tinclude <SI32_PBCFG_A_Type . h>
#include <si32_device . h>
#include <SI32_PBSTD_A_Type . h>
tinclude <SI32_PBHD_A_Type . h> void pb_enter_default_mode_from_reset (void)
{
// PBO Setup
SI32_PBSTD_A_set_pins_analog (SI32_PBSTD_0, 0x3018) ;
SI32_PBSTD_A_set_pins_push_pull_output (SI32_PBSTD_0, 0x0843) ;
SI32_PBSTD_A_write_pbskipen (SI32_PBSTD_0, 0x303C) ;
SI32_PBSTD_A_write_pins_low (SI32_PBSTD_0, 0x0800) ;
// PB1 Setup
SI32_PBSTD_A_set_pins_analog (SI32_PBSTD_1, OxOOOE) ;
SI32_PBSTD_A_write_pbskipen (SI32_PBSTD_1, OxFFFE) ;
// Enable CrossbarO signals & set properties
SI32_PBCFG_A_enable_xbarO_signal (SI32_PBCFG_0, SI32_XBAR0_PCA0_CEX0 ) ;
SI32_PBCFG_A_enable_xbar01_peripherals (SI32_PBCFG_0,
SI32_PBCFG_A_XBAR0L_CMP0AEN) ;
SI32_PBCFG_A_enable_xbar0h_peripherals (SI32_PBCFG_0,
SI32_PBCFG_A_XBAR0H_UART1EN) ;
SI32_PBCFG_A_enable_crossbar_0 (SI32_PBCFG_0) ;
// PB2 Setup
SI32_PBSTD_A_write_pbskipen (SI32_PBSTD_2, 0x7FFF) ;
// PB3 Setup
SI32_PBSTD_A_set_pins_digital_input (SI32_PBSTD_3, 0x0008) ;
SI32_PBSTD_A_set_pins_push_pull_output ( SI32_PBSTD_3 , 0x0001) ;
SI32_PBSTD_A_write_pbskipen(SI32_PBSTD_3, OxOFFO) ;
// Enable Crossbarl signals & set properties
SI32_PBCFG_A_enable_xbarl_peripherals (SI32_PBCFG_0, SI32_PBCFG_A_XBAR1_UART0EN) ;
SI32_PBCFG_A_enable_crossbar_l (SI32_PBCFG_0) ;
// PB4 Setup
SI32_PBCFG_A_unlock_ports (SI32_PBCFG_0) ;
SI32_PBHD_A_write_pblock(SI32_PBHD_4, 0x0000) ;
SI32_PBHD_A_select_nchannel_current_limit (SI32_PBHD_4, 6) ;
SI32_PBHD_A_select_pchannel_current_limit (SI32_PBHD_4 , 6) ;
SI32_PBHD_A_enable_pullup_resistors (SI32_PBHD_4 ) ;
SI32_PBHD_A_select_slew_rate (SI32_PBHD_4, SI32_PBHD_A_SLEW_SL0 EST) ;
SI32_PBHD_A_enable_bias (SI32_PBHD_4) ;
SI32_PBHD_A_enable_drivers (SI32_PBHD_4 ) ;
SI32_PBHD_A_set_pins_push_pull_output ( SI32_PBHD_4 , 0x0003) ;
SI32_PBHD_A_write_pins_low(SI32_PBHD_4, 0x0003) ;
SI32_PBHD_A_enable_n_channel_drivers (SI32_PBHD_4 , OxOOOB) ;
SI32_PBHD_A_enable_p_channel_drivers ( SI32_PBHD_ , 0x0003) ;
SI32_PBHD_A_enable_pin_current_limit ( SI32_PBHD_ , 0x0003) ;
SI32_PBHD_A_select_pin3_safe_state (SI32_PBHD_4,
S132_PBHD_A_SAFE_STATE_HIGH) ;
}
//
// Copyright (c) 2012 by Silicon Laboratories
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Silicon Laboratories End User
// License Agreement which accompanies this distribution, and is available at
// http : //developer . silabs . com/legal/version/vl0/License_Agreement_vl0. htm
//
//
// Original content and implementation provided by Silicon Laboratories
//
//===================================================
// WARNING:
//
// This file is auto-generated by AppBuilder and should not be modified.
// Any hand modifications will be lost if the project is regenerated.
//======================∞
#ifndef GPB_H
#define GPB_H
void pb_enter_default_mode_from_reset (void) ;
#endif // GPB_H
// ;_
// Copyright (c) 2012 by Silicon Laboratories
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Silicon Laboratories End User
// License Agreement which accompanies this distribution, and is available at
// http : //developer . silabs . com/legal/version/vl0/License_Agreement_vl0. htm
//
//
// Original content and implementation provided by Silicon Laboratories
//
7 /===================================^
// WARNING:
//
// This file is auto-generated by AppBuilder and should not be modified. // Any hand modifications will be lost if the project is regenerated.
//===========================================
#include "gPCAO.h"
#include "gCPU.h"
// Include peripheral access modules used in this file
#include <SI32_PCA_A_Type . h>
#include <si32_device . h>
♦include <SI32_PCACH_A_Type . h>
II Configuration Functions
//===^=^=^=^^=^=^=^=^====^=^^==^============================-. void PCA0_enter_default_mode_from_reset (void)
{
l32_PCACH_A_select_operating_mode_high_frequency_square_wave ( SI32_PCA_0_CH0 ) ;
SI32_PCA_A_write_limit (SI32_PCA_0, 99) ;
}
//
// Copyright (c) 2012 by Silicon Laboratories
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Silicon Laboratories End User
// License Agreement which accompanies this distribution, and is available at
// http : //developer . silabs . com/legal/version/vlO/License_Agreement_vlO . htm
//
//
// Original content and implementation provided by Silicon Laboratories
// _
//===========_======-∞
// WARNING:
//
// This file is auto-generated by AppBuilder and should not be modified.
// Any hand modifications will be lost if the project is regenerated.
//============-=.===========™
#ifndef GPCA0_H
ttdefine GPCAO H
void PCAO enter default mode from reset (void) ;
#endif // GPCA0_H
//
// Copyright (c) 2012 by Silicon Laboratories
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Silicon Laboratories End User
// License Agreement which accompanies this distribution, and is available at
// http : //developer . silabs . com/legal/version/vlO/License_Agreement_vlO . htm
//
//
// Original content and implementation provided by Silicon Laboratories
//
//=^===^^=^^^^^====^^====^^=====^===^==================
II WARNING:
//
// This file is auto-generated by AppBuilder and should not be modified. // Any hand modifications will be lost if the project is regenerated.
//=
#include "gSARADCl . h"
#include "gCPU.h"
// Include peripheral access modules used in this file
#include <SI32_SARADC_A_Type . h>
#include <si32 device. h>
//=============================
// 2nd Level Interrupt Handlers
//=============================
extern void SARADCl_conv_complete_handler ( oid) ;
//=====================================================================
//· 1st Level Interrupt Handlers
//=====================================================================
void SARADCl_IRQHandler ( )
{
if
(SI32_SARADC_A_is_single_conversion_complete_interrupt_pending (SI32_SARADC_1)
&&
SI32_SARADC_A_is_single_conversion_complete_interrupt_enabled (SI32_SARADC_1 ) )
{
SARADCl_conv complete_handler ι
//==============================================
// Configuration Functions
//==============================================
void SARADCl enter default mode from reset (void)
{
SI32 _SARADC_ _A select timeslot0_channel (SI32_SARADC_1, 4
SI32" SARADC" A select timeslotl_channel (SI32_SARADC_1, 4
SI32" _SARADC" _A_ select timeslot2_channel ( SI32_SARADC_1 , 4
SI32" SARADC" A select timeslot3_channel (SI32_SARADC_1, 4
SI32~ _SARADC" A select timeslot4_channel (SI32_SARADC_1, 4
SI32" _SARADC" _A select timeslot5_channel (SI32_SARADC_1, 4
SI32" _SARADC" A select timeslot6_channel (SI32_SARADC_1, 4
SI32' _SARADC" A select timeslot7_channel ( SI32_SARADC_1 , 4
SI32" SARADC" A select output_packing_mode_lower_halfword_only (SI32_SARADC_1)
SI32~ _SARADC" A select burst_mode_clock_apb_clock (SI32_SARADC_1 ) ;
SI32~ _SARADC" A select burst_mode_track_time (SI32_SARADC_1, 54) ;
SI32 SARADC" A select bias_power (SI32_SARADC_1,
SARADC A BIAS POWER HIGH r
SI32 SARADC A select vref external (SI32 SARADC 1);
32_SARADC_A_select_channel_characteristicO_burst_mode_repeat_count (SI32_SARADC , SI32_SARADC_A_BURST_MODE_REPEAT_COUNT_SAMPLE_8_TIMES) ;
SI32_SARADC_A_select_channel_characteristicO_12bit_mode ( SI32_SARADC_1 ) ;
SI32_SARADC_A_enable_module (SI32_SARADC_1) ;
SI32_SARADC_A_enable_burst_mode (SI32_SARADC_1 ) ;
32_SARADC_A_enable_single_conversion_complete_interrupt (SI32_SARADC_1 ) ;
NVIC_C1earPendingIRQ ( SARADCl_IRQn) ;
NVIC_EnableIRQ(SARADCl_IRQn) ;
}
// // Copyright (c) 2012 by Silicon Laboratories
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Silicon Laboratories End User
// License Agreement which accompanies this distribution, and is available at
// http : //developer . silabs . com/legal/version/vlO/License_Agreement_vlO . htm
//
//
// Original content and implementation provided by Silicon Laboratories
//
//==============================================
// WARNING:
//
// This file is auto-generated by AppBuilder and should not be modified.
// Any hand modifications will be lost if the project is regenerated.
#ifndef GSARADC1_H
#define GSARADC1_H
void SARADCl_IRQHandler (void) ;
void SARADC1 enter default mode from reset (void);
#endif // GSARADC1_H
/
// Copyright (c) 2012 by Silicon Laboratories
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Silicon Laboratories End User
// License Agreement which accompanies this distribution, and is available at
// http : //developer . silabs . com/legal /version/vl0/License_Agreement_vl0. htm
//
//
// Original content and implementation provided by Silicon Laboratories
//
//=========================∞
// WARNING:
//
// This file is auto-generated by AppBuilder and should not be modified.
// Any hand modifications will be lost if the project is regenerated.
//=============.======∞
tinclude "gTIMERO . h"
#include "gCPU.h"
// Include peripheral access modules used in this file
#include <SI32_TIMER_A_Type . h>
#include <si32_device . h>
/=============================∞
// Configuration Functions
//^==∞=========^=^=^^^====^=====^==∞==^==================== void TIMER0_enter_default_mode_from_reset (void)
{
SI32_TIMER_A_set_clock_divider_counter (SI32_TIMER_0, 236) ;
SI32_TIMER_A_set_clock_divider_reload(SI32_TIMER_0, 236) ;
SI32_TIMER_A_start_high_timer (SI32_TIMER_0) ;
}
// // Copyright (c) 2012 by Silicon Laboratories
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Silicon Laboratories End User
// License Agreement which accompanies this distribution, and is available at
// http : //developer . silabs . com/legal/version/vlO/License_Agreement_vlO . htm
//
//
// Original content and implementation provided by Silicon Laboratories
//
//=============================∞
// WARNING:
://
// This file is auto-generated by AppBuilder and should not be modified.
// Any hand modifications will be lost if the project is regenerated.
#ifndef GTIMER0_H
#define GTIMER0_H
void TIMER0 enter_default_mode from reset (void);
#endif // GTIMER0_H
//
// Copyright (c) 2012 by Silicon Laboratories
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Silicon Laboratories End User
// License Agreement which accompanies this distribution, and is available at
// http: //developer . silabs . com/legal/version/vlO/License_Agreement_vlO . htm
//
//
// Original content and implementation provided by Silicon Laboratories
//
//====^=^=^==^===^=∞==^=^=^===^==^==^===^===================
// WARNING:
//
// This file is auto-generated by AppBuilder and should not be modified. // Any hand modifications will be lost if the project is regenerated.
#include "gUARTO.h"
ttinclude "gCPU.h"
// Include peripheral access modules used in this file
ttinclude <SI32_UART_A_Type . h>
#include <si32_device . h>
// Configuration Functions
void UART0_enter_default_mode_from_reset (void)
{
SI32_UART_A_set_rx_baudrate (SI32_UART_0, SystemPeripheralClock/2/115200 -
SI32_UART_A_set_tx_baudrate (SI32_UART_0, SystemPeripheralClock/2/115200 -
S132_UART_A_enable_rx (S132_UART_0 ) ;
SI32_UART_A_enable_t (SI32_UART_0) ;
} //
// Copyright (c) 2012 by Silicon Laboratories
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Silicon Laboratories End User
// License Agreement which accompanies this distribution, and is available at
// http : //developer . silabs . com/legal/version/vlO/License_Agreement_vlO . htm
//
//
// Original content and implementation provided by Silicon Laboratories
//
//=======================================
// WARNING:
//
// This file is auto-generated by AppBuilder and should not be modified.
// Any hand modifications will be lost if the project is regenerated.
//=======._===============^^
#ifndef GUART0_H
#define GUART0_H
void UART0 enter default mode from reset (void) ;
#endif // GUART0_H
//
// Copyright (c) 2012 by Silicon Laboratories
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Silicon Laboratories End User
// License Agreement which accompanies this distribution, and is available at
// http : //developer . silabs . com/legal/version/vlO/License_Agreement_ lO . htm
//
//
// Original content and implementation provided by Silicon Laboratories
//
7 /==============================..^
// WARNING:
//
// This file is auto-generated by AppBuilder and should not be modified.
// Any hand modifications will be lost if the project is regenerated.
/=========^=^=„===============^===„=====^∞==^===∞======^======
#include "gUARTl.h"
#include "gCPU.h"
// Include peripheral access modules used in this file
#include <SI32_UART_A_Type . h>
#include <si32_device . h>
//=======================∞
// Configuration Functions
void UARTl_enter_default_mode_from_reset (void)
{
SI32_UART_A_set_rx_baudrate (SI32_UART_1, SystemPeripheralClock/16/1200 - 1 ) ; SI32_UART_A_set_tx_baudrate (SI32_UART_1, SystemPeripheralClock/16/1200 - 1 ) ; SI32_UART_A_enable_rx_irda_mode (SI32_UART_1 ) ;
SI32_UART_A_enable_tx_irda_mode (SI32_UART_1) ;
SI32 UART A select tx irda pulse width (SI32 UART 1, UART_A_I DA_PULSE_WIDTH_1_4TH) ;
SI32_UART_A_enter_half_duplex_mode (SI32_UART_1 ) ;
SI32_UART_A_enable_rx (SI32_UART_1 ) ;
SI32 UART A enable tx(SI32 UART 1);
// „
// Copyright (c) 2012 by Silicon Laboratories
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Silicon Laboratories End User
// License Agreement which accompanies this distribution, and is available at
// http : //developer . silabs . com/legal/version/vlO/License_Agreement_vlO . htm
//
//
// Original content and implementation provided by Silicon Laboratories
// _
//======^======∞===========^=====^============^=^^==========∞==
II WARNING:
//
// This file is auto-generated by AppBuilder and should not be modified.
// Any hand modifications will be lost if the project is regenerated.
//==========================================
#ifndef GUART1_H ~
ttdefine GUART1 H
void UART1 enter default mode from reset (void);
#endif // GUART1_H
// _
// Copyright (c) 2012 by Silicon Laboratories
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Silicon Laboratories End User
// License Agreement which accompanies this distribution, and is available at
// http : / /developer .silabs . com/legal/version/vlO/License_Agreement_vlO . htm
//
//
// Original content and implementation provided by Silicon Laboratories
//
// WARNING:
//
// This file is auto-generated by AppBuilder and should not be modified.
// Any hand modifications will be lost if the project is regenerated.
/ /=======================================^===========∞====^======^=∞== iinclude "gVREFO.h"
#include "gCPU.h"
// Include peripheral access modules used in this file
#include <SI32_VREF__A_Type . h>
#include <si32_device . h>
//=======================∞
// Configuration Functions
//^=======^==^======^=^^=====^=========^^=^^^===^======= void VREF0_enter_default_mode_from_reset (void)
{ SI32_VREF_A_select_2p4_volts (SI32_VREF_0) ;
//
// Copyright (c) 2012 by Silicon Laboratories
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Silicon Laboratories End User
// License Agreement which accompanies this distribution, and is available at
// http : //developer . silabs . com/legal/version/vl0/License_Agreement_vl0. htm
//
//
// Original content and implementation provided by Silicon Laboratories
//
//=====^^^=^=^=^=^=====^===========^============================
II WARNING:
//
// This file is auto-generated by AppBuilder and should not be modified.
// Any hand modifications will be lost if the project is regenerated.
//=======================================
#ifndef GVREF0_H
#define GVREF0_H
void VREF0 enter default mode from reset ( void) ;
#endif // GVREF0_H
//
// Copyright (c) 2012 by Silicon Laboratories
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Silicon Laboratories End User
// License Agreement which accompanies this distribution, and is available at
// http : //developer . silabs . com/legal/version/vlO/License_Agreement_vlO . htm
//
//
// Original content and implementation provided by Silicon Laboratories /
II WARNING:
//
// This file is auto-generated by AppBuilder and should not be modified. // Any hand modifications will be lost if the project is regenerated.
//=====================∞
^include "gVREGO . h"
#include "gCPU.h"
// Include peripheral access modules used in this file
#include <SI32_VREG_A_Type . h>
#include <si32_device . h>
7/================================^
// 2nd Level Interrupt Handlers
//============================_^
extern void VREG0 vbus invalid handler (void) ;
//=============================
// 1st Level Interrupt Handlers
//============================= void VBUSINVALID_IRQHandler ( )
{
if (SI32_VREG_A_is_vbus_invalid_interrupt_pending (SI32_VREG_0 )
&& SI32_VREG_A_is_vbus_invalid_interrupt_enabled(SI32_VREG_0) )
{
VREGO_vbus_invalid_handler ( ) ;
}
}
//=====================∞
// Configuration Functions
/ ^==^^==================================================================. void VREGO_enter_default_mode_from_reset (void)
{
// No peripheral code is needed for this mode transition
}
//
// Copyright (c) 2012 by Silicon Laboratories
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Silicon Laboratories End User
// License Agreement which accompanies this distribution, and is available at
// http: //developer . silabs . com/legal/version/vlO/License_Agreement_vl0. htm
//
//
// Original content and implementation provided by Silicon Laboratories
//
//================.«====∞
// WARNING:
//
// This file is auto-generated by AppBuilder and should not be modified.
// Any hand modifications will be lost if the project is regenerated.
#ifndef GVREG0_H
#define GVREG0_H
void VBUSINVALID_IRQHandler (void) ;
void VREG0 enter default mode from reset (void) ;
#endif // GVREG0_H
// _
// Copyright (c) 2012 by Silicon Laboratories
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Silicon Laboratories End User
// License Agreement which accompanies this distribution, and is available at
// http : //developer . silabs . com/legal/version/vlO/License_Agreement_vlO . htm
//
//
// Original content and implementation provided by Silicon Laboratories
//
II WARNING:
//
// This file is auto-generated by AppBuilder and should not be modified.
// Any hand modifications will be lost if the project is regenerated. #include "gWDTIMERO . h"
iinclude "gCPU.h"
// Include peripheral access modules used in this file
tinclude <Sl32_WDTIMER_A_Type . h>
tinclude <si32_device . h>
//===========================================__
// Configuration Functions
void WDTIMERO_enter_default_mode_from_reset (void)
{
SI32_WDTIMER_A_stop_counter (SI32_WDTIMER_0) ;
}
//
// Copyright (c.) 2012 by Silicon Laboratories
// All rights reserved. This program and the accompanying materials
// are made available under the terms of . the Silicon Laboratories End User
// License Agreement which accompanies this distribution, and is available at
// http: / /developer . silabs . com/leg'al/version/vlO/License_Agreement_vlO . htm
//
//
// Original content and implementation provided by Silicon Laboratories
//
//=====================^^
// WARNING:
//
// This file is auto-generated by AppBuilder and should not be modified. // Any hand modifications will be lost if the project is regenerated.
//=====-============∞
#ifndef GWDTIMER0_H
#define GWDTIMER0_H
void WDTIMER0 enter default mode from reset (void) ;
#endif // GWDTIMER0_H
// Copyright (c) 2013
Although specific features of the invention are shown in some drawings and not in others, this is for convenience only as each feature may be combined with any or all of the other features in accordance with the invention. The words "including", "comprising", "having", and "with" as used herein are to be interpreted broadly and comprehensively and are not limited to any physical interconnection. Moreover, any embodiments disclosed in the subject application are not to be taken as the only possible embodiments. Other embodiments will occur to those skilled in the art and are within the following claims.
In addition, any amendment presented during the prosecution of the patent application for this patent is not a disclaimer of any claim element presented in the application as filed: those skilled in the art cannot reasonably be expected to draft a claim that would literally encompass all possible equivalents, many equivalents will be unforeseeable at the time of the amendment and are beyond a fair interpretation of what is to be surrendered (if anything), the rationale underlying the amendment may bear no more than a tangential relation to many equivalents, and/or there are many other reasons the applicant cannot be expected to describe certain insubstantial substitutes for any claim element amended.
Other embodiments will occur to those skilled in the art and are within the following claims.
What is claimed is:

Claims

1. A flow rate sensor system for non-invasively measuring the flow rate of a bodily fluid, the system comprising:
an encapsulated implant including:
a flow tube having an inlet and an outlet configured to receive a flow of a bodily fluid,
a heating element externally coupled to the flow tube configured to dissipate heat at a predetermined rate over a predetermined amount of time, a temperature sensor externally coupled to the heating element configured to measure a temperature rise of the heating element over the predetermined amount of time,
an implant microcontroller coupled to the temperature sensor configured to determine the flow rate of the bodily fluid in the flow tube from the measured temperature rise of the heating element over the predetermined amount of time and a curve fit to a stored set of previously obtained calibration measurements, and
an implant power and communication subsystem coupled to the implant microcontroller configured to wirelessly receive power and wirelessly transmit and receive data; and
an external device including:
an external microcontroller, and
an external power and communication subsystem coupled to the external microcontroller configured to wirelessly deliver power to the implant power and communication subsystem and transmit and receive data to and from the implant power and communication subsystem.
2. The system of claim 1 in which the temperature sensor includes a thermistor.
3. The system of claim 1 in which the temperature sensor includes a resistance temperature detector (RTD).
4. The system of claim 1 further including a thermistor configured as both the temperature sensor and the heating element.
5. The system of claim 1 in which the temperature sensor includes a thermocouple.
6. The system of claim 1 in which the heating element includes a surface mount resistor.
7. The system of claim 1 in which the heating element includes a coil of electrically conductive wire.
8. The system of claim 1 in which the heating element includes a printed circuit heater.
9. The system of claim 1 in which the heating element is directly attached to the external surface of the flow tube.
10. The system of claim 1 further including a thermal insulator configured to thermally isolate the heating element and the temperature sensor from cooling paths other than the direct cooling path to the bodily fluid in the flow tube.
1 1. The system of claim 10 in which the thermal insulator includes an insulation layer over the heating element and the temperature sensor.
12. The system of claim 10 in which the thermal insulator includes a sealed volume of air surrounding the heating element and the temperature sensor.
13. The system of claim 1 in which the flow through flow tube is comprised of a thin wall of polymer material with low thermal conductivity configured to limit heat transfer along a length and a circumference of the tube while maintaining heat transfer in a radial direction to the fluid.
14. The system of claim 1 in which the bodily fluid includes one or more of: cerebrospinal fluid (CSF), bile, blood, and urine.
15. The system of claim 1 in which the encapsulated implant is coupled to a shunt, tube, vessel or catheter implanted in a human body or an animal.
16. The system of claim 15 in which the shunt includes one or more of: a ventnculo-peritoneal (VP) shunt, ventroarterial shunt, and lumboperitoneal shunt. 112
17. The system of claim 16 in which the encapsulated implant is coupled to a distal catheter of the shunt.
18. The system of claim 16 in which the encapsulated implant is coupled to a proximal catheter of the shunt.
19. The system of claim 1 in which the heating element and the temperature sensor are located proximate the outlet.
20. The system of claim 1 in which the heating element and the temperature sensor are located proximate the inlet.
21. The system of claim 1 in which the heating element and the temperature sensor are located between the inlet and the outlet.
22. The system of claim 1 in which the external power and communication subsystem includes an external coil coupled to the external microcontroller and the implant power and communication subsystem includes an implant coil coupled to the microcontroller.
23. The system of claim 22 in which the implant coil of the encapsulated implant is located using magnitude of the induced voltage wirelessly sent from the implant coil to the external coil.
24. The system of claim 22 in which the external coil is positioned proximate and in alignment with the implant coil to achieve sufficient inductive coupling between the external coil and the implant coil.
25. The system of claim 22 in which the external coil is remotely located from and tethered to the external power and communication subsystem.
26. The system of claim 22 in which the implant coil is integrated with the encapsulated implant.
27. The system of claim 22 in which the implant coil is remotely located from and tethered to the encapsulated implant.
28. The system of claim 24 in which the external power and
communication subsystem includes a resonant circuit comprised of the external coil and a capacitor, and a source of low-level voltage pulses, the external device resonant circuit configured to provide sinusoidal current in the external coil of sufficient amplitude to induce sufficient sinusoidal voltage in the implant coil.
29. The system of claim 28 in which the implant power and
communication subsystem includes an implant resonant circuit comprised of the implant coil and a capacitor having a resonance frequency closely matched to the resonance frequency of the external resonant circuit to maintain sufficient AC voltage amplitude to power the implant power and communication subsystem and to enable communication between the external power and communication subsystem and implant power and communication subsystem.
30. The system of claim 29 in which the implant power and
communication subsystem is configured to convert induced sinusoidal voltages in the implant coil to a highly regulated DC voltage over the range of loading conditions to power the heating element, the temperature sensor, the microcontroller, and components of the implant power and communication subsystem.
31. The system of claim 29 in which the external power communication subsystem is configured to enable the external microcontroller to communicate data to the implant power and communication subsystem by changing the voltage supplied to the resonant circuit of the external power and communication subsystem to modulate the amplitude of the voltage induced in the implant coil and use that change in voltage to represent different binary states.
32. The system of claim 31 in which the implant power and communication subsystem transmits binary values serially to the external power and communication subsystem by sequentially applying and removing an electrical load from the implant coil to induce changes in voltage in the external coil that are decoded into data by the external microcontroller.
33. The system of claim 32 in which the external power and
communication subsystem includes a sense resistor configured to measure change in the amplitude of the current in external power and communication subsystem resulting from changes in the induced voltage in the external coil.
34. The system of claim 33 in which the external microcontroller is coupled to the series resistor and is configured to decode changes in the current of the external power and communication subsystem into data.
35. The system of claim 1 in which the implant microcontroller is configured to store the set of previously obtained calibration measurements relating heating element temperature rise to flow rate.
36. The system of claim 1 in which the implant microcontroller is configured to determine when the temperature of the heating element is no longer rising to minimize the length of time needed to determine the flow rate.
37. The system of claim 1 in which the implant microcontroller is configured to determine the flow rate from the measured temperature rise when temperature of the heating element is determined to be no longer rising to minimize the length of time needed to determine the flow rate, the amount of heat generated by the heating device, and the amount of heat delivered to a patient.
38. The system of claim 1 in which the implant microcontroller is configured to store identification information associated with the encapsulated implant.
39. The system of claim 1 in which the external device includes an interface port coupled to the external microcontroller configured to connect to a computer subsystem by an electrical cable.
40. The system of claim 1 in which the external device includes an interface port coupled to the external microcontroller configured to wirelessly connect to a computer subsystem.
41. The system of claim 1 in which the external device includes an interface port coupled to the external microcontroller configured to wirelessly connect to a smart device.
42. The system of claim 1 in which the implant microcontroller is configured to use a mean value of a set of temperature rise samples obtained over the predetermined amount of time as the temperature rises to determine the flow rate of the bodily fluid in order to increase the signal to noise ratio.
43. The system of claim 1 in which the implant microcontroller is configured to use a weighted average of a set of temperature rise samples obtained over the predetermined amount of time as the temperature rises to determine the flow rate of the bodily fluid in order to increase the signal to noise ratio.
44. The system of claim 1 in which the encapsulated implant is implanted in a human body.
45. The system of claim 1 in which the external device includes a smart device including a flow sensor App and a tethered external coil.
The system of claim 1 in which the external device includes a display for displaying one or more of: the measured flow rate, the predetermined amount of time, induced voltage on the implant coil, and identification information associated with the encapsulated implant.
47. A flow rate sensor system for non-invasively measuring the flow rate of a bodily fluid, the system comprising:
an encapsulated implant including:
a flow tube having an inlet and an outlet configured to receive a flow of a bodily fluid,
a heating element externally coupled to the flow tube configured to dissipate heat at a predetermined rate over a predetermined temperature rise of the heating element,
a temperature sensor externally coupled to the heating element configured to measure a temperature drop of the heating element over a predetermined amount of time of cooling,
an implant microcontroller coupled to the temperature sensor configured to determine the flow rate of the bodily fluid in the flow tube from the measured temperature drop of the heating element over the predetermined amount of cooling time and a curve fit to a stored set of previously obtained calibration measurements, and
an implant power and communication subsystem coupled to the implant microcontroller configured to wirelessly receive power and wirelessly transmit and receive data; and
an external device including:
an external microcontroller, and an external power and communication subsystem coupled to the external microcontroller configured to wirelessly deliver power to the implant power and communication subsystem and transmit and receive data to and from the implant power and communication subsystem.
48. A flow rate sensor system for non-invasively measuring the flow rate of a bodily fluid, the system comprising:
an encapsulated implant including:
a heating element externally coupled to a shunt, catheter, tube, or vessel configured to receive a flow of a bodily fluid, the heating element configured to dissipate heat at a predetermined rate over a predetermined amount of time;
a temperature sensor externally coupled to the heating element configured to measure a temperature rise of the heating element over the predetermined amount of time,
an implant microcontroller coupled to the temperature sensor configured to determine the flow rate of the bodily fluid in the shunt, catheter, tube or vessel from the measured temperature rise of the heating element over the predetermined amount of time and a curve fit to a stored set of previously obtained calibration measurements; and
an implant power and communication subsystem coupled to the implant microcontroller configured to wirelessly receive power and wirelessly transmit and receive data; and
an external device including:
an external microcontroller, and an external power and communication subsystem coupled to the external microcontroller configured to wirelessly deliver power to the implant power and communication subsystem and transmit and receive data to and from the implant power and communication subsystem.
49. The system of claim 48 in which the encapsulated implant is configured as a two-piece clamp externally coupled to the shunt, catheter, tube, or vessel.
50. A flow rate sensor system for non-invasively measuring the flow rate of a bodily fluid, the system comprising:
an encapsulated implant including:
a heating element externally coupled to the shunt, catheter, tube, or vessel configured to receive a flow of a bodily fluid the heating element configured to dissipate heat at a predetermined rate over a predetermined temperature rise of heating element;
a temperature sensor externally coupled to the heating element configured to measure a temperature drop of the heating element over a predetermined amount of time of cooling,
an implant microcontroller coupled to the temperature sensor configured to determine the flow rate of the bodily fluid in the shunt, catheter, tube or vessel from the measured temperature drop of the heating element over the predetermined amount of cooling time and a curve fit to a stored set of previously obtained calibration measurements, and
an implant power and communication subsystem coupled to the implant microcontroller configured to wirelessly receive power and wirelessly transmit and receive data; and
an external device including:
an external microcontroller, and
an external power and communication subsystem coupled to the external microcontroller configured to wirelessly deliver power to the implant power and communication subsystem and transmit and receive data to and from the implant power and communication subsystem.
51. The system of claim 50 in which the encapsulated implant is configured as a two-piece clamp externally coupled to the shunt, catheter, tube, or vessel.
52. A method for non-invasively measuring the flow rate of a bodily fluid, the method comprising:
providing an encapsulated implant coupled to a shunt, catheter, tube or vessel; receiving a flow of a bodily fluid in the shunt, catheter, tube or vessel;
externally coupling a heating element to the shunt, catheter, tube or vessel configured to dissipate heat at a predetermined rate over a predetermined amount of time;
externally coupling a temperature sensor to the heating element;
measuring a temperature rise of the heating element over a predetermined amount of time;
determining the flow rate of the bodily fluid in the shunt, catheter, tube or vessel from the measured temperature rise and a curve fit to a stored set of previously obtained calibration measurements;
providing an external device;
wirelessly delivering power from the external device to the encapsulated implant; and
wirelessly transmitting and receiving data to and from the encapsulated implant and the external device.
53. The method of claim 52 further including thermally isolating the heating element and the temperature sensor.
54. The method of claim 52 further including locating the encapsulated implant, using data wirelessly sent from the encapsulated implant to the external device.
55. The method of claim 52 further including positioning an external coil of the external device proximate and in alignment with an implant coil of the encapsulated implant to provide sufficient inductive coupling between an external coil of the external device and an implant coil.
56. The method of claim 52 further including storing on a microcontroller of the encapsulated implant the set of previously obtained calibration measurements.
57. The method of claim 52 further including storing on a microcontroller of the encapsulated implant identification information associated with the encapsulated implant. 122
58. The method of claim 52 further including determining the flow rate from a current measured temperature rise when the temperature of the heating element is determined to be no longer rising to minimize the length of time needed to determine the flow rate, the amount of heat generated by the heating device, and the amount of heat delivered to a patient.
59. A method for non-invasively measuring the flow rate of a bodily fluid, the method comprising:
providing an encapsulated implant coupled to a shunt, catheter, tube or vessel; receiving a flow of a bodily fluid in the a shunt, catheter, tube or vessel;
externally coupling a heating element to the shunt, catheter, tube or vessel configured to dissipate heat until a predetermined temperature rise is achieved;
externally coupling a temperature sensor to the heating element;
measuring a temperature drop of the heating element over a predetermined amount of time of cooling;
determining the flow rate of the bodily fluid in the flow tube from the measured temperature drop and a curve fit to a set of previously obtained calibration
measurements;
providing an external device;
wirelessly delivering power to the encapsulated implant; and
wirelessly transmitting and receiving data to and from the encapsulated implant.
PCT/US2015/000001 2014-04-18 2015-01-06 Flow rate sensor system and method for non-invasively measuring the flow rate of a bodily fluid Ceased WO2015160390A1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CA2978539A CA2978539C (en) 2014-04-18 2015-01-06 Flow rate sensor system and method for non-invasively measuring the flow rate of a bodily fluid
EP15780530.0A EP3131460B1 (en) 2014-04-18 2015-01-06 Flow rate sensor system for measuring the flow rate of a bodily fluid

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
US14/120,048 2014-04-18
US14/120,048 US20150297093A1 (en) 2014-04-18 2014-04-18 Flow rate sensor system and method for non-invasively measuring the flow rate of a bodily fluid

Publications (1)

Publication Number Publication Date
WO2015160390A1 true WO2015160390A1 (en) 2015-10-22

Family

ID=54320915

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/US2015/000001 Ceased WO2015160390A1 (en) 2014-04-18 2015-01-06 Flow rate sensor system and method for non-invasively measuring the flow rate of a bodily fluid

Country Status (4)

Country Link
US (1) US20150297093A1 (en)
EP (1) EP3131460B1 (en)
CA (1) CA2978539C (en)
WO (1) WO2015160390A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2022245498A1 (en) * 2021-05-17 2022-11-24 The Board Of Trustees Of The Leland Stanford Junior University Hydrocephalus shunt monitoring

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11478195B2 (en) 2015-01-14 2022-10-25 University Of Southern California Multi-sensor platform for diagnosing catheter status
EP3544489A1 (en) * 2016-11-28 2019-10-02 Koninklijke Philips N.V. Flow sensor and method of measuring a flow rate
EP3600518B1 (en) * 2017-03-30 2025-06-11 The University of Connecticut Flow sensor for cerebral fluidic device
CN107822594B (en) * 2017-09-28 2020-10-13 莆田学院 Cerebrospinal fluid shunt flow detection system and method

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5598847A (en) * 1994-12-28 1997-02-04 Pacesetter, Inc. Implantable flow sensor apparatus and method
US20050204811A1 (en) * 2004-02-03 2005-09-22 Neff Samuel R System and method for measuring flow in implanted cerebrospinal fluid shunts
US20050277839A1 (en) * 2004-06-10 2005-12-15 Honeywell International, Inc. Wireless flow measurement in arterial stent
US20130226068A1 (en) * 2007-10-31 2013-08-29 Codman & Shurtleff, Inc. Wireless shunts with storage
US20130245404A1 (en) * 2007-10-31 2013-09-19 DePuy Synthes Products, LLC Wireless flow sensor methods

Family Cites Families (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5346508A (en) * 1993-04-29 1994-09-13 Scimed Life Systems, Inc. Apparatus and method for performing diagnostics and intravascular therapies
US5636638A (en) * 1994-06-29 1997-06-10 Baxter International Inc. Electrical power amplifier for continuous cardiac output monitoring
US6626838B2 (en) * 1996-11-07 2003-09-30 Transoma Medical, Inc. Blood flow meter apparatus and method of use
US6533733B1 (en) * 1999-09-24 2003-03-18 Ut-Battelle, Llc Implantable device for in-vivo intracranial and cerebrospinal fluid pressure monitoring
EP1349492A2 (en) * 2001-01-04 2003-10-08 Medtronic, Inc. Implantable medical device with sensor
US8057401B2 (en) * 2005-02-24 2011-11-15 Erich Wolf System for transcutaneous monitoring of intracranial pressure
US8706208B2 (en) * 2007-03-24 2014-04-22 Board Of Regents, The University Of Texas System Passive wireless gastroesophageal sensor
US9072866B2 (en) * 2007-04-13 2015-07-07 Neuro Diagnostic Devices, Inc. Cerebrospinal fluid evaluation system having thermal flow and flow rate measurement pad using a plurality of control sensors
US20090143673A1 (en) * 2007-11-30 2009-06-04 Transonic Systems Inc. Transit time ultrasonic flow measurement
US20090204019A1 (en) * 2008-02-13 2009-08-13 Alec Ginggen Combined Pressure and Flow Sensor Integrated in a Shunt System
US20110054333A1 (en) * 2009-08-28 2011-03-03 Stentronics, Inc. Stent Flow Sensor
IL213767A (en) * 2011-06-23 2017-05-29 Adler Michael Method and apparatus for measuring the flow rate of a liquid
US20150164372A1 (en) * 2012-07-20 2015-06-18 Amin Katouzian Intelligent implanted health sensing device and assembly

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5598847A (en) * 1994-12-28 1997-02-04 Pacesetter, Inc. Implantable flow sensor apparatus and method
US20050204811A1 (en) * 2004-02-03 2005-09-22 Neff Samuel R System and method for measuring flow in implanted cerebrospinal fluid shunts
US20050277839A1 (en) * 2004-06-10 2005-12-15 Honeywell International, Inc. Wireless flow measurement in arterial stent
US20130226068A1 (en) * 2007-10-31 2013-08-29 Codman & Shurtleff, Inc. Wireless shunts with storage
US20130245404A1 (en) * 2007-10-31 2013-09-19 DePuy Synthes Products, LLC Wireless flow sensor methods

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See also references of EP3131460A4 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2022245498A1 (en) * 2021-05-17 2022-11-24 The Board Of Trustees Of The Leland Stanford Junior University Hydrocephalus shunt monitoring

Also Published As

Publication number Publication date
CA2978539C (en) 2020-01-21
EP3131460A1 (en) 2017-02-22
CA2978539A1 (en) 2015-10-22
EP3131460B1 (en) 2020-09-02
US20150297093A1 (en) 2015-10-22
EP3131460A4 (en) 2017-12-13

Similar Documents

Publication Publication Date Title
CA2978539C (en) Flow rate sensor system and method for non-invasively measuring the flow rate of a bodily fluid
US20230301538A1 (en) Sensor, circuitry, and method for wireless intracranial pressure monitoring
US20220125390A1 (en) Wireless and noninvasive epidermal electronics
US20230117147A1 (en) Calibration for multi-stage physiological monitors
US8764668B2 (en) Disposable blood pressure transducer and monitor interface
JP5475468B2 (en) Device for measuring the physiological state of the body
JP5558010B2 (en) Combined pressure and flow sensor integrated into shunt system
US20090143673A1 (en) Transit time ultrasonic flow measurement
JP2006231061A (en) Device for non-invasive measurement of fluid pressure in adjustable restriction device
CN110545717B (en) Apparatus and method for determining cardiac function of living body
US20220288362A1 (en) Systems and associated methods for improved interrogation of shunt functionality
CN102458238A (en) Non-Invasive Blood Pressure Monitoring System
CN105682545A (en) In vivo pressure monitoring system
CN101194830A (en) Transceiver units in pressure measurement systems
US20240044684A1 (en) Device for measuring rate of body fluid flow through a tube
JP2007105459A (en) Sensor/wire assembly
Hamel et al. Temperature and pressure fiber-optic sensors applied to minimally invasive diagnostics and therapies
WO2022245498A1 (en) Hydrocephalus shunt monitoring
WO2025085887A1 (en) Device for measuring rate of body fluid flow through a tube
Zhang Implantable intracranial pressure sensor to control hydrocephalus
US20210321895A1 (en) Integrated pressure monitoring system for detection of ventriculoperitoneal (vp) shunt clogs
US20060089562A1 (en) Modified hickman-type catheter with embedded thermistor

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 15780530

Country of ref document: EP

Kind code of ref document: A1

REEP Request for entry into the european phase

Ref document number: 2015780530

Country of ref document: EP

WWE Wipo information: entry into national phase

Ref document number: 2015780530

Country of ref document: EP

NENP Non-entry into the national phase

Ref country code: DE

ENP Entry into the national phase

Ref document number: 2978539

Country of ref document: CA