Presentation is loading. Please wait.

Presentation is loading. Please wait.

HOME CONTROL SYSTEM By: Justin E. Klumpp & Leo L.S. Wan Leo L.S. Wan.

Similar presentations


Presentation on theme: "HOME CONTROL SYSTEM By: Justin E. Klumpp & Leo L.S. Wan Leo L.S. Wan."— Presentation transcript:

1

2 HOME CONTROL SYSTEM By: Justin E. Klumpp & Leo L.S. Wan Leo L.S. Wan

3 Base Microcontroller  Motorola 9S12DP256B  Bus Frequency at 16MHz  Memory 256k bytes Flash256k bytes Flash 12k bytes RAM12k bytes RAM 4k bytes EEPROM4k bytes EEPROM

4 Kernel Choice  MicroC/OS-II  Real-Time preemptive multitasking kernel  Semaphores used to communicate between tasks  Tick period, 1ms

5 Kernel Tasks & Priority  StartTaskPriority:4  ControlTaskPriority:5  RTCTaskPriority:6  DAATaskPriority:7  SCITaskPriority:8  KeyTaskPriority:9

6 StartTask  Description: Initializes MicroC/OS and creates the other tasks during startup  Priority: 4  Period: Executes once at startup  Execution Time: 150ms estimated

7 ControlTask  Description: This task controls all remote modules and intertask communication. It interprets all user’s command, phone line termination, sprinkler control, DTMF input, and User Interface control.  Priority: 5  Execution Time: 4ms (max)  Period: 10 ms (Periodic)  CPU Load: 0.4

8 RTCTask  Description: Receive real time data from the DS1305 real time clock.  Priority: 6  Execution Time: 35 us  Period: 1 second (Periodic)  CPU Load: 0.000035

9 DAATask  Description: This task will scan the RING pin on the DAA chip for valid ring signals  Priority: 7  Execution time: 50us  Period: 20ms  CPU Load:.0025

10 SCITask  Description: Poll the SCI Receive Data Register Full (RDRF) flag, once flag is set, SCI clocks in data into a buffer.  Priority: 8  Execution Time: 50us.  Period: 10 ms (Periodic)  CPU Load: 0.005

11 KeyTask  Description: The main keypad scanning task. It scans the keypad and updates the keypad buffer if a key press was verified.  Priority: 9  Period: 10ms  Execution Time: 50us  CPU Load: 0.005 Code Composed by: Todd Morton

12 Total CPU Load  Max CPU Load: 0.4 + 0.000035 + 0.0025 + 0.005 + 0.005 0.4 + 0.000035 + 0.0025 + 0.005 + 0.005 = 0.412535 = 0.412535  Average CPU Load: 0.25

13 Base Control Software ModulesTasks Public Functions and Data Main.cDAATaskRTCTaskStartTaskControlTask VoiceCtrl.cVoiceInit()PlayMSG() LCD.c Code Composed By: Todd Morton Todd MortonLcdInit()LcdClrDisp()LcdMoveCursor()LcdDispStrg()LcdDispChar()LcdDispTime()LcdCursor() Key.c Code Composed By: Todd Morton Todd MortonKeyTaskKeyInit()KeyPend()

14 Base Control Software continued…. ModulesTasks Public Functions and Data EEProm.c Code Composed By: Todd Morton Todd MortonEEPROMInit()EESectModify() SCI_Driver.cSCITaskReadSCI()WriteSCI()InitSCI() DTMF.cDTMFInit()DTMFWrite()DTMFRead() UI.cTimeSet()PhoneSet()AlarmSet()UIMenu() SPI_driver.c Code Composed By: Jon Peterson Jon PetersonReadSPI()WriteSPI()InitSPI()

15 LCD Flow Diagram LCD I/OLCD Driver Public Function(s) Lcd() LcdClrDisp() LcdDispTime() LcdCursor() LcdMoveCursor() LcdDispStrg() LcdInit() LcdDispChar() UI.c TimeSet() PhoneSet() UIMenu() AlarmSet()

16 Keypad Flow Diagram Keypad I/O Keypad DriverPublic Function(s) KeyTask() Key.buffer Key.flag KeyCode Table KeyPend() KeyInit() 10msec

17 Control Task Flow Diagram Awaiting Flags Control TaskFunctions to Call ControlTask() 10msec KeyPend() TimePend() RingPend() SCIPend() DTMFRead() TimeSet() PhoneSet() UIMenu() AlarmSet() PlayMSG() DTMFWrite() EESectModify() WriteSCI() LcdDispTime()

18 MCU: Control Modules  MCU: PSoC CY8C29466  Operating Voltage: 5 volts  Clock Frequency: 6 MHz  Microcontroller will only run one continuous task so no kernel is required  Memory, MCU #1 (Bytes): 25 RAM, 1042 ROM  Memory, MCU #2 (Bytes): 20 RAM, 904 ROM

19 Wireless Alarm Software ModulesTasks Public Functions and Data Main.cAlarmTask Sleep_ISR.c tx8.inc From the TX8 Library on PSoC Designer Software TX8_Start()TX8_bReadTxStatus()TX8_SendData() m8c.inc From the m8c Library on PSoC Designer Software M8C_ClearWDTAndSleep()

20 AlarmTask  Description: Send a byte of data at a rate of 300bps. The byte of data contains the current state of the alarm sensor, and a unique alarm ID number.  Period: Runs on a sleep timer that wakes up every second  Execution time: ~1us  CPU Load: 0.000001

21 ISR: Sleep Timer  Description: This timer is used to put the Microcontroller into a sleep mode, where the current consumption on the PSoC is ~2.9uA.  Execution Time: ~1us  Period: 1 second  CPU Load: 0.000001

22 Data Flow Diagram: ISR Sleep Timer Interrupt

23 Appliance Control Software ModulesTasks Public Functions and Data Main.cLightCtrlTask rx8.inc From the TX8 Library on PSoC Designer Software RX8_Start()RX8_bReadRxStatus()RX8_bReadRxData() timer8.inc From the Timer8 Library in PSoC Designer Software Counter8_Start()Counter8_WritePeriod()Counter8_WriteCompareValue()

24 LightCtrlTask  Description: Polls on a valid data flag to be set, if set clocks in bits of data. Receive byte of data at 300bps; data contains control bits to turn on/off output pins. Controls the state of a relay; on or off.  Execution time: ~1us  Period: Continuous Operation  CPU Load: 1


Download ppt "HOME CONTROL SYSTEM By: Justin E. Klumpp & Leo L.S. Wan Leo L.S. Wan."

Similar presentations


Ads by Google