Archives

  • 2018-07
  • 2018-10
  • 2018-11
  • 2019-04
  • 2019-05
  • 2019-06
  • 2019-07
  • 2019-08
  • 2019-09
  • 2019-10
  • 2019-11
  • 2019-12
  • 2020-01
  • 2020-02
  • 2020-03
  • 2020-04
  • 2020-05
  • 2020-06
  • 2020-07
  • 2020-08
  • 2020-09
  • 2020-10
  • 2020-11
  • 2020-12
  • 2021-01
  • 2021-02
  • 2021-03
  • 2021-04
  • 2021-05
  • 2021-06
  • 2021-07
  • 2021-08
  • 2021-09
  • 2021-10
  • 2021-11
  • 2021-12
  • 2022-01
  • 2022-02
  • 2022-03
  • 2022-04
  • 2022-05
  • 2022-06
  • 2022-07
  • 2022-08
  • 2022-09
  • 2022-10
  • 2022-11
  • 2022-12
  • 2023-01
  • 2023-02
  • 2023-03
  • 2023-04
  • 2023-05
  • 2023-06
  • 2023-07
  • 2023-08
  • 2023-09
  • 2023-10
  • 2023-11
  • 2023-12
  • 2024-01
  • 2024-02
  • 2024-03
  • 2024-04
  • 2024-05
  • 2024-06
  • 2024-07
  • 2024-08
  • 2024-09
  • The USB communication between the PIC F microcontroller

    2018-11-05

    The USB communication between the PIC18F2550 microcontroller and the computer is accomplished using the data link library mpusbapi.dll, which is supplied free of charge by Microchip. Labview uses this file through a set of special functions to identify the device, specify the types of data used and set the format. The information is received on the computer in packages of eight bytes using unsigned integer data type and with 10ms reading intervals to ensure correct reception. In order to display the heart’s electrical signal, each package is divided into eight-bit patterns, which correspond with the digital information produced by the analog to digital converter and stored in an integer data array. This process is sequentially repeated 500 times to get 4000 eight-bit data at a rate of 1821 samples per second. Under these conditions the Graphical User Interface (GUI), developed using the Labview Waveform Graph function, display on the computer monitor a four cycles electrocardiogram, as shown in Fig. 11 for the case of a healthy patient. For each electrocardiogram is possible to choose one of the options built into the system through the GUI to associate a text file, store, print or add it to the database, Fig. 12. The text file is very important because it stores relevant patient’s information such as name, sex, age, height, weight, buy FMK rate, date, time, location and additional information about a possible treatment. The option to add a new electrocardiogram within the database will let the system to diagnose a greater variety of arrhythmias in the future. Each electrocardiogram is different from others, so it is necessary to analyze amplitude and frequency to determine whether there is any arrhythmia. The information stored in the database is fundamental to the analysis stage. This stage is further divided into three stages as shown in Fig. 13: comparison of a patient’s electrocardiogram with the database, adjusting step for diagnosing a disease by comparison and analysis of heart rate. Finally, based on an algorithm that interprets the data obtained in the analysis stage, diagnosis is obtained automatically to know if the patient holds a normal condition or the presence of tachycardia, bradycardia, right bundle branch block or a pacemaker, with a high degree of certainty. The algorithm to determine a diagnosis uses as the first criterion for comparison during the analysis two characteristics given by the user: sex and age. Using these characteristics the algorithm selects a set of electrocardiograms from the database for the comparisons to determine the patient’s condition. This process is associated with the analysis step and generates a vector of values for representing the error of the difference obtained in the comparison. These values represent an approximation to the zero point, so positively be represented by a sum of multiplications, in which a vector x is multiplied by a vector y according to the following equation:where n is the number of data and is the complex conjugate of , for output a scalar value. In x data obtained from the patient are stored and in y data of the extracted comparison database are stored. This way allows a summation value representing the degree of error expressed with a real number. To increase the reliability of this process, the amount of data of both vectors corresponding to the time required to within four cycles of the waveform is analyzed. For this reason, the matching process for all selected electrocardiograms gets executed four times using the technique of the zero point where, whenever two values are very close, their maxima and minima are subtracted and their resulting amplitudes are evaluated, thus the amplitude near zero indicates that it is the target signal and select such electrocardiogram from the database. Given that the process runs four times, there are four results to estimate the probability of reaching a correct diagnosis. The results are shown by the user interface in a column of four windows of text, as shown in Fig. 14, the top window displays the most likely diagnosis and if any, in the following windows appear with other diagnoses probabilities 75%, 50% and 25%, respectively.