Presentation is loading. Please wait.

Presentation is loading. Please wait.

Automated Aquarium Controller System Software Design ETEC 474 Western Washington University By: Gregory Rose.

Similar presentations


Presentation on theme: "Automated Aquarium Controller System Software Design ETEC 474 Western Washington University By: Gregory Rose."— Presentation transcript:

1 Automated Aquarium Controller System Software Design ETEC 474 Western Washington University By: Gregory Rose

2 Kernel Selection Real-time preemptive multitasking kernel Configured for my program –Modify (os_cfg.h) MicroC/OS-II

3 Priority of Tasks 4) Start Task 5) Clock Task 6) User Interface Task 7) Key Task 8) Control Task 9) Main Task

4 Start Task Description:  Initializes system  Creates other tasks  Displays Startup message Priority #4 Period: once (at start-up) Execution time ~ 3sec

5 Clock Task Description:  Calculates current time of day and date Priority #5 Period: 1 sec (Periodic) Execution time ~ 1.5 us (max)

6 User Interface Task Description:  Handles User inputs Allows users to set Time Temperature pH Range Lamp times Feeding Amount Scheduled Water Change Priority #6 Period: 0.5 sec (Sporaidc) Execution time ~ 1.7 ms (max)

7 Key Task Description:  Reads the keypad and updates the buffer Priority #7 Period: 10 ms (Periodic) Execution time ~ 2.2us (max)

8 Control Task Description:  Read inputs and controls output LEDs, relays, and motor. Priority #8 Period: 1 sec (Periodic) Execution time ~ 1.5us (max)

9 Main Task Description:  Get A/D conversions  Updates the main operating screen Displays current Date, Time, Temperature, and pH when in main operating mode Priority #9 Period: 1 sec (Periodic) Execution time ~ 1.9 ms (max)

10 ISR Description:  Generate a semaphore every one second for Clock Task to calculate current time. Period: 1 ms (Periodic) Execution time ~ 291 ns (max)

11 CPU load L max= (1.5us) + (1.7ms) + (2.2ms) + (1.5us) + (1.9ms) + (291 ns) (1s) ( 0.5 s) (10ms) (1s) (1s) (1ms) L max= 22.6% L average = 9.2%

12 Modules Main.cATC.cClock.cLCD.c Key.c Control.c Tasks StartTaskClockTask KeyTask ControlTask UITask Main Task Functions and Data CorrectTime()AtdInit()CorrectTime()LcdInit() GetKey() TheDate LcdKeyAtdTempReadLcdKeyLcdClrDisp() KeyInit() TimeOfDay TimeKeyAtdPhRead()TimeKeyLcdDispChar() KeyFlag temp TheDatetempTheDateLcdDispStrg() ph TimeOfDayTimeOfDayLcdMoveCursor() settemp NumberArrayLcdDispTemp() phhigh UIStateLcdDispPh() phlow tempLcdDispTime() feeding phLcdCursor() lampon err lampoff input settemp phhigh phlow feeding lampon lampoff waterchange

13 Data Flow Diagrams Keypad Keypad I/O KeyTask() KeyCodeTable key KeyFlag Keypad Driver ModuleApplication KeyInit() KeyPend()

14 Data Flow Diagrams LCD LcdKey LCD Display LCD UITask DisplayMainTask Main.c LCD Driver Module

15 Data Flow Diagrams ISR IOC0 ISR OCOIsr OneSecond ClockTask Clock.cMain.cTimer Channel PostPend

16 Data Flow Diagrams A to D A-to–D I/O PAD00 PAD01 Ts = 1 sec AN0-1 ADRODR0H ADRODR1H AtdTempRead() AtdPhRead() ATDCTL5 A\D Converter AtoD.c

17 Data Flow Diagrams Control Items UITask phhigh phlow settemp temp ph feeding lampon lampoff MainTask main.ccontrol.c Control Task waterchange ClockTask TheDate TimeOfDay TimeKey clock.c


Download ppt "Automated Aquarium Controller System Software Design ETEC 474 Western Washington University By: Gregory Rose."

Similar presentations


Ads by Google