Presentation is loading. Please wait.

Presentation is loading. Please wait.

Humidity Sensing Fan Controller Jason Huft 05/11/10.

Similar presentations


Presentation on theme: "Humidity Sensing Fan Controller Jason Huft 05/11/10."— Presentation transcript:

1 Humidity Sensing Fan Controller Jason Huft 05/11/10

2 General System Requirements MCU: HC9S08QE32, 44 pin package Bus Frequency: approximately 50 MHz Internal clock source. Timeslice Kernel – Timeslice Period: 100 ms Memory Available: – 32k EEPROM – 2k RAM Memory Requirement: – 8-10k EEProm – 2k RAM

3 Timeslice Kernel Tasks Startup Task Push-Button Task Display Task Humidity Detect Task Fan Control Task Timing Task WaitForSlice

4 Start Task Sets initial state of the system and initializes the registers. Execution Time: – 100ms worst case. Period: – Once at Startup

5 Push-Button Task Waits and recognizes a key press on a push- button switch. De-bounces the switch. Period: 20ms (sporatic) Execution Time: 10μs Changes state from key press – Off – On (can recognize multiple presses of this key) – Automatic

6 Humidity Detect Task Observes changing voltage from the sensor Converts the voltage into digital information Passes voltage level as a hex output to the MCU. Period 100ms Execution Time 5μs

7 Display Task Writes information to LCD display Takes timing information from timer task Also reports current state if in On or Automatic State. Period: 100ms Execution Time: about 5ms.

8 Fan Control Task Interrupts information from the Humidity Detect Task to choose if the fan should be on/off in automatic state. Calls fan activated/deactivate based on state. Period: 20ms (sporadic) Execution Time: 20us max (10 us average)

9 Timing Task Keeps track of remaining time in the on state. Mostly internal clock. Receives information from Push-Button Task Changes system state if certain conditions are met. Period: 100ms Execution Time: 20us or so

10 Wait for Slice Fills the remaining time in each slice period. Included to assist in proper task timing and debugging. Period: 100ms Execution Time: Varies based on how many other tasks need to execute in one slice period.

11 Modules ModuleTasksPublic Functions & Data Humidity.cStartup Task Humidity Detect Task Relay-Control Task WaitForSlice HumidityLevel FanActive() FanDeactivate() AtDInit() LcdInit() HumidityRead() ButtonInit() Button.cPush-Button TaskOnPressedMultiple CurrentFanState LCD.c Written by Todd Morton Display TaskLcdClrDisplay() LcdDispString() LcdMoveCursor() LcdDispByte() Time.cTiming TaskClockInit() TimeRemaining OCDelay.cOCDelay() GetmSCnt() Start08.c Written by Freescale mc9s08qe128.c Written by Freescale

12 CPU Load Max CPU Load – 20us/100ms + 20us/20ms + 5ms/20ms + 10us/20ms + 5us/100ms =.05175 * 100 = 25.175% Max CPU load - 20us/100ms + 5ms/100ms + 10us/20ms + 5us/100ms = 5.12% average CPU Load

13 Main Dataflow Diagram

14 Dataflow Diagram: Continued

15 AtD Converter Dataflow Diagram A-to–D I/O pin ADP0 Ts = 100ms A\D Converter Humidity Detect Task AtDInit() HumidityRead() ADCCFG ADCSC1 AD0 HumidityLevel


Download ppt "Humidity Sensing Fan Controller Jason Huft 05/11/10."

Similar presentations


Ads by Google