home security and lighting system western washington university jonathon ross 28 april, 2009

Post on 19-Jan-2016

216 Views

Category:

Documents

2 Downloads

Preview:

Click to see full reader

TRANSCRIPT

Home Security and Lighting System Western Washington University Jonathon Ross 28 April, 2009

MCU – MC9S12DP512 MCU Bus Frequency

• 25MHz Memory Requirements

• 3kB Ram• 10kB Rom

Kernel Choice • MicroC/OS-II

Start Task Light Sense Task User Interface Task Light Adjust Task Motion Sensor Task Alarm Task

Description• Creates tasks and displays startup

message.• Task Priority - #4 • Task Period - Once (Startup)• Estimated Task Execution Time - ~1s• Task CPU load - Not Applicable

Description• Senses and adjusts light according to a

predetermined level set by the user.• Task Priority - #5 • Task Period - 10ms (Periodic)• Estimated Task Execution Time - 1ms• Task CPU load

Average - .5/10 = .05 Peak - 1/10 = .1

Description• Interfaces between user and product as well

as controls states and other tasks• Task Priority - #6 • Task Period - 10ms (Periodic) • Estimated Task Execution Time - .1ms• Task CPU load

Average - .05/10 = .005 Peak - .1/10 = .01

Description• Allows user to adjust the lighting level with

a 4 button array. Options available - on, off, up, down

• Task Priority - #7 • Task Period - 10ms (Periodic)• Estimated Task Execution Time - .25ms• Task CPU load

Average - .1/10 = .01 Peak - .25/10 = .025

Description• Senses outside motion and activates a light

when movement is detected outside the front door.

• Task Priority - #8 • Task Period - 20ms (Periodic)• Estimated Task Execution Time - 1.5ms• Task CPU load

Average - 1/20 = .05 Peak - 1.5/20 = .075

Description• Detects open windows and doors and

activates an alarm when necessary.• Task Priority - #9 • Task Period - 50ms (Periodic)• Estimated Task Execution Time - .1ms• Task CPU load

Average - .05/50 = .001 Peak - .1/50 = .002

L max= (10%) + (1%) + (2.5%) + (7.5%) + (.2%)

L max= 21.2%

L average = (5%) + (.5%) + (1%) + (5%) + (.1%)

L average = 11.6%

Keypad I/O

Key.c()

KeyCodeTableKey

KeyFlag

Keypad ModuleApplication

KeyPend()UserInterfaceTask

LightAdjust()

StartTask()KeyInit()

KeyPend()

LCD I/O

Lcd.c()

LCD ModuleApplication

UserInterfaceTask()

LightAdjustTask()

StartTask()Lcd_init()

LcdClrDisp()LcdMoveCursor()LcdCursor()LcdBackspace()LcdForwardSpace()LcdDispChar()LcdDispDecNum()putstrg()

LightSensor

Application

LightSenseTask()TRIAC/Bulbs

LightSensor I/OLight Bulbs/Output

LightAdjustTask()

Level

Level.flag

Alarm 1Alarm 2Alarm 3Alarm 4Alarm 5

Application

AlarmTask()Buzzer

Alarm Groups I/OAlarm

MotionSensorTask()TRIAC

Light

Motion Sensor

Motion Sensor I/O

top related