1 / 22

Turbine Flow Meter

Turbine Flow Meter. Kevin Hooks Senior Design Project. Overview. Micro Controller Kernel, Tasks, CPU Load Data Flow Diagrams State Machine Diagrams Module, Public Tasks, Functions and Variables Questions?. Micro Controller. HC9S12DP512 16-bit device

snana
Download Presentation

Turbine Flow Meter

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Turbine Flow Meter Kevin Hooks Senior Design Project

  2. Overview • Micro Controller • Kernel, Tasks, CPU Load • Data Flow Diagrams • State Machine Diagrams • Module, Public Tasks, Functions and Variables • Questions?

  3. Micro Controller • HC9S12DP512 • 16-bit device • 512K bytes Flash EEPROM, 14K bytes RAM, 4K bytes of EEPROM • 2 SCI , 3 SPI, 8-channel IC/OC ECT, two 8-channel, 10-bit ADC, 8 channel PWM, 29 GPIO, 20 GPIO with interrupts • 24 MHz Bus Frequency

  4. Micro Controller • About < 300 Kbytes Flash EEPROM • 1 SCI • 1 SPI • 2 IC/IOC (1 input capture, 1 Pulse Accumulator)

  5. Kernel • Time Slicing • Period of 1s • Total Tasks 5 • 1 Interrupts

  6. Tasks • LCD_Update • Pulse_Count • Period_Count • Thermo_Get • Calculate_Values

  7. LCD_Update • Checks for Display Units • Compares Current LCD Value with new LCD Value • If different then update LCD display • Run Time ~10ms max, ~1ms Average • CPU Load ~ 10ms/1s = 10% max, ~1ms/1s = 1% average

  8. Pulse_Count • Counts Pulses for 10ms • Stores Value in public variable *Pulse_Val • Run Time ~10ms • CPU Load ~10ms/1s = 10%, should always be 10ms

  9. Period_Count • Counts the period of one pulse • Stores value in public Variable *Period_Val • Run Time Varies based on Frequency (Max of 1ms at frequency of 10kHz average of .5ms at 50kHz) • CPU Load ~1ms/1s = 1% max, ~.5ms/1s = .5% average

  10. Thermo_Get • Performs an SPI read for one 16-bit value from the MAX6675 and stores into variable Thermo_Val. Only 12 bits are used so it will need to be masked. • At 24MHz clock the runtime is max ~10uS • CPU Load = ~10us/1s =.001%

  11. Calculate_Values • Receives variables from each get task and performs a series of calculations to provide one final 8-bit result New_Value • Checks for variable set by touch screen ISR to determine calculations for correct units • Run Time ~10us • CPU Load = ~10us/1s = .001%

  12. Get_Touch ISR • If a screen touch is detected, jump to ISR • This ISR simply sets a variable to a specific value. This will be used to determine unit display • Run Time is ~1uS

  13. Final CPU Load • Max CPU Load = 10ms/1s + 10ms/1s + 1ms/1s + 1us/1s + 1us/1s = 21.002% • Average CPU Load = 16.502%

  14. Data Flow Diagram: LCD_Update Task

  15. Data Flow Diagram: Pulse_Count

  16. Data Flow Diagram: Period_Count

  17. Data Flow Diagram: Thermo_Get

  18. Data Flow Diagram: Calculate_Values

  19. Data Flow Diagram: SCI_Read_Isr

  20. State Diagram for UI Initial State

  21. Modules, Tasks, Public Data

  22. Questions?

More Related