19.11.2013 Views

Spirometer Demo with Freescale Microcontrollers

Spirometer Demo with Freescale Microcontrollers

Spirometer Demo with Freescale Microcontrollers

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Software architecture<br />

Figure 16. State Wait for inhalation flow chart<br />

4.5.3 State—Measuring inhalation<br />

After the result of the ADC is less than the inhalation threshold, the next state taken by the state machine is the measuring<br />

inhalation state. This state handles data processing while the patient is inhaling. With each new sample, the microcontroller<br />

calculates and updates the spirometry parameters, including flow and volume, which are sent to the host PC via USB<br />

communication. The value delivered by the ADC is continuously compared <strong>with</strong> the baseline; this is to know when inhalation<br />

has finished. Figure 17 is the flow chart.<br />

<strong>Spirometer</strong> <strong>Demo</strong> <strong>with</strong> <strong>Freescale</strong> <strong>Microcontrollers</strong>, Rev. 1, 12/2012<br />

16 <strong>Freescale</strong> Semiconductor, Inc.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!